Chromium Code Reviews| Index: android_webview/java/src/org/chromium/android_webview/AwBrowserProcess.java |
| diff --git a/android_webview/java/src/org/chromium/android_webview/AwBrowserProcess.java b/android_webview/java/src/org/chromium/android_webview/AwBrowserProcess.java |
| index 0989339b969783fb484cf3eec493e0da9250c82c..35bb81ed96d516a924431fa1a3cb0ccd44142413 100644 |
| --- a/android_webview/java/src/org/chromium/android_webview/AwBrowserProcess.java |
| +++ b/android_webview/java/src/org/chromium/android_webview/AwBrowserProcess.java |
| @@ -4,8 +4,10 @@ |
| package org.chromium.android_webview; |
| +import android.app.Application; |
| import android.content.Context; |
| +import org.chromium.base.ApplicationStatus; |
| import org.chromium.base.CommandLine; |
| import org.chromium.base.PathUtils; |
| import org.chromium.base.ThreadUtils; |
| @@ -46,14 +48,19 @@ public abstract class AwBrowserProcess { |
| * and performs other per-app resource allocations; must not be called from zygote. |
| * Note: it is up to the caller to ensure this is only called once. |
| * @param context The Android application context |
| + * @param application The Android application. Used to enable ApplicationStatus, if |
| + * null the ApplicationStatus is not enabled. |
| */ |
| - public static void start(final Context context) { |
| + public static void start(final Context context, final Application application) { |
| // We must post to the UI thread to cover the case that the user |
| // has invoked Chromium startup by using the (thread-safe) |
| // CookieManager rather than creating a WebView. |
| ThreadUtils.runOnUiThreadBlocking(new Runnable() { |
| @Override |
| public void run() { |
| + if (application != null) { |
| + ApplicationStatus.initializeActivityIndependent(application, context); |
| + } |
| try { |
| BrowserStartupController.get(context, LibraryProcessType.PROCESS_WEBVIEW) |
| .startBrowserProcessesSync(!CommandLine.getInstance().hasSwitch( |
| @@ -64,4 +71,11 @@ public abstract class AwBrowserProcess { |
| } |
| }); |
| } |
| + |
| + /** |
| + * Same as {@link #start(Context, Application)} except it does not enable ApplicationStatus. |
| + */ |
| + public static void start(final Context context) { |
|
boliu
2015/10/02 15:51:32
Fix all the callers instead? It's not like this ne
timvolodine
2015/10/08 16:13:55
yes can do that, just thought start(.., null) in t
boliu
2015/10/08 18:01:30
having production code be pretty is a good tradeof
timvolodine
2015/10/09 15:46:36
right, it's currently disabled but I guess we coul
|
| + start(context, null); |
| + } |
| } |