Bug 786061 - Disable session restore in webapps. r=mfinkle
☠☠ backed out by 7b61a5e983ba ☠ ☠
authorWes Johnston <wjohnston@mozilla.com>
Mon, 05 Nov 2012 17:14:22 -0800
changeset 112369 801d11096998395738377ce13beb394d4c102c78
parent 112368 57d9fa15f3e1891dad77036ea8fa3768deb4c4a2
child 112370 38a111dc16e21b822c7a678a4b2b55f433d82611
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)
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 == GeckoAppShell.RESTORE_NONE && shouldRestoreSession()) {
             mRestoreMode = RESTORE_CRASH;
         }
 
         final boolean isExternalURL = passedUri != null && !passedUri.equals("about:home");
         StartupAction startupAction;
         if (isExternalURL) {
             startupAction = StartupAction.URL;
         } else {
@@ -1824,16 +1824,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);