Bug 786061 - Disable session restore in webapps. r=mfinkle
authorWes Johnston <wjohnston@mozilla.com>
Thu, 08 Nov 2012 14:49:07 -0800
changeset 112758 8b505b120c897877fee9b83e0e1911e11a3fc151
parent 112757 200969fd33136654201e59be10b640723c3fbada
child 112759 e72ab5e449c4a4ea259e1bff8473abb2771530ad
push id23838
push usereakhgari@mozilla.com
push dateFri, 09 Nov 2012 15:21:51 +0000
treeherdermozilla-central@c39596b46863 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle
bugs786061
milestone19.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 786061 - Disable session restore in webapps. r=mfinkle
mobile/android/base/GeckoApp.java
mobile/android/base/WebApp.java.in
--- 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 && getProfile().shouldRestoreSession()) {
+        if (mRestoreMode == RESTORE_NONE && shouldRestoreSession()) {
             mRestoreMode = RESTORE_CRASH;
         }
 
         final boolean isExternalURL = passedUri != null && !passedUri.equals("about:home");
         StartupAction startupAction;
         if (isExternalURL) {
             startupAction = StartupAction.URL;
         } else {
@@ -1829,16 +1829,20 @@ 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,16 +185,21 @@ 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);