| Index: content/public/android/java/src/org/chromium/content/browser/BrowserStartupController.java
|
| diff --git a/content/public/android/java/src/org/chromium/content/browser/BrowserStartupController.java b/content/public/android/java/src/org/chromium/content/browser/BrowserStartupController.java
|
| index d53701dfa427faf6c748fbfb49a3d8788b1d4b85..4f2ec26d024690ef53362752c54f83a76aa6564a 100644
|
| --- a/content/public/android/java/src/org/chromium/content/browser/BrowserStartupController.java
|
| +++ b/content/public/android/java/src/org/chromium/content/browser/BrowserStartupController.java
|
| @@ -61,11 +61,16 @@ public class BrowserStartupController {
|
| private static BrowserStartupController sInstance;
|
|
|
| private static boolean sBrowserMayStartAsynchronously = false;
|
| + private static boolean sShouldStartGpuProcessOnBrowserStartup = true;
|
|
|
| private static void setAsynchronousStartup(boolean enable) {
|
| sBrowserMayStartAsynchronously = enable;
|
| }
|
|
|
| + private static void setShouldStartGpuProcessOnBrowserStartup(boolean enable) {
|
| + sShouldStartGpuProcessOnBrowserStartup = enable;
|
| + }
|
| +
|
| @VisibleForTesting
|
| @CalledByNative
|
| static boolean browserMayStartAsynchonously() {
|
| @@ -80,6 +85,11 @@ public class BrowserStartupController {
|
| }
|
| }
|
|
|
| + @CalledByNative
|
| + static boolean shouldStartGpuProcessOnBrowserStartup() {
|
| + return sShouldStartGpuProcessOnBrowserStartup;
|
| + }
|
| +
|
| // A list of callbacks that should be called when the async startup of the browser process is
|
| // complete.
|
| private final List<StartupCallback> mAsyncStartupCallbacks;
|
| @@ -146,9 +156,10 @@ public class BrowserStartupController {
|
| * <p/>
|
| * Note that this can only be called on the UI thread.
|
| *
|
| + * @param startGpuProcess Whether to start the GPU process if it is not started.
|
| * @param callback the callback to be called when browser startup is complete.
|
| */
|
| - public void startBrowserProcessesAsync(final StartupCallback callback)
|
| + public void startBrowserProcessesAsync(boolean startGpuProcess, final StartupCallback callback)
|
| throws ProcessInitException {
|
| assert ThreadUtils.runningOnUiThread() : "Tried to start the browser on the wrong thread.";
|
| if (mStartupDone) {
|
| @@ -167,6 +178,7 @@ public class BrowserStartupController {
|
| mHasStartedInitializingBrowserProcess = true;
|
|
|
| setAsynchronousStartup(true);
|
| + setShouldStartGpuProcessOnBrowserStartup(startGpuProcess);
|
| prepareToStartBrowserProcess(false, new Runnable() {
|
| @Override
|
| public void run() {
|
| @@ -290,7 +302,6 @@ public class BrowserStartupController {
|
| if (!mPostResourceExtractionTasksCompleted) {
|
| // TODO(yfriedman): Remove dependency on a command line flag for this.
|
| DeviceUtils.addDeviceSpecificUserAgentSwitch(mContext);
|
| -
|
| nativeSetCommandLineFlags(
|
| singleProcess, nativeIsPluginEnabled() ? getPlugins() : null);
|
| mPostResourceExtractionTasksCompleted = true;
|
|
|