mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-08 08:48:39 +09:00
Add newChannel2 back to NetUtil.jsm
This commit is contained in:
parent
16ace66629
commit
ae5f56d05b
1 changed files with 35 additions and 0 deletions
|
|
@ -362,6 +362,41 @@ this.NetUtil = {
|
|||
contentPolicyType);
|
||||
},
|
||||
|
||||
/**
|
||||
* @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.
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue