Bug 1075644 - Move more things to after Gecko start; r=mfinkle
☠☠ backed out by c8a9a49c5c10 ☠ ☠
authorJim Chen <nchen@mozilla.com>
Fri, 17 Oct 2014 12:46:35 -0400
changeset 210894 ca0dfff936c2e330fde5857edb9d144acd842755
parent 210893 47264e561dce89866d70eabe8423381730ede251
child 210895 c44f001ea6c196717b09dcdf7ec9e1279fe04209
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersmfinkle
bugs1075644
milestone36.0a1
Bug 1075644 - Move more things to after Gecko start; r=mfinkle
mobile/android/base/GeckoApp.java
--- a/mobile/android/base/GeckoApp.java
+++ b/mobile/android/base/GeckoApp.java
@@ -1185,34 +1185,25 @@ public abstract class GeckoApp
             }
         });
 
         // Workaround for <http://code.google.com/p/android/issues/detail?id=20915>.
         try {
             Class.forName("android.os.AsyncTask");
         } catch (ClassNotFoundException e) {}
 
-        MemoryMonitor.getInstance().init(getApplicationContext());
-
         // GeckoAppShell is tightly coupled to us, rather than
         // the app context, because various parts of Fennec (e.g.,
         // GeckoScreenOrientation) use GAS to access the Activity in
         // the guise of fetching a Context.
         // When that's fixed, `this` can change to
         // `(GeckoApplication) getApplication()` here.
         GeckoAppShell.setContextGetter(this);
         GeckoAppShell.setGeckoInterface(this);
 
-        Tabs.getInstance().attachToContext(this);
-        try {
-            Favicons.initializeWithContext(this);
-        } catch (Exception e) {
-            Log.e(LOGTAG, "Exception starting favicon cache. Corrupt resources?", e);
-        }
-
         // Did the OS locale change while we were backgrounded? If so,
         // we need to die so that Gecko will re-init add-ons that touch
         // the UI.
         // This is using a sledgehammer to crack a nut, but it'll do for
         // now.
         // Our OS locale pref will be detected as invalid after the
         // restart, and will be propagated to Gecko accordingly, so there's
         // no need to touch that here.
@@ -1254,16 +1245,25 @@ public abstract class GeckoApp
             }, 1000 * 5 /* 5 seconds */);
         }
 
         // Heavy load on the Gecko thread can slow down the time it takes for UI to appear on
         // single-core devices. By minimizing the Gecko thread priority, we ensure that the UI
         // appears quickly. The priority is reset to normal once thumbnails are loaded.
         ThreadUtils.reduceGeckoPriority();
 
+        MemoryMonitor.getInstance().init(getApplicationContext());
+
+        Tabs.getInstance().attachToContext(this);
+        try {
+            Favicons.initializeWithContext(this);
+        } catch (Exception e) {
+            Log.e(LOGTAG, "Exception starting favicon cache. Corrupt resources?", e);
+        }
+
         Bundle stateBundle = getIntent().getBundleExtra(EXTRA_STATE_BUNDLE);
         if (stateBundle != null) {
             // Use the state bundle if it was given as an intent extra. This is
             // only intended to be used internally via Robocop, so a boolean
             // is read from a private shared pref to prevent other apps from
             // injecting states.
             final SharedPreferences prefs = getSharedPreferences();
             if (prefs.getBoolean(PREFS_ALLOW_STATE_BUNDLE, false)) {