Bug 786061 - Disable session restore in webapps. r=mfinkle
authorWes Johnston <wjohnston@mozilla.com>
Mon, 05 Nov 2012 17:14:22 -0800
changeset 112382 5266d6af1b81810587e864a6a84c5c83a1c57375
parent 112381 13d927597146d0a099f8ceb5560d659780aa818c
child 112383 0b25e27d0a354ddcafbd6fd248f92337dfa1ba7e
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 == 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);