diff options
author | Matt A. Tobin <email@mattatobin.com> | 2018-02-11 07:03:16 -0500 |
---|---|---|
committer | Matt A. Tobin <email@mattatobin.com> | 2018-02-11 07:03:16 -0500 |
commit | 203eb0f61a09372310a2a8fb57e169cb3f47800b (patch) | |
tree | 8490329d3dae4de3c7ffd127bce1f65fdc009abd /netwerk/base/NetUtil.jsm | |
parent | e45706ca3acbb6530419433212becc61d5953a2d (diff) | |
parent | 8f6d3dab81c7f8f97ef197e26ab9439b09735b8f (diff) | |
download | UXP-203eb0f61a09372310a2a8fb57e169cb3f47800b.tar UXP-203eb0f61a09372310a2a8fb57e169cb3f47800b.tar.gz UXP-203eb0f61a09372310a2a8fb57e169cb3f47800b.tar.lz UXP-203eb0f61a09372310a2a8fb57e169cb3f47800b.tar.xz UXP-203eb0f61a09372310a2a8fb57e169cb3f47800b.zip |
Merge branch 'ext-work'FF_Checkpoint_1
Diffstat (limited to 'netwerk/base/NetUtil.jsm')
-rw-r--r-- | netwerk/base/NetUtil.jsm | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/netwerk/base/NetUtil.jsm b/netwerk/base/NetUtil.jsm index e970c8ad8..93025e97e 100644 --- a/netwerk/base/NetUtil.jsm +++ b/netwerk/base/NetUtil.jsm @@ -363,6 +363,41 @@ this.NetUtil = { }, /** + * @deprecated Use newChannel({ ...options... }) instead. + */ + newChannel2: function NetUtil_newChannel2(aWhatToLoad, + aOriginCharset, + aBaseURI, + aLoadingNode, + aLoadingPrincipal, + aTriggeringPrincipal, + aSecurityFlags, + aContentPolicyType) + { + if (!aWhatToLoad) { + let exception = new Components.Exception( + "Must have a non-null string spec, nsIURI, or nsIFile object", + Cr.NS_ERROR_INVALID_ARG, + Components.stack.caller + ); + throw exception; + } + + let uri = aWhatToLoad; + if (!(aWhatToLoad instanceof Ci.nsIURI)) { + // We either have a string or an nsIFile that we'll need a URI for. + uri = this.newURI(aWhatToLoad, aOriginCharset, aBaseURI); + } + + return this.ioService.newChannelFromURI2(uri, + aLoadingNode, + aLoadingPrincipal, + aTriggeringPrincipal, + aSecurityFlags, + aContentPolicyType); + }, + + /** * Reads aCount bytes from aInputStream into a string. * * @param aInputStream |