Bug 1170981 - Load the storage service before NSS. r=mak
authorKan-Ru Chen <kanru@kanru.info>
Tue, 09 Jun 2015 13:54:53 +0800
changeset 266686 61e83526454d42e7d200cfd06fea9521edff1d03
parent 266685 1983d421703a1637f64f8e7230173f2e0e94d6dd
child 266687 46ff7d8a323177ab814c0ba4977706b9118dceec
push id4932
push userjlund@mozilla.com
push dateMon, 10 Aug 2015 18:23:06 +0000
treeherdermozilla-esr52@6dd5a4f5f745 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmak
bugs1170981
milestone41.0a1
Bug 1170981 - Load the storage service before NSS. r=mak
toolkit/mozapps/extensions/internal/XPIProvider.jsm
--- a/toolkit/mozapps/extensions/internal/XPIProvider.jsm
+++ b/toolkit/mozapps/extensions/internal/XPIProvider.jsm
@@ -998,22 +998,23 @@ function loadManifestFromRDF(aUri, aStre
     addon.applyBackgroundUpdates = AddonManager.AUTOUPDATE_DISABLE;
     addon.updateURL = null;
     addon.updateKey = null;
 
     addon.targetApplications = [];
     addon.targetPlatforms = [];
   }
 
+  // Load the storage service before NSS (nsIRandomGenerator),
+  // to avoid a SQLite initialization error (bug 717904).
+  let storage = Services.storage;
+
   // Define .syncGUID as a lazy property which is also settable
   Object.defineProperty(addon, "syncGUID", {
     get: () => {
-      // Load the storage service before NSS (nsIRandomGenerator),
-      // to avoid a SQLite initialization error (bug 717904).
-      let storage = Services.storage;
 
       // Generate random GUID used for Sync.
       // This was lifted from util.js:makeGUID() from services-sync.
       let rng = Cc["@mozilla.org/security/random-generator;1"].
         createInstance(Ci.nsIRandomGenerator);
       let bytes = rng.generateRandomBytes(9);
       let byte_string = [String.fromCharCode(byte) for each (byte in bytes)]
                         .join("");