| 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 4bc3154c7ec6ae183561ac8188e4d523e4bb7d94..6881675050ccb821399e453a44b654aa2b2fdd15 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
|
| @@ -105,8 +105,13 @@ public class BrowserStartupController {
|
|
|
| private int mLibraryProcessType;
|
|
|
| - BrowserStartupController(Context context, int libraryProcessType) {
|
| - mContext = context.getApplicationContext();
|
| + BrowserStartupController(
|
| + Context context, int libraryProcessType, boolean useApplicationContext) {
|
| + if (useApplicationContext) {
|
| + mContext = context.getApplicationContext();
|
| + } else {
|
| + mContext = context;
|
| + }
|
| mAsyncStartupCallbacks = new ArrayList<StartupCallback>();
|
| mLibraryProcessType = libraryProcessType;
|
| }
|
| @@ -120,13 +125,15 @@ public class BrowserStartupController {
|
| * LibraryProcessType.PROCESS_WEBVIEW.
|
| * @return BrowserStartupController instance.
|
| */
|
| - public static BrowserStartupController get(Context context, int libraryProcessType) {
|
| + public static BrowserStartupController get(
|
| + Context context, int libraryProcessType, boolean useApplicationContext) {
|
| assert ThreadUtils.runningOnUiThread() : "Tried to start the browser on the wrong thread.";
|
| ThreadUtils.assertOnUiThread();
|
| if (sInstance == null) {
|
| assert LibraryProcessType.PROCESS_BROWSER == libraryProcessType
|
| || LibraryProcessType.PROCESS_WEBVIEW == libraryProcessType;
|
| - sInstance = new BrowserStartupController(context, libraryProcessType);
|
| + sInstance = new BrowserStartupController(
|
| + context, libraryProcessType, useApplicationContext);
|
| }
|
| assert sInstance.mLibraryProcessType == libraryProcessType : "Wrong process type";
|
| return sInstance;
|
| @@ -150,6 +157,7 @@ public class BrowserStartupController {
|
| */
|
| public void startBrowserProcessesAsync(final StartupCallback callback)
|
| throws ProcessInitException {
|
| + Log.w("auraclank", "BrowserStartupController.startBrowserProcessesAsync");
|
| assert ThreadUtils.runningOnUiThread() : "Tried to start the browser on the wrong thread.";
|
| if (mStartupDone) {
|
| // Browser process initialization has already been completed, so we can immediately post
|
| @@ -171,6 +179,7 @@ public class BrowserStartupController {
|
| @Override
|
| public void run() {
|
| ThreadUtils.assertOnUiThread();
|
| + Log.w("auraclank", "prepareToStartBrowserProcess callback called");
|
| if (contentStart() > 0) {
|
| // Failed. The callbacks may not have run, so run them.
|
| enqueueCallbackExecution(STARTUP_FAILURE, NOT_ALREADY_STARTED);
|
|
|