Chromium Code Reviews| Index: android_webview/glue/java/src/com/android/webview/chromium/WebViewChromiumFactoryProvider.java |
| diff --git a/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromiumFactoryProvider.java b/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromiumFactoryProvider.java |
| index dd5951fda786f115e10b37f5630957a80a43c4a7..a39700d027410e13ff6fd93d45136c7b909e84ad 100644 |
| --- a/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromiumFactoryProvider.java |
| +++ b/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromiumFactoryProvider.java |
| @@ -402,10 +402,13 @@ public class WebViewChromiumFactoryProvider implements WebViewFactoryProvider { |
| PathService.override(PathService.DIR_MODULE, "/system/lib/"); |
| PathService.override(DIR_RESOURCE_PAKS_ANDROID, "/system/framework/webview/paks"); |
| + final Context context = ContextUtils.getApplicationContext(); |
| + // Future calls to PlatformServiceBridge.getInstance() rely on it having been created here. |
| + PlatformServiceBridge.getOrCreateInstance(context); |
| + |
| // Make sure that ResourceProvider is initialized before starting the browser process. |
| final PackageInfo webViewPackageInfo = WebViewFactory.getLoadedPackageInfo(); |
| final String webViewPackageName = webViewPackageInfo.packageName; |
| - final Context context = ContextUtils.getApplicationContext(); |
| setUpResources(webViewPackageInfo, context); |
| initPlatSupportLibrary(); |
| doNetworkInitializations(context); |
| @@ -419,18 +422,18 @@ public class WebViewChromiumFactoryProvider implements WebViewFactoryProvider { |
| AwBrowserProcess.handleMinidumps(webViewPackageName, true /* enabled */); |
| } |
| - // Actions conditioned on whether the Android Checkbox is toggled on |
| - PlatformServiceBridge.getInstance(context) |
| - .queryMetricsSetting(new ValueCallback<Boolean>() { |
| - public void onReceiveValue(Boolean enabled) { |
| - ThreadUtils.assertOnUiThread(); |
| - AwMetricsServiceClient.setConsentSetting(context, enabled); |
| + // Future calls to PlatformServiceBridge.getInstance() rely on it having been created here. |
|
gsennton
2017/04/05 15:21:13
This comment doesn't fit here anymore?
paulmiller
2017/04/05 17:02:39
Done.
|
| + PlatformServiceBridge.getInstance().queryMetricsSetting(new ValueCallback<Boolean>() { |
| + // Actions conditioned on whether the Android Checkbox is toggled on |
| + public void onReceiveValue(Boolean enabled) { |
| + ThreadUtils.assertOnUiThread(); |
| + AwMetricsServiceClient.setConsentSetting(context, enabled); |
| - if (!enableMinidumpUploadingForTesting) { |
| - AwBrowserProcess.handleMinidumps(webViewPackageName, enabled); |
| - } |
| - } |
| - }); |
| + if (!enableMinidumpUploadingForTesting) { |
| + AwBrowserProcess.handleMinidumps(webViewPackageName, enabled); |
| + } |
| + } |
| + }); |
| if (CommandLineUtil.isBuildDebuggable()) { |
| setWebContentsDebuggingEnabled(true); |