Bug 1393909 remove sync messaging from WebRequest, r?kmag draft
authorShane Caraveo <scaraveo@mozilla.com>
Fri, 25 Aug 2017 12:36:28 -0700
changeset 653250 14040025f0bfc13b1219d7f9733c8ce581d1297f
parent 653118 56188620cce00b19700fbb8efaafea65e6ca8c61
child 728296 2cf8b06769f7c905581eca641f4058b6f2bbe6c2
push id76281
push usermixedpuppy@gmail.com
push dateFri, 25 Aug 2017 19:37:50 +0000
reviewerskmag
bugs1393909
milestone57.0a1
Bug 1393909 remove sync messaging from WebRequest, r?kmag MozReview-Commit-ID: BrZ6FgP7Uyj
toolkit/modules/addons/WebRequestContent.js
--- 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;
   },