Chromium Code Reviews| 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 4b4420a57bd8ee63cbc33f2f8e60001fe2d9015a..7748ecb0beb9099a50b6f5dff64c92bdf96d46bb 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 |
| @@ -94,20 +94,6 @@ public class BrowserStartupController { |
| // Whether the async startup of the browser process is complete. |
| private boolean mStartupDone; |
| - // Use single-process mode that runs the renderer on a separate thread in |
| - // the main application. |
| - public static final int MAX_RENDERERS_SINGLE_PROCESS = 0; |
| - |
| - // Cap on the maximum number of renderer processes that can be requested. |
| - // This is currently set to account for: |
| - // 13: The maximum number of sandboxed processes we have available |
| - // - 1: The regular New Tab Page |
| - // - 1: The incognito New Tab Page |
| - // - 1: A regular incognito tab |
| - // - 1: Safety buffer (http://crbug.com/251279) |
| - public static final int MAX_RENDERERS_LIMIT = |
| - ChildProcessLauncher.MAX_REGISTERED_SANDBOXED_SERVICES - 4; |
| - |
| // This field is set after startup has been completed based on whether the startup was a success |
| // or not. It is used when later requests to startup come in that happen after the initial set |
| // of enqueued callbacks have been executed. |
| @@ -161,7 +147,7 @@ public class BrowserStartupController { |
| // flag that indicates that we have kicked off starting the browser process. |
| mHasStartedInitializingBrowserProcess = true; |
| - prepareToStartBrowserProcess(MAX_RENDERERS_LIMIT); |
| + prepareToStartBrowserProcess(false); |
| setAsynchronousStartup(true); |
| if (contentStart() > 0) { |
| @@ -178,15 +164,14 @@ public class BrowserStartupController { |
| * <p/> |
| * Note that this can only be called on the UI thread. |
| * |
| - * @param maxRenderers The maximum number of renderer processes the browser may |
| - * create. Zero for single process mode. |
| + * @param inProcess true iff we want the renderers to be run in-process |
| * @throws ProcessInitException |
| */ |
| - public void startBrowserProcessesSync(int maxRenderers) throws ProcessInitException { |
| + public void startBrowserProcessesSync(boolean inProcess) throws ProcessInitException { |
| // If already started skip to checking the result |
| if (!mStartupDone) { |
| if (!mHasStartedInitializingBrowserProcess) { |
| - prepareToStartBrowserProcess(maxRenderers); |
| + prepareToStartBrowserProcess(inProcess); |
| } |
| setAsynchronousStartup(false); |
| @@ -260,8 +245,8 @@ public class BrowserStartupController { |
| } |
| @VisibleForTesting |
| - void prepareToStartBrowserProcess(int maxRendererProcesses) throws ProcessInitException { |
| - Log.i(TAG, "Initializing chromium process, renderers=" + maxRendererProcesses); |
| + void prepareToStartBrowserProcess(boolean inProcess) throws ProcessInitException { |
| + Log.i(TAG, "Initializing chromium process."); |
|
klobag.chromium
2014/06/27 16:25:42
log inProcess.
ppi
2014/07/16 13:26:54
Done.
|
| // Normally Main.java will have kicked this off asynchronously for Chrome. But other |
| // ContentView apps like tests also need them so we make sure we've extracted resources |
| @@ -280,8 +265,7 @@ public class BrowserStartupController { |
| // Now we really need to have the resources ready. |
| resourceExtractor.waitForCompletion(); |
| - nativeSetCommandLineFlags(maxRendererProcesses, |
| - nativeIsPluginEnabled() ? getPlugins() : null); |
| + nativeSetCommandLineFlags(inProcess, nativeIsPluginEnabled() ? getPlugins() : null); |
| ContentMain.initApplicationContext(appContext); |
| } |
| @@ -292,18 +276,15 @@ public class BrowserStartupController { |
| ResourceExtractor resourceExtractor = ResourceExtractor.get(mContext); |
| resourceExtractor.startExtractingResources(); |
| resourceExtractor.waitForCompletion(); |
| - |
| - // Having a single renderer should be sufficient for tests. We can't have more than |
| - // MAX_RENDERERS_LIMIT. |
| - nativeSetCommandLineFlags(1 /* maxRenderers */, null); |
| + nativeSetCommandLineFlags(false, null); |
| } |
| private String getPlugins() { |
| return PepperPluginManager.getPlugins(mContext); |
| } |
| - private static native void nativeSetCommandLineFlags(int maxRenderProcesses, |
| - String pluginDescriptor); |
| + private static native void nativeSetCommandLineFlags( |
| + boolean inProcess, String pluginDescriptor); |
| // Is this an official build of Chrome? Only native code knows for sure. Official build |
| // knowledge is needed very early in process startup. |