mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 21:31:04 +00:00
Bug 1239913 - Convert toolkit/ to use asyncOpen2 where loadingPrincipal is SystemPrincipal (r=sicking)
This commit is contained in:
parent
c37a18ec34
commit
eb33d87f83
@ -1984,7 +1984,7 @@ this.DownloadCopySaver.prototype = {
|
||||
|
||||
// Open the channel, directing output to the background file saver.
|
||||
backgroundFileSaver.QueryInterface(Ci.nsIStreamListener);
|
||||
channel.asyncOpen({
|
||||
channel.asyncOpen2({
|
||||
onStartRequest: function (aRequest, aContext) {
|
||||
backgroundFileSaver.onStartRequest(aRequest, aContext);
|
||||
|
||||
@ -2086,7 +2086,7 @@ this.DownloadCopySaver.prototype = {
|
||||
aInputStream, aOffset,
|
||||
aCount);
|
||||
}.bind(copySaver),
|
||||
}, null);
|
||||
});
|
||||
|
||||
// We should check if we have been canceled in the meantime, after
|
||||
// all the previous asynchronous operations have been executed and
|
||||
|
@ -27,6 +27,8 @@ const BACKOFF_MAX = 8 * 60 * 60 * 1000;
|
||||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/NetUtil.jsm");
|
||||
|
||||
|
||||
// Log only if browser.safebrowsing.debug is true
|
||||
function log(...stuff) {
|
||||
@ -236,13 +238,10 @@ HashCompleterRequest.prototype = {
|
||||
let loadFlags = Ci.nsIChannel.INHIBIT_CACHING |
|
||||
Ci.nsIChannel.LOAD_BYPASS_CACHE;
|
||||
|
||||
let uri = Services.io.newURI(this.gethashUrl, null, null);
|
||||
let channel = Services.io.newChannelFromURI2(uri,
|
||||
null, // aLoadingNode
|
||||
Services.scriptSecurityManager.getSystemPrincipal(),
|
||||
null, // aTriggeringPrincipal
|
||||
Ci.nsILoadInfo.SEC_NORMAL,
|
||||
Ci.nsIContentPolicy.TYPE_OTHER);
|
||||
let channel = NetUtil.newChannel({
|
||||
uri: this.gethashUrl,
|
||||
loadUsingSystemPrincipal: true
|
||||
});
|
||||
channel.loadFlags = loadFlags;
|
||||
|
||||
// Disable keepalive.
|
||||
@ -261,7 +260,7 @@ HashCompleterRequest.prototype = {
|
||||
let timeout = Services.prefs.getIntPref(
|
||||
"urlclassifier.gethash.timeout_ms");
|
||||
this.timer_.initWithCallback(this, timeout, this.timer_.TYPE_ONE_SHOT);
|
||||
channel.asyncOpen(this, null);
|
||||
channel.asyncOpen2(this);
|
||||
},
|
||||
|
||||
// Returns a string for the request body based on the contents of
|
||||
|
Loading…
Reference in New Issue
Block a user