Bug 784759 - Delay database creation on startup. r=mfinkle
authorWesley Johnston <wjohnston>
Mon, 27 Jan 2014 15:53:00 -0800
changeset 165583 45d37d92612d4f5637e9ce7483808f0c631c6d58
parent 165582 58d9759ff3d1620d6e79496683fe76b2ad6923b0
child 165584 76b9e0793b76b677dfc1f69497f688b5ed3f0f23
push id26097
push userryanvm@gmail.com
push dateTue, 28 Jan 2014 21:18:27 +0000
treeherdermozilla-central@128c86a925d7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle
bugs784759
milestone29.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 784759 - Delay database creation on startup. r=mfinkle
mobile/android/chrome/content/browser.js
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -436,18 +436,17 @@ var BrowserApp = {
     // XXX maybe we don't do this if the launch was kicked off from external
     Services.io.offline = false;
 
     // Broadcast a UIReady message so add-ons know we are finished with startup
     let event = document.createEvent("Events");
     event.initEvent("UIReady", true, false);
     window.dispatchEvent(event);
 
-    if (this._startupStatus)
-      this.onAppUpdated();
+    Services.obs.addObserver(this, "browser-delayed-startup-finished", false);
 
     // Store the low-precision buffer pref
     this.gUseLowPrecision = Services.prefs.getBoolPref("layers.low-precision-buffer");
 
     // notify java that gecko has loaded
     sendMessageToJava({ type: "Gecko:Ready" });
 
 #ifdef MOZ_SAFE_BROWSING
@@ -1625,16 +1624,21 @@ var BrowserApp = {
         console.log("Locale:Changed: " + aData);
 
         // TODO: do we need to be more nuanced here -- e.g., checking for the
         // OS locale -- or should it always be false on Fennec?
         Services.prefs.setBoolPref("intl.locale.matchOS", false);
         Services.prefs.setCharPref("general.useragent.locale", aData);
         break;
 
+      case "browser-delayed-startup-finished":
+        if (this._startupStatus)
+          this.onAppUpdated();
+        break;
+
       default:
         dump('BrowserApp.observe: unexpected topic "' + aTopic + '"\n');
         break;
 
     }
   },
 
   get defaultBrowserWidth() {