| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package com.android.webview.chromium; | 5 package com.android.webview.chromium; |
| 6 | 6 |
| 7 import android.Manifest; | 7 import android.Manifest; |
| 8 import android.app.ActivityManager; | 8 import android.app.ActivityManager; |
| 9 import android.content.ComponentCallbacks2; | 9 import android.content.ComponentCallbacks2; |
| 10 import android.content.Context; | 10 import android.content.Context; |
| (...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 394 | 394 |
| 395 try { | 395 try { |
| 396 LibraryLoader.get(LibraryProcessType.PROCESS_WEBVIEW).ensureInitiali
zed(); | 396 LibraryLoader.get(LibraryProcessType.PROCESS_WEBVIEW).ensureInitiali
zed(); |
| 397 } catch (ProcessInitException e) { | 397 } catch (ProcessInitException e) { |
| 398 throw new RuntimeException("Error initializing WebView library", e); | 398 throw new RuntimeException("Error initializing WebView library", e); |
| 399 } | 399 } |
| 400 | 400 |
| 401 PathService.override(PathService.DIR_MODULE, "/system/lib/"); | 401 PathService.override(PathService.DIR_MODULE, "/system/lib/"); |
| 402 PathService.override(DIR_RESOURCE_PAKS_ANDROID, "/system/framework/webvi
ew/paks"); | 402 PathService.override(DIR_RESOURCE_PAKS_ANDROID, "/system/framework/webvi
ew/paks"); |
| 403 | 403 |
| 404 final Context context = ContextUtils.getApplicationContext(); | |
| 405 // Future calls to PlatformServiceBridge.getInstance() rely on it having
been created here. | |
| 406 PlatformServiceBridge.getOrCreateInstance(); | |
| 407 | |
| 408 // Make sure that ResourceProvider is initialized before starting the br
owser process. | 404 // Make sure that ResourceProvider is initialized before starting the br
owser process. |
| 409 final PackageInfo webViewPackageInfo = WebViewFactory.getLoadedPackageIn
fo(); | 405 final PackageInfo webViewPackageInfo = WebViewFactory.getLoadedPackageIn
fo(); |
| 410 final String webViewPackageName = webViewPackageInfo.packageName; | 406 final String webViewPackageName = webViewPackageInfo.packageName; |
| 407 final Context context = ContextUtils.getApplicationContext(); |
| 411 setUpResources(webViewPackageInfo, context); | 408 setUpResources(webViewPackageInfo, context); |
| 412 initPlatSupportLibrary(); | 409 initPlatSupportLibrary(); |
| 413 doNetworkInitializations(context); | 410 doNetworkInitializations(context); |
| 414 final boolean isExternalService = true; | 411 final boolean isExternalService = true; |
| 415 AwBrowserProcess.configureChildProcessLauncher(webViewPackageName, isExt
ernalService); | 412 AwBrowserProcess.configureChildProcessLauncher(webViewPackageName, isExt
ernalService); |
| 416 AwBrowserProcess.start(); | 413 AwBrowserProcess.start(); |
| 417 | 414 |
| 418 final boolean enableMinidumpUploadingForTesting = CommandLine.getInstanc
e().hasSwitch( | 415 final boolean enableMinidumpUploadingForTesting = CommandLine.getInstanc
e().hasSwitch( |
| 419 CommandLineUtil.CRASH_UPLOADS_ENABLED_FOR_TESTING_SWITCH); | 416 CommandLineUtil.CRASH_UPLOADS_ENABLED_FOR_TESTING_SWITCH); |
| 420 if (enableMinidumpUploadingForTesting) { | 417 if (enableMinidumpUploadingForTesting) { |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 692 WebViewDelegate getWebViewDelegate() { | 689 WebViewDelegate getWebViewDelegate() { |
| 693 return mWebViewDelegate; | 690 return mWebViewDelegate; |
| 694 } | 691 } |
| 695 | 692 |
| 696 // The method to support unreleased Android. | 693 // The method to support unreleased Android. |
| 697 WebViewContentsClientAdapter createWebViewContentsClientAdapter(WebView webV
iew, | 694 WebViewContentsClientAdapter createWebViewContentsClientAdapter(WebView webV
iew, |
| 698 Context context) { | 695 Context context) { |
| 699 return new WebViewContentsClientAdapter(webView, context, mWebViewDelega
te); | 696 return new WebViewContentsClientAdapter(webView, context, mWebViewDelega
te); |
| 700 } | 697 } |
| 701 } | 698 } |
| OLD | NEW |