summaryrefslogtreecommitdiffstats
path: root/services/sync/tps/extensions/mozmill/resource/stdlib/securable-module.js
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-10-06 06:57:51 +0200
committerwolfbeast <mcwerewolf@gmail.com>2018-10-06 06:57:51 +0200
commit0c47c83e1b3b7d95681a43fbb0de0e17b2cd5b25 (patch)
treec321601f04cbfd02fb6e12878e745dc49a612c86 /services/sync/tps/extensions/mozmill/resource/stdlib/securable-module.js
parent8860eddcee1417483cafd114f3a9ec127e0f1f74 (diff)
downloadUXP-0c47c83e1b3b7d95681a43fbb0de0e17b2cd5b25.tar
UXP-0c47c83e1b3b7d95681a43fbb0de0e17b2cd5b25.tar.gz
UXP-0c47c83e1b3b7d95681a43fbb0de0e17b2cd5b25.tar.lz
UXP-0c47c83e1b3b7d95681a43fbb0de0e17b2cd5b25.tar.xz
UXP-0c47c83e1b3b7d95681a43fbb0de0e17b2cd5b25.zip
Import Tycho weave client
Diffstat (limited to 'services/sync/tps/extensions/mozmill/resource/stdlib/securable-module.js')
-rw-r--r--services/sync/tps/extensions/mozmill/resource/stdlib/securable-module.js24
1 files changed, 7 insertions, 17 deletions
diff --git a/services/sync/tps/extensions/mozmill/resource/stdlib/securable-module.js b/services/sync/tps/extensions/mozmill/resource/stdlib/securable-module.js
index 2648afd27..794c3e2c2 100644
--- a/services/sync/tps/extensions/mozmill/resource/stdlib/securable-module.js
+++ b/services/sync/tps/extensions/mozmill/resource/stdlib/securable-module.js
@@ -40,8 +40,6 @@
const Cu = Components.utils;
const Cr = Components.results;
- Cu.import("resource://gre/modules/NetUtil.jsm");
-
var exports = {};
var ios = Cc['@mozilla.org/network/io-service;1']
@@ -170,7 +168,8 @@
if (rootPaths) {
if (rootPaths.constructor.name != "Array")
rootPaths = [rootPaths];
- var fses = rootPaths.map(path => new exports.LocalFileSystem(path));
+ var fses = [new exports.LocalFileSystem(path)
+ for each (path in rootPaths)];
options.fs = new exports.CompositeFileSystem(fses);
} else
options.fs = new exports.LocalFileSystem();
@@ -315,26 +314,17 @@
else
baseURI = ios.newURI(base, null, null);
var newURI = ios.newURI(path, null, baseURI);
- var channel = NetUtil.newChannel({
- uri: newURI,
- loadUsingSystemPrincipal: true
- });
+ var channel = ios.newChannelFromURI(newURI);
try {
- channel.open2().close();
- } catch (e) {
- if (e.result != Cr.NS_ERROR_FILE_NOT_FOUND) {
- throw e;
- }
+ channel.open().close();
+ } catch (e if e.result == Cr.NS_ERROR_FILE_NOT_FOUND) {
return null;
}
return newURI.spec;
},
getFile: function getFile(path) {
- var channel = NetUtil.newChannel({
- uri: path,
- loadUsingSystemPrincipal: true
- });
- var iStream = channel.open2();
+ var channel = ios.newChannel(path, null, null);
+ var iStream = channel.open();
var ciStream = Cc["@mozilla.org/intl/converter-input-stream;1"].
createInstance(Ci.nsIConverterInputStream);
var bufLen = 0x8000;