зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1393909 remove sync messaging from WebRequest, r=kmag
MozReview-Commit-ID: BrZ6FgP7Uyj --HG-- extra : rebase_source : 349b30cf05508ca1232fc7d60efec6e394d05bdc
This commit is contained in:
Родитель
acd63fe809
Коммит
75156ec5c2
|
@ -102,14 +102,10 @@ var ContentPolicy = {
|
|||
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);
|
||||
}
|
||||
}
|
||||
|
@ -177,14 +173,7 @@ var ContentPolicy = {
|
|||
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;
|
||||
},
|
||||
|
|
Загрузка…
Ссылка в новой задаче