Merge pull request #6054 from Snuffleupagus/bug-1167053
[Firefox] Fix newChannel/asyncFetch fallout from bug 1167053
This commit is contained in:
commit
95bd84148a
@ -183,10 +183,7 @@ function makeContentReadable(obj, window) {
|
|||||||
|
|
||||||
function createNewChannel(uri, node, principal) {
|
function createNewChannel(uri, node, principal) {
|
||||||
//#if !MOZCENTRAL
|
//#if !MOZCENTRAL
|
||||||
if (!NetUtil.newChannel2) {
|
if (NetUtil.newChannel2) {
|
||||||
return NetUtil.newChannel(uri);
|
|
||||||
}
|
|
||||||
//#endif
|
|
||||||
return NetUtil.newChannel2(uri,
|
return NetUtil.newChannel2(uri,
|
||||||
null,
|
null,
|
||||||
null,
|
null,
|
||||||
@ -196,14 +193,28 @@ function createNewChannel(uri, node, principal) {
|
|||||||
Ci.nsILoadInfo.SEC_NORMAL,
|
Ci.nsILoadInfo.SEC_NORMAL,
|
||||||
Ci.nsIContentPolicy.TYPE_OTHER);
|
Ci.nsIContentPolicy.TYPE_OTHER);
|
||||||
}
|
}
|
||||||
|
// The signature of `NetUtil.newChannel` changed in Firefox 38,
|
||||||
|
// see https://bugzilla.mozilla.org/show_bug.cgi?id=1125618.
|
||||||
|
var ffVersion = parseInt(Services.appinfo.platformVersion);
|
||||||
|
if (ffVersion < 38) {
|
||||||
|
return NetUtil.newChannel(uri);
|
||||||
|
}
|
||||||
|
//#endif
|
||||||
|
return NetUtil.newChannel({
|
||||||
|
uri: uri,
|
||||||
|
loadingNode: node,
|
||||||
|
loadingPrincipal: principal,
|
||||||
|
contentPolicyType: Ci.nsIContentPolicy.TYPE_OTHER,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function asyncFetchChannel(channel, callback) {
|
function asyncFetchChannel(channel, callback) {
|
||||||
//#if !MOZCENTRAL
|
//#if !MOZCENTRAL
|
||||||
if (!NetUtil.newChannel2) {
|
if (NetUtil.asyncFetch2) {
|
||||||
return NetUtil.asyncFetch(channel, callback);
|
return NetUtil.asyncFetch2(channel, callback);
|
||||||
}
|
}
|
||||||
//#endif
|
//#endif
|
||||||
return NetUtil.asyncFetch2(channel, callback);
|
return NetUtil.asyncFetch(channel, callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
// PDF data storage
|
// PDF data storage
|
||||||
|
Loading…
Reference in New Issue
Block a user