| Index: content/public/android/java/src/org/chromium/content/browser/AndroidBrowserProcess.java
|
| diff --git a/content/public/android/java/src/org/chromium/content/browser/AndroidBrowserProcess.java b/content/public/android/java/src/org/chromium/content/browser/AndroidBrowserProcess.java
|
| index bf046f9751525369b574e7c7195b943c0ef551f4..9c8d47ce83055161e288474dfe7dc7e0390180b8 100644
|
| --- a/content/public/android/java/src/org/chromium/content/browser/AndroidBrowserProcess.java
|
| +++ b/content/public/android/java/src/org/chromium/content/browser/AndroidBrowserProcess.java
|
| @@ -45,10 +45,13 @@ public class AndroidBrowserProcess {
|
| * MAX_RENDERERS_SINGLE_PROCESS requests single-process mode where the renderer will run in the
|
| * application process in a separate thread. The maximum number of allowed renderers is capped
|
| * by MAX_RENDERERS_LIMIT.
|
| - *
|
| + * @param mustBeImmediate true if initialization must be completed without creating additional
|
| + * UI tasks
|
| + * @param observer startup observer provides callback when startup complete
|
| * @return Whether the process actually needed to be initialized (false if already running).
|
| */
|
| - public static boolean init(Context context, int maxRendererProcesses)
|
| + public static boolean init(Context context, int maxRendererProcesses, boolean mustBeImmediate,
|
| + StartupObserver observer)
|
| throws ProcessInitException {
|
| assert maxRendererProcesses >= 0;
|
| assert maxRendererProcesses <= MAX_RENDERERS_LIMIT;
|
| @@ -75,11 +78,27 @@ public class AndroidBrowserProcess {
|
| nativeSetCommandLineFlags(maxRendererProcesses,
|
| nativeIsPluginEnabled() ? getPlugins(context) : null);
|
| ContentMain.initApplicationContext(appContext);
|
| - int result = ContentMain.start();
|
| +
|
| + if(observer == null) {
|
| + // Create a default observer that does nothing
|
| + observer = new StartupObserver();
|
| + }
|
| +
|
| + int result = ContentMain.start(mustBeImmediate, observer);
|
| if (result > 0) throw new ProcessInitException(result);
|
| return true;
|
| }
|
|
|
| + /*
|
| + * Old version of init, kept short term to simplify change to new version
|
| + * TODO (aberent) : remove this once callers updated.
|
| + */
|
| + @Deprecated
|
| + public static boolean init(Context context, int maxRendererProcesses)
|
| + throws ProcessInitException {
|
| + return init(context, maxRendererProcesses, true, null);
|
| + }
|
| +
|
| /**
|
| * Initialization needed for tests. Mainly used by content browsertests.
|
| */
|
|
|