| Index: chrome/android/java/src/org/chromium/chrome/browser/init/ChromeBrowserInitializer.java
|
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/init/ChromeBrowserInitializer.java b/chrome/android/java/src/org/chromium/chrome/browser/init/ChromeBrowserInitializer.java
|
| index 1f017c85e28963da9f81400530f170396b250610..a8079d0b26b97511605ed5e45e17859aa506b59e 100644
|
| --- a/chrome/android/java/src/org/chromium/chrome/browser/init/ChromeBrowserInitializer.java
|
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/init/ChromeBrowserInitializer.java
|
| @@ -24,6 +24,7 @@ import org.chromium.chrome.browser.ChromeSwitches;
|
| import org.chromium.chrome.browser.ChromeVersionInfo;
|
| import org.chromium.chrome.browser.FileProviderHelper;
|
| import org.chromium.chrome.browser.device.DeviceClassManager;
|
| +import org.chromium.chrome.browser.tabmodel.document.DocumentTabModelImpl;
|
| import org.chromium.content.app.ContentApplication;
|
| import org.chromium.content.browser.BrowserStartupController;
|
| import org.chromium.content.browser.DeviceUtils;
|
| @@ -104,6 +105,15 @@ public class ChromeBrowserInitializer {
|
| }
|
|
|
|
|
| + /**
|
| + * Pre-load shared prefs to avoid being blocked on the
|
| + * disk access async task in the future.
|
| + */
|
| + private void warmUpSharedPrefs() {
|
| + PreferenceManager.getDefaultSharedPreferences(mApplication);
|
| + DocumentTabModelImpl.warmUpSharedPrefs(mApplication);
|
| + }
|
| +
|
| private void preInflationStartup() {
|
| ThreadUtils.assertOnUiThread();
|
| if (mPreInflationStartupComplete) return;
|
| @@ -115,8 +125,7 @@ public class ChromeBrowserInitializer {
|
| waitForDebuggerIfNeeded();
|
| configureStrictMode();
|
|
|
| - // Warm up the shared prefs stored.
|
| - PreferenceManager.getDefaultSharedPreferences(mApplication);
|
| + warmUpSharedPrefs();
|
|
|
| DeviceUtils.addDeviceSpecificUserAgentSwitch(mApplication);
|
|
|
|
|