Back out 0b25e27d0a35 (bug 784759) and 5266d6af1b81 (bug 786061) for bustage
authorPhil Ringnalda <philringnalda@gmail.com>
Mon, 05 Nov 2012 21:16:45 -0800
changeset 112385 64a0ab78b261ab09381b8293b21a4f843ad2f398
parent 112384 0d4e09ade3368bfa95e66c514bfe31271daafecb
child 112386 d9110621e468a1e3263038898dd4e3e33d11dd23
push id23812
push useremorley@mozilla.com
push dateTue, 06 Nov 2012 14:01:34 +0000
treeherdermozilla-central@f4aeed115e54 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs784759, 786061
milestone19.0a1
backs out0b25e27d0a354ddcafbd6fd248f92337dfa1ba7e
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
Back out 0b25e27d0a35 (bug 784759) and 5266d6af1b81 (bug 786061) for bustage
mobile/android/base/GeckoApp.java
mobile/android/base/WebApp.java.in
mobile/android/chrome/content/browser.js
--- a/mobile/android/base/GeckoApp.java
+++ b/mobile/android/base/GeckoApp.java
@@ -1586,17 +1586,17 @@ abstract public class GeckoApp
         BrowserDB.initialize(getProfile().getName());
 
         String passedUri = null;
         String uri = getURIFromIntent(intent);
         if (uri != null && uri.length() > 0) {
             passedUri = uri;
         }
 
-        if (mRestoreMode == RESTORE_NONE && shouldRestoreSession()) {
+        if (mRestoreMode == RESTORE_NONE && getProfile().shouldRestoreSession()) {
             mRestoreMode = RESTORE_CRASH;
         }
 
         final boolean isExternalURL = passedUri != null && !passedUri.equals("about:home");
         StartupAction startupAction;
         if (isExternalURL) {
             startupAction = StartupAction.URL;
         } else {
@@ -1824,20 +1824,16 @@ abstract public class GeckoApp
     public GeckoProfile getProfile() {
         // fall back to default profile if we didn't load a specific one
         if (mProfile == null) {
             mProfile = GeckoProfile.get(this);
         }
         return mProfile;
     }
 
-    protected boolean shouldRestoreSession() {
-        return getProfile().shouldRestoreSession();
-    }
-
     /**
      * Enable Android StrictMode checks (for supported OS versions).
      * http://developer.android.com/reference/android/os/StrictMode.html
      */
     private void enableStrictMode()
     {
         if (Build.VERSION.SDK_INT < Build.VERSION_CODES.GINGERBREAD) {
             return;
--- a/mobile/android/base/WebApp.java.in
+++ b/mobile/android/base/WebApp.java.in
@@ -185,21 +185,16 @@ public class WebApp extends GeckoApp {
 #ifdef MOZ_LINKER_EXTRACT
     @Override
     public boolean linkerExtract() {
         return true;
     }
 #endif
 
     @Override
-    protected boolean shouldRestoreSession() {
-      return false;
-    }
-
-    @Override
     public void onTabChanged(Tab tab, Tabs.TabEvents msg, Object data) {
         switch(msg) {
             case SELECTED:
             case LOCATION_CHANGE:
                 if (Tabs.getInstance().isSelectedTab(tab)) {
                     try {
                         String title = tab.getURL();
                         URL page = new URL(title);
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -278,28 +278,18 @@ var BrowserApp = {
     event.initEvent("UIReady", true, false);
     window.dispatchEvent(event);
 
     let ss = Cc["@mozilla.org/browser/sessionstore;1"].getService(Ci.nsISessionStore);
     if (ss.shouldRestore()) {
       this.restoreSession(false, null);
     }
 
-    if (updated) {
-        // creating the form history and passwords databases can be expensive
-        // delay it until after the first page has loaded
-        let browser = BrowserApp.selectedTab.browser;
-        let updatedFun = function updatedFun() {
-            browser.removeEventListener("DOMContentLoaded", updatedFun, false);
-            // initialize the form history and passwords databases on upgrades
-            Services.obs.notifyObservers(null, "FormHistory:Init", "");
-            Services.obs.notifyObservers(null, "Passwords:Init", "");
-        }
-        browser.addEventListener("DOMContentLoaded", updatedFun, false);
-    }
+    if (updated)
+      this.onAppUpdated();
 
     // notify java that gecko has loaded
     sendMessageToJava({
       gecko: {
         type: "Gecko:Ready"
       }
     });
 
@@ -492,16 +482,22 @@ var BrowserApp = {
            contentDisposition = "";
            type = "";
         }
         ContentAreaUtils.internalSave(aTarget.currentURI.spec, null, null, contentDisposition, type, false, "SaveImageTitle", null,
                                       aTarget.ownerDocument.documentURIObject, aTarget.ownerDocument, true, null);
       });
   },
 
+  onAppUpdated: function() {
+    // initialize the form history and passwords databases on upgrades
+    Services.obs.notifyObservers(null, "FormHistory:Init", "");
+    Services.obs.notifyObservers(null, "Passwords:Init", "");
+  },
+
   shutdown: function shutdown() {
     NativeWindow.uninit();
     SelectionHandler.uninit();
     LightWeightThemeWebInstaller.uninit();
     FormAssistant.uninit();
     FindHelper.uninit();
     OfflineApps.uninit();
     IndexedDB.uninit();