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

Unified Diff: lib/contentPolicy.js

Issue 29329390: Issue 3208 - Stop watching category removals (Closed)
Patch Set: Removed comment as well Created Oct. 26, 2015, 8:33 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/contentPolicy.js
===================================================================
--- a/lib/contentPolicy.js
+++ b/lib/contentPolicy.js
@@ -405,27 +405,21 @@ var PolicyImplementation =
// http-on-opening-request is new in Gecko 18, http-on-modify-request can
// be used in earlier releases.
let httpTopic = "http-on-opening-request";
if (Services.vc.compare(Utils.platformVersion, "18.0") < 0)
httpTopic = "http-on-modify-request";
Services.obs.addObserver(this, httpTopic, true);
Services.obs.addObserver(this, "content-document-global-created", true);
- Services.obs.addObserver(this, "xpcom-category-entry-removed", true);
- Services.obs.addObserver(this, "xpcom-category-cleared", true);
onShutdown.add(function()
{
- // Our category observers should be removed before changing category
- // memberships, just in case.
Services.obs.removeObserver(this, httpTopic);
Services.obs.removeObserver(this, "content-document-global-created");
- Services.obs.removeObserver(this, "xpcom-category-entry-removed");
- Services.obs.removeObserver(this, "xpcom-category-cleared");
for (let category of this.xpcom_categories)
catMan.deleteCategoryEntry(category, this.contractID, false);
// This needs to run asynchronously, see bug 753687
Utils.runAsync(function()
{
registrar.unregisterFactory(this.classID, this);
@@ -539,35 +533,16 @@ var PolicyImplementation =
this.observe(wnd, "content-document-global-created", null, subject.URI);
if (subject instanceof Ci.nsIWritablePropertyBag)
subject.setProperty("abpRequestType", Policy.type.POPUP);
}
}
break;
}
- case "xpcom-category-entry-removed":
- case "xpcom-category-cleared":
- {
- let category = data;
- if (this.xpcom_categories.indexOf(category) < 0)
- return;
-
- if (topic == "xpcom-category-entry-removed" &&
- subject instanceof Ci.nsISupportsCString &&
- subject.data != this.contractID)
- {
- return;
- }
-
- // Our category entry was removed, make sure to add it back
- let catMan = Utils.categoryManager;
- catMan.addCategoryEntry(category, this.contractID, this.contractID, false, true);
- break;
- }
}
},
//
// nsIChannelEventSink interface implementation
//
asyncOnChannelRedirect: function(oldChannel, newChannel, flags, callback)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld