mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1223435 - Use channel.asyncOpen2 in toolkit/mozapps/extensions/internal/XPIProvider.jsm (r=sicking)
This commit is contained in:
parent
eea4436b8e
commit
4c9499e970
@ -2410,12 +2410,11 @@ this.XPIProvider = {
|
|||||||
|
|
||||||
let chan;
|
let chan;
|
||||||
try {
|
try {
|
||||||
chan = Services.io.newChannelFromURI2(aURI,
|
chan = NetUtil.newChannel({
|
||||||
null, // aLoadingNode
|
uri: aURI,
|
||||||
Services.scriptSecurityManager.getSystemPrincipal(),
|
loadUsingSystemPrincipal: true,
|
||||||
null, // aTriggeringPrincipal
|
securityFlags: Ci.nsILoadInfo.SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL
|
||||||
Ci.nsILoadInfo.SEC_NORMAL,
|
});
|
||||||
Ci.nsIContentPolicy.TYPE_OTHER);
|
|
||||||
}
|
}
|
||||||
catch (ex) {
|
catch (ex) {
|
||||||
return null;
|
return null;
|
||||||
@ -5414,14 +5413,16 @@ AddonInstall.prototype = {
|
|||||||
|
|
||||||
this.channel = NetUtil.newChannel({
|
this.channel = NetUtil.newChannel({
|
||||||
uri: this.sourceURI,
|
uri: this.sourceURI,
|
||||||
loadUsingSystemPrincipal: true});
|
loadUsingSystemPrincipal: true,
|
||||||
|
securityFlags: Ci.nsILoadInfo.SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL
|
||||||
|
});
|
||||||
this.channel.notificationCallbacks = this;
|
this.channel.notificationCallbacks = this;
|
||||||
if (this.channel instanceof Ci.nsIHttpChannel) {
|
if (this.channel instanceof Ci.nsIHttpChannel) {
|
||||||
this.channel.setRequestHeader("Moz-XPI-Update", "1", true);
|
this.channel.setRequestHeader("Moz-XPI-Update", "1", true);
|
||||||
if (this.channel instanceof Ci.nsIHttpChannelInternal)
|
if (this.channel instanceof Ci.nsIHttpChannelInternal)
|
||||||
this.channel.forceAllowThirdPartyCookie = true;
|
this.channel.forceAllowThirdPartyCookie = true;
|
||||||
}
|
}
|
||||||
this.channel.asyncOpen(listener, null);
|
this.channel.asyncOpen2(listener);
|
||||||
|
|
||||||
Services.obs.addObserver(this, "network:offline-about-to-go-offline", false);
|
Services.obs.addObserver(this, "network:offline-about-to-go-offline", false);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user