Bug 1393909 remove sync messaging from WebRequest, r=kmag
authorShane Caraveo <scaraveo@mozilla.com>
Fri, 25 Aug 2017 12:36:28 -0700
changeset 377044 e1d63de12f2c0047290d92b1ef1336e6027e9d3e
parent 377043 98a6294158926166c18e57aec1f1adcff4f5e8a2
child 377045 5868e138b604545728cad64413041d7a89a9f5c1
push id32397
push userphilringnalda@gmail.com
push dateSun, 27 Aug 2017 01:13:26 +0000
treeherdermozilla-central@30ee0dcda883 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskmag
bugs1393909
milestone57.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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;
   },