Chromium Code Reviews| Index: chrome/android/java/src/org/chromium/chrome/browser/ChromeApplication.java |
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeApplication.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeApplication.java |
| index 1715d7edf372be9a7ec31bf1a59fd1d459ab6d4f..6fcf36d559f866c8033f7ed5d12700843e074e19 100644 |
| --- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeApplication.java |
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeApplication.java |
| @@ -264,6 +264,7 @@ public class ChromeApplication extends ContentApplication { |
| assert mIsProcessInitialized; |
| + UmaUtils.recordForegroundStartTime(); |
|
Yusuf
2016/07/12 18:00:19
I would say this is a bit misleading. The previous
Peter Wen
2016/07/12 19:02:13
This is currently used only by deferred startup an
|
| onForegroundSessionStart(); |
| cacheNativeFlags(); |
| } |
| @@ -447,38 +448,62 @@ public class ChromeApplication extends ContentApplication { |
| if (mInitializedSharedClasses) return; |
| mInitializedSharedClasses = true; |
| - ForcedSigninProcessor.start(this); |
| - AccountsChangedReceiver.addObserver(new AccountsChangedReceiver.AccountsChangedObserver() { |
| + DeferredStartupHandler.getInstance().addDeferredTask(new Runnable() { |
| @Override |
| - public void onAccountsChanged(Context context, Intent intent) { |
| - ThreadUtils.runOnUiThread(new Runnable() { |
| - @Override |
| - public void run() { |
| - ForcedSigninProcessor.start(ChromeApplication.this); |
| - } |
| - }); |
| + public void run() { |
| + ForcedSigninProcessor.start(getApplicationContext()); |
| + AccountsChangedReceiver.addObserver( |
| + new AccountsChangedReceiver.AccountsChangedObserver() { |
| + @Override |
| + public void onAccountsChanged(Context context, Intent intent) { |
| + ThreadUtils.runOnUiThread(new Runnable() { |
| + @Override |
| + public void run() { |
| + ForcedSigninProcessor.start(getApplicationContext()); |
| + } |
| + }); |
| + } |
| + }); |
| } |
| }); |
| - GoogleServicesManager.get(this).onMainActivityStart(); |
| - RevenueStats.getInstance(); |
| - mDevToolsServer = new DevToolsServer(DEV_TOOLS_SERVER_SOCKET_PREFIX); |
| - mDevToolsServer.setRemoteDebuggingEnabled( |
| - true, DevToolsServer.Security.ALLOW_DEBUG_PERMISSION); |
| + DeferredStartupHandler.getInstance().addDeferredTask(new Runnable() { |
| + @Override |
| + public void run() { |
| + GoogleServicesManager.get(getApplicationContext()) |
|
Yusuf
2016/07/12 18:00:19
this can fit in one line?
Peter Wen
2016/07/12 19:02:13
Done.
|
| + .onMainActivityStart(); |
| + RevenueStats.getInstance(); |
| + } |
| + }); |
| - startApplicationActivityTracker(); |
| + DeferredStartupHandler.getInstance().addDeferredTask(new Runnable() { |
| + @Override |
| + public void run() { |
| + mDevToolsServer = new DevToolsServer(DEV_TOOLS_SERVER_SOCKET_PREFIX); |
| + mDevToolsServer.setRemoteDebuggingEnabled( |
| + true, DevToolsServer.Security.ALLOW_DEBUG_PERMISSION); |
| - // Add process check to diagnose http://crbug.com/606309. Remove this after the bug is |
| - // fixed. |
| - assert !CommandLine.getInstance().hasSwitch(ContentSwitches.SWITCH_PROCESS_TYPE); |
| - if (!CommandLine.getInstance().hasSwitch(ContentSwitches.SWITCH_PROCESS_TYPE)) { |
| - DownloadController.setDownloadNotificationService( |
| - DownloadManagerService.getDownloadManagerService(this)); |
| - } |
| + startApplicationActivityTracker(); |
| + } |
| + }); |
| - if (ApiCompatibilityUtils.isPrintingSupported()) { |
| - mPrintingController = PrintingControllerFactory.create(getApplicationContext()); |
| - } |
| + DeferredStartupHandler.getInstance().addDeferredTask(new Runnable() { |
| + @Override |
| + public void run() { |
| + // Add process check to diagnose http://crbug.com/606309. Remove this after the bug |
| + // is fixed. |
| + assert !CommandLine.getInstance().hasSwitch(ContentSwitches.SWITCH_PROCESS_TYPE); |
| + if (!CommandLine.getInstance().hasSwitch(ContentSwitches.SWITCH_PROCESS_TYPE)) { |
| + DownloadController.setDownloadNotificationService( |
| + DownloadManagerService.getDownloadManagerService( |
| + getApplicationContext())); |
| + } |
| + |
| + if (ApiCompatibilityUtils.isPrintingSupported()) { |
| + mPrintingController = PrintingControllerFactory.create(getApplicationContext()); |
| + } |
| + } |
| + }); |
| } |
| /** |