summaryrefslogtreecommitdiffstats
path: root/netwerk/protocol/http/UserAgentUpdates.jsm
diff options
context:
space:
mode:
Diffstat (limited to 'netwerk/protocol/http/UserAgentUpdates.jsm')
-rw-r--r--netwerk/protocol/http/UserAgentUpdates.jsm41
1 files changed, 3 insertions, 38 deletions
diff --git a/netwerk/protocol/http/UserAgentUpdates.jsm b/netwerk/protocol/http/UserAgentUpdates.jsm
index 602705ebe..cd21b78b3 100644
--- a/netwerk/protocol/http/UserAgentUpdates.jsm
+++ b/netwerk/protocol/http/UserAgentUpdates.jsm
@@ -10,7 +10,6 @@ const Ci = Components.interfaces;
const Cc = Components.classes;
const Cu = Components.utils;
-Cu.import("resource://gre/modules/AppConstants.jsm");
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
@@ -18,15 +17,9 @@ XPCOMUtils.defineLazyModuleGetter(
this, "FileUtils", "resource://gre/modules/FileUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(
- this, "NetUtil", "resource://gre/modules/NetUtil.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(
this, "OS", "resource://gre/modules/osfile.jsm");
XPCOMUtils.defineLazyModuleGetter(
- this, "Promise", "resource://gre/modules/Promise.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(
this, "UpdateUtils", "resource://gre/modules/UpdateUtils.jsm");
XPCOMUtils.defineLazyServiceGetter(
@@ -65,30 +58,6 @@ const PREF_APP_DISTRIBUTION_VERSION = "distribution.version";
var gInitialized = false;
-function readChannel(url) {
- return new Promise((resolve, reject) => {
- try {
- let channel = NetUtil.newChannel({uri: url, loadUsingSystemPrincipal: true});
- channel.contentType = "application/json";
-
- NetUtil.asyncFetch(channel, (inputStream, status) => {
- if (!Components.isSuccessCode(status)) {
- reject();
- return;
- }
-
- let data = JSON.parse(
- NetUtil.readInputStreamToString(inputStream, inputStream.available())
- );
- resolve(data);
- });
- } catch (ex) {
- reject(new Error("UserAgentUpdates: Could not fetch " + url + " " +
- ex + "\n" + ex.stack));
- }
- });
-}
-
this.UserAgentUpdates = {
init: function(callback) {
if (gInitialized) {
@@ -144,13 +113,9 @@ this.UserAgentUpdates = {
// try to load next one if the previous load failed
return prevLoad ? prevLoad.then(null, tryNext) : tryNext();
}, null).then(null, (ex) => {
- if (AppConstants.platform !== "android") {
- // All previous (non-Android) load attempts have failed, so we bail.
- throw new Error("UserAgentUpdates: Failed to load " + FILE_UPDATES +
- ex + "\n" + ex.stack);
- }
- // Make one last attempt to read from the Fennec APK root.
- return readChannel("resource://android/" + FILE_UPDATES);
+ // All previous load attempts have failed, so we bail.
+ throw new Error("UserAgentUpdates: Failed to load " + FILE_UPDATES +
+ ex + "\n" + ex.stack);
}).then((update) => {
// Apply update if loading was successful
this._applyUpdate(update);