Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: lib/contentPolicy.js

Issue 6263536791584768: Issue 2232 - Got rid of non-standard conditional catch clauses (Closed)
Patch Set: Created March 30, 2015, 4:57 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2015 Eyeo GmbH 3 * Copyright (C) 2006-2015 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 /** 337 /**
338 * Registers the content policy on startup. 338 * Registers the content policy on startup.
339 */ 339 */
340 init: function() 340 init: function()
341 { 341 {
342 let registrar = Components.manager.QueryInterface(Ci.nsIComponentRegistrar); 342 let registrar = Components.manager.QueryInterface(Ci.nsIComponentRegistrar);
343 try 343 try
344 { 344 {
345 registrar.registerFactory(this.classID, this.classDescription, this.contra ctID, this); 345 registrar.registerFactory(this.classID, this.classDescription, this.contra ctID, this);
346 } 346 }
347 catch (e if e.result == Cr.NS_ERROR_FACTORY_EXISTS) 347 catch (e)
348 { 348 {
349 // See bug 924340 - it might be too early to init now, the old version 349 // See bug 924340 - it might be too early to init now, the old version
350 // we are replacing didn't finish removing itself yet. 350 // we are replacing didn't finish removing itself yet.
351 Utils.runAsync(this.init.bind(this)); 351 if (e.result == Cr.NS_ERROR_FACTORY_EXISTS)
352 return; 352 {
353 Utils.runAsync(this.init.bind(this));
354 return;
355 }
356
357 Cu.reportError(e);
353 } 358 }
354 359
355 let catMan = Utils.categoryManager; 360 let catMan = Utils.categoryManager;
356 for (let category of this.xpcom_categories) 361 for (let category of this.xpcom_categories)
357 catMan.addCategoryEntry(category, this.contractID, this.contractID, false, true); 362 catMan.addCategoryEntry(category, this.contractID, this.contractID, false, true);
358 363
359 // http-on-opening-request is new in Gecko 18, http-on-modify-request can 364 // http-on-opening-request is new in Gecko 18, http-on-modify-request can
360 // be used in earlier releases. 365 // be used in earlier releases.
361 let httpTopic = "http-on-opening-request"; 366 let httpTopic = "http-on-opening-request";
362 if (Services.vc.compare(Utils.platformVersion, "18.0") < 0) 367 if (Services.vc.compare(Utils.platformVersion, "18.0") < 0)
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
781 if (!wnd || wnd.closed) 786 if (!wnd || wnd.closed)
782 return; 787 return;
783 788
784 if (entry.type == Policy.type.OBJECT) 789 if (entry.type == Policy.type.OBJECT)
785 { 790 {
786 node.removeEventListener("mouseover", objectMouseEventHander, true); 791 node.removeEventListener("mouseover", objectMouseEventHander, true);
787 node.removeEventListener("mouseout", objectMouseEventHander, true); 792 node.removeEventListener("mouseout", objectMouseEventHander, true);
788 } 793 }
789 Policy.processNode(wnd, node, entry.type, Utils.makeURI(entry.location), true) ; 794 Policy.processNode(wnd, node, entry.type, Utils.makeURI(entry.location), true) ;
790 } 795 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld