diff options
author | New Tobin Paradigm <email@mattatobin.com> | 2018-04-18 04:02:02 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-18 04:02:02 -0400 |
commit | 8dea5c84fc874e0179dcde46697e99d8b750ecd8 (patch) | |
tree | 0f705483420ecbe5c2b9e796dd4d65dd14121247 | |
parent | 29de8de78c3260aad1e7844933d5b3cf1033627c (diff) | |
parent | b702c9adcae7234c3806a9c1fd3414ff8ecef066 (diff) | |
download | UXP-8dea5c84fc874e0179dcde46697e99d8b750ecd8.tar UXP-8dea5c84fc874e0179dcde46697e99d8b750ecd8.tar.gz UXP-8dea5c84fc874e0179dcde46697e99d8b750ecd8.tar.lz UXP-8dea5c84fc874e0179dcde46697e99d8b750ecd8.tar.xz UXP-8dea5c84fc874e0179dcde46697e99d8b750ecd8.zip |
Merge pull request #198 from JustOff/PR_asyncOpen2
Use asyncOpen2 instead of asyncOpen everywhere in Pale Moon
-rw-r--r-- | application/palemoon/components/feeds/FeedConverter.js | 2 | ||||
-rw-r--r-- | application/palemoon/components/feeds/FeedWriter.js | 19 | ||||
-rw-r--r-- | toolkit/mozapps/extensions/internal/XPIProvider.jsm | 24 |
3 files changed, 19 insertions, 26 deletions
diff --git a/application/palemoon/components/feeds/FeedConverter.js b/application/palemoon/components/feeds/FeedConverter.js index 75115cc94..d0f573774 100644 --- a/application/palemoon/components/feeds/FeedConverter.js +++ b/application/palemoon/components/feeds/FeedConverter.js @@ -260,7 +260,7 @@ FeedConverter.prototype = { } chromeChannel.loadGroup = this._request.loadGroup; - chromeChannel.asyncOpen(this._listener, null); + chromeChannel.asyncOpen2(this._listener); } finally { this._releaseHandles(); diff --git a/application/palemoon/components/feeds/FeedWriter.js b/application/palemoon/components/feeds/FeedWriter.js index 28cf582c2..cbb146564 100644 --- a/application/palemoon/components/feeds/FeedWriter.js +++ b/application/palemoon/components/feeds/FeedWriter.js @@ -9,6 +9,7 @@ const Cr = Components.results; const Cu = Components.utils; Cu.import("resource://gre/modules/XPCOMUtils.jsm"); +Cu.import("resource://gre/modules/NetUtil.jsm"); const FEEDWRITER_CID = Components.ID("{49bb6593-3aff-4eb3-a068-2712c28bd58e}"); const FEEDWRITER_CONTRACTID = "@mozilla.org/browser/feeds/result-writer;1"; @@ -1137,16 +1138,14 @@ FeedWriter.prototype = { var nullPrincipal = Cc["@mozilla.org/nullprincipal;1"]. createInstance(Ci.nsIPrincipal); - var resolvedURI = Cc["@mozilla.org/network/io-service;1"]. - getService(Ci.nsIIOService). - newChannel2("about:feeds", - null, - null, - null, // aLoadingNode - nullPrincipal, - null, // aTriggeringPrincipal - Ci.nsILoadInfo.SEC_NORMAL, - Ci.nsIContentPolicy.TYPE_OTHER).URI; + // this channel is not going to be openend, use a nullPrincipal + // and the most restrctive securityFlag. + let resolvedURI = NetUtil.newChannel({ + uri: "about:feeds", + loadingPrincipal: nullPrincipal, + securityFlags: Ci.nsILoadInfo.SEC_REQUIRE_SAME_ORIGIN_DATA_IS_BLOCKED, + contentPolicyType: Ci.nsIContentPolicy.TYPE_OTHER + }).URI; if (resolvedURI.equals(chan.URI)) return chan.originalURI; diff --git a/toolkit/mozapps/extensions/internal/XPIProvider.jsm b/toolkit/mozapps/extensions/internal/XPIProvider.jsm index 2c5e3dfa7..72a460e4a 100644 --- a/toolkit/mozapps/extensions/internal/XPIProvider.jsm +++ b/toolkit/mozapps/extensions/internal/XPIProvider.jsm @@ -1931,12 +1931,10 @@ this.XPIProvider = { let chan; try { - chan = Services.io.newChannelFromURI2(aURI, - null, // aLoadingNode - Services.scriptSecurityManager.getSystemPrincipal(), - null, // aTriggeringPrincipal - Ci.nsILoadInfo.SEC_NORMAL, - Ci.nsIContentPolicy.TYPE_OTHER); + chan = NetUtil.newChannel({ + uri: aURI, + loadUsingSystemPrincipal: true + }); } catch (ex) { return null; @@ -5456,21 +5454,17 @@ AddonInstall.prototype = { let requireBuiltIn = Preferences.get(PREF_INSTALL_REQUIREBUILTINCERTS, true); this.badCertHandler = new BadCertHandler(!requireBuiltIn); - this.channel = NetUtil.newChannel2(this.sourceURI, - null, - null, - null, // aLoadingNode - Services.scriptSecurityManager.getSystemPrincipal(), - null, // aTriggeringPrincipal - Ci.nsILoadInfo.SEC_NORMAL, - Ci.nsIContentPolicy.TYPE_OTHER); + this.channel = NetUtil.newChannel({ + uri: this.sourceURI, + loadUsingSystemPrincipal: true + }); this.channel.notificationCallbacks = this; if (this.channel instanceof Ci.nsIHttpChannel) { this.channel.setRequestHeader("Moz-XPI-Update", "1", true); if (this.channel instanceof Ci.nsIHttpChannelInternal) this.channel.forceAllowThirdPartyCookie = true; } - this.channel.asyncOpen(listener, null); + this.channel.asyncOpen2(listener); Services.obs.addObserver(this, "network:offline-about-to-go-offline", false); } |