| 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.app.ActivityManager; | 7 import android.app.ActivityManager; |
| 8 import android.content.ComponentCallbacks2; | 8 import android.content.ComponentCallbacks2; |
| 9 import android.content.Context; | 9 import android.content.Context; |
| 10 import android.content.Intent; | 10 import android.content.Intent; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 import org.chromium.android_webview.AwResource; | 37 import org.chromium.android_webview.AwResource; |
| 38 import org.chromium.android_webview.AwSettings; | 38 import org.chromium.android_webview.AwSettings; |
| 39 import org.chromium.base.CommandLine; | 39 import org.chromium.base.CommandLine; |
| 40 import org.chromium.base.MemoryPressureListener; | 40 import org.chromium.base.MemoryPressureListener; |
| 41 import org.chromium.base.PathService; | 41 import org.chromium.base.PathService; |
| 42 import org.chromium.base.PathUtils; | 42 import org.chromium.base.PathUtils; |
| 43 import org.chromium.base.ResourceExtractor; | 43 import org.chromium.base.ResourceExtractor; |
| 44 import org.chromium.base.ThreadUtils; | 44 import org.chromium.base.ThreadUtils; |
| 45 import org.chromium.base.TraceEvent; | 45 import org.chromium.base.TraceEvent; |
| 46 import org.chromium.base.library_loader.LibraryLoader; | 46 import org.chromium.base.library_loader.LibraryLoader; |
| 47 import org.chromium.base.library_loader.LibraryProcessType; |
| 47 import org.chromium.base.library_loader.ProcessInitException; | 48 import org.chromium.base.library_loader.ProcessInitException; |
| 48 import org.chromium.content.app.ContentMain; | 49 import org.chromium.content.app.ContentMain; |
| 49 import org.chromium.content.browser.ContentViewStatics; | 50 import org.chromium.content.browser.ContentViewStatics; |
| 50 | 51 |
| 51 import java.io.File; | 52 import java.io.File; |
| 52 import java.lang.ref.WeakReference; | 53 import java.lang.ref.WeakReference; |
| 53 import java.util.ArrayList; | 54 import java.util.ArrayList; |
| 54 | 55 |
| 55 /** | 56 /** |
| 56 * Entry point to the WebView. The system framework talks to this class to get i
nstances of the | 57 * Entry point to the WebView. The system framework talks to this class to get i
nstances of the |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 | 230 |
| 230 if (mStarted) { | 231 if (mStarted) { |
| 231 return; | 232 return; |
| 232 } | 233 } |
| 233 | 234 |
| 234 // We don't need to extract any paks because for WebView, they are | 235 // We don't need to extract any paks because for WebView, they are |
| 235 // in the system image. | 236 // in the system image. |
| 236 ResourceExtractor.setMandatoryPaksToExtract(""); | 237 ResourceExtractor.setMandatoryPaksToExtract(""); |
| 237 | 238 |
| 238 try { | 239 try { |
| 239 LibraryLoader.ensureInitialized(); | 240 LibraryLoader.get(LibraryProcessType.PROCESS_WEBVIEW).ensureInitiali
zed(); |
| 240 } catch (ProcessInitException e) { | 241 } catch (ProcessInitException e) { |
| 241 throw new RuntimeException("Error initializing WebView library", e); | 242 throw new RuntimeException("Error initializing WebView library", e); |
| 242 } | 243 } |
| 243 | 244 |
| 244 PathService.override(PathService.DIR_MODULE, "/system/lib/"); | 245 PathService.override(PathService.DIR_MODULE, "/system/lib/"); |
| 245 PathService.override(DIR_RESOURCE_PAKS_ANDROID, "/system/framework/webvi
ew/paks"); | 246 PathService.override(DIR_RESOURCE_PAKS_ANDROID, "/system/framework/webvi
ew/paks"); |
| 246 | 247 |
| 247 // Make sure that ResourceProvider is initialized before starting the br
owser process. | 248 // Make sure that ResourceProvider is initialized before starting the br
owser process. |
| 248 Context context = getWrappedCurrentApplicationContext(); | 249 Context context = getWrappedCurrentApplicationContext(); |
| 249 setUpResources(context); | 250 setUpResources(context); |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 469 browserContext.getHttpAuthDatabase(context)); | 470 browserContext.getHttpAuthDatabase(context)); |
| 470 } | 471 } |
| 471 } | 472 } |
| 472 return mWebViewDatabase; | 473 return mWebViewDatabase; |
| 473 } | 474 } |
| 474 | 475 |
| 475 WebViewDelegate getWebViewDelegate() { | 476 WebViewDelegate getWebViewDelegate() { |
| 476 return mWebViewDelegate; | 477 return mWebViewDelegate; |
| 477 } | 478 } |
| 478 } | 479 } |
| OLD | NEW |