Bug 1393909 remove sync messaging from WebRequest, r?kmag
MozReview-Commit-ID: BrZ6FgP7Uyj
--- a/toolkit/modules/addons/WebRequestContent.js
+++ b/toolkit/modules/addons/WebRequestContent.js
@@ -97,24 +97,20 @@ var ContentPolicy = {
return Ci.nsIContentPolicy.ACCEPT;
}
let url = contentLocation.spec;
if (IS_HTTP.test(url)) {
// We'll handle this in our parent process HTTP observer.
return Ci.nsIContentPolicy.ACCEPT;
}
- let block = false;
let ids = [];
- for (let [id, {blocking, filter}] of this.contentPolicies.entries()) {
+ for (let [id, {filter}] of this.contentPolicies.entries()) {
if (WebRequestCommon.typeMatches(policyType, filter.types) &&
WebRequestCommon.urlMatches(contentLocation, filter.urls)) {
- if (blocking) {
- block = true;
- }
ids.push(id);
}
}
if (!ids.length) {
return Ci.nsIContentPolicy.ACCEPT;
}
@@ -172,24 +168,17 @@ var ContentPolicy = {
let data = {ids,
url,
type: WebRequestCommon.typeForPolicyType(policyType),
windowId,
parentWindowId};
if (requestOrigin) {
data.originUrl = requestOrigin.spec;
}
- if (block) {
- let rval = mm.sendSyncMessage("WebRequest:ShouldLoad", data);
- if (rval.length == 1 && rval[0].cancel) {
- return Ci.nsIContentPolicy.REJECT;
- }
- } else {
- mm.sendAsyncMessage("WebRequest:ShouldLoad", data);
- }
+ mm.sendAsyncMessage("WebRequest:ShouldLoad", data);
return Ci.nsIContentPolicy.ACCEPT;
},
shouldProcess: function(contentType, contentLocation, requestOrigin, insecNode, mimeType, extra) {
return Ci.nsIContentPolicy.ACCEPT;
},