mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1243936 - Convert remaining callsites within devtools/ and toolkit/ to use channel.open2()
This commit is contained in:
parent
c71b5c6b4f
commit
12a3f8477f
@ -26,7 +26,7 @@ function getDefaultSettings() {
|
|||||||
let chan = NetUtil.newChannel({
|
let chan = NetUtil.newChannel({
|
||||||
uri: NetUtil.newURI(settingsFile),
|
uri: NetUtil.newURI(settingsFile),
|
||||||
loadUsingSystemPrincipal: true});
|
loadUsingSystemPrincipal: true});
|
||||||
let stream = chan.open();
|
let stream = chan.open2();
|
||||||
// Obtain a converter to read from a UTF-8 encoded input stream.
|
// Obtain a converter to read from a UTF-8 encoded input stream.
|
||||||
let converter = Cc["@mozilla.org/intl/scriptableunicodeconverter"]
|
let converter = Cc["@mozilla.org/intl/scriptableunicodeconverter"]
|
||||||
.createInstance(Ci.nsIScriptableUnicodeConverter);
|
.createInstance(Ci.nsIScriptableUnicodeConverter);
|
||||||
|
@ -273,7 +273,7 @@ var AboutProtocolParent = {
|
|||||||
} else {
|
} else {
|
||||||
channel.loadGroup = null;
|
channel.loadGroup = null;
|
||||||
}
|
}
|
||||||
let stream = channel.open();
|
let stream = channel.open2();
|
||||||
let data = NetUtil.readInputStreamToString(stream, stream.available(), {});
|
let data = NetUtil.readInputStreamToString(stream, stream.available(), {});
|
||||||
return {
|
return {
|
||||||
data: data,
|
data: data,
|
||||||
|
@ -53,18 +53,14 @@ function run_test() {
|
|||||||
engineTemplateFile.copyTo(engineFile.parent, "test-search-engine.xml");
|
engineTemplateFile.copyTo(engineFile.parent, "test-search-engine.xml");
|
||||||
|
|
||||||
// The list of visibleDefaultEngines needs to match or the cache will be ignored.
|
// The list of visibleDefaultEngines needs to match or the cache will be ignored.
|
||||||
let chan = NetUtil.ioService.newChannel2("resource://search-plugins/list.txt",
|
let chan = NetUtil.newChannel({
|
||||||
null, // aOriginCharset
|
uri: "resource://search-plugins/list.txt",
|
||||||
null, // aBaseURI
|
loadUsingSystemPrincipal: true
|
||||||
null, // aLoadingNode
|
});
|
||||||
Services.scriptSecurityManager.getSystemPrincipal(),
|
|
||||||
null, // aTriggeringPrincipal
|
|
||||||
Ci.nsILoadInfo.SEC_NORMAL,
|
|
||||||
Ci.nsIContentPolicy.TYPE_OTHER);
|
|
||||||
let visibleDefaultEngines = [];
|
let visibleDefaultEngines = [];
|
||||||
let sis = Cc["@mozilla.org/scriptableinputstream;1"].
|
let sis = Cc["@mozilla.org/scriptableinputstream;1"].
|
||||||
createInstance(Ci.nsIScriptableInputStream);
|
createInstance(Ci.nsIScriptableInputStream);
|
||||||
sis.init(chan.open());
|
sis.init(chan.open2());
|
||||||
let list = sis.read(sis.available());
|
let list = sis.read(sis.available());
|
||||||
let names = list.split("\n").filter(n => !!n);
|
let names = list.split("\n").filter(n => !!n);
|
||||||
for (let name of names) {
|
for (let name of names) {
|
||||||
|
@ -131,16 +131,13 @@ XPCOMUtils.defineLazyGetter(UpdateUtils, "Locale", function() {
|
|||||||
let channel;
|
let channel;
|
||||||
let locale;
|
let locale;
|
||||||
for (let res of ['app', 'gre']) {
|
for (let res of ['app', 'gre']) {
|
||||||
channel = Services.io.newChannel2("resource://" + res + "/" + FILE_UPDATE_LOCALE,
|
channel = NetUtil.newChannel({
|
||||||
null,
|
uri: "resource://" + res + "/" + FILE_UPDATE_LOCALE,
|
||||||
null,
|
contentPolicyType: Ci.nsIContentPolicy.TYPE_INTERNAL_XMLHTTPREQUEST,
|
||||||
null, // aLoadingNode
|
loadUsingSystemPrincipal: true
|
||||||
Services.scriptSecurityManager.getSystemPrincipal(),
|
});
|
||||||
null, // aTriggeringPrincipal
|
|
||||||
Ci.nsILoadInfo.SEC_NORMAL,
|
|
||||||
Ci.nsIContentPolicy.TYPE_INTERNAL_XMLHTTPREQUEST);
|
|
||||||
try {
|
try {
|
||||||
let inputStream = channel.open();
|
let inputStream = channel.open2();
|
||||||
locale = NetUtil.readInputStreamToString(inputStream, inputStream.available());
|
locale = NetUtil.readInputStreamToString(inputStream, inputStream.available());
|
||||||
} catch(e) {}
|
} catch(e) {}
|
||||||
if (locale)
|
if (locale)
|
||||||
|
Loading…
Reference in New Issue
Block a user