| 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 23 matching lines...) Expand all Loading... |
| 34 import org.chromium.android_webview.AwCookieManager; | 34 import org.chromium.android_webview.AwCookieManager; |
| 35 import org.chromium.android_webview.AwDataReductionProxyManager; | 35 import org.chromium.android_webview.AwDataReductionProxyManager; |
| 36 import org.chromium.android_webview.AwDevToolsServer; | 36 import org.chromium.android_webview.AwDevToolsServer; |
| 37 import org.chromium.android_webview.AwQuotaManagerBridge; | 37 import org.chromium.android_webview.AwQuotaManagerBridge; |
| 38 import org.chromium.android_webview.AwResource; | 38 import org.chromium.android_webview.AwResource; |
| 39 import org.chromium.android_webview.AwSettings; | 39 import org.chromium.android_webview.AwSettings; |
| 40 import org.chromium.base.CommandLine; | 40 import org.chromium.base.CommandLine; |
| 41 import org.chromium.base.MemoryPressureListener; | 41 import org.chromium.base.MemoryPressureListener; |
| 42 import org.chromium.base.PathService; | 42 import org.chromium.base.PathService; |
| 43 import org.chromium.base.PathUtils; | 43 import org.chromium.base.PathUtils; |
| 44 import org.chromium.base.ResourceExtractor; | |
| 45 import org.chromium.base.ThreadUtils; | 44 import org.chromium.base.ThreadUtils; |
| 46 import org.chromium.base.TraceEvent; | 45 import org.chromium.base.TraceEvent; |
| 47 import org.chromium.base.library_loader.LibraryLoader; | 46 import org.chromium.base.library_loader.LibraryLoader; |
| 48 import org.chromium.base.library_loader.LibraryProcessType; | 47 import org.chromium.base.library_loader.LibraryProcessType; |
| 49 import org.chromium.base.library_loader.ProcessInitException; | 48 import org.chromium.base.library_loader.ProcessInitException; |
| 50 import org.chromium.content.app.ContentMain; | 49 import org.chromium.content.app.ContentMain; |
| 51 import org.chromium.content.browser.ContentViewStatics; | 50 import org.chromium.content.browser.ContentViewStatics; |
| 52 | 51 |
| 53 import java.io.File; | 52 import java.io.File; |
| 54 import java.lang.ref.WeakReference; | 53 import java.lang.ref.WeakReference; |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 assert Thread.holdsLock(mLock) && ThreadUtils.runningOnUiThread(); | 222 assert Thread.holdsLock(mLock) && ThreadUtils.runningOnUiThread(); |
| 224 | 223 |
| 225 // The post-condition of this method is everything is ready, so notify n
ow to cover all | 224 // The post-condition of this method is everything is ready, so notify n
ow to cover all |
| 226 // return paths. (Other threads will not wake-up until we release |mLock
|, whatever). | 225 // return paths. (Other threads will not wake-up until we release |mLock
|, whatever). |
| 227 mLock.notifyAll(); | 226 mLock.notifyAll(); |
| 228 | 227 |
| 229 if (mStarted) { | 228 if (mStarted) { |
| 230 return; | 229 return; |
| 231 } | 230 } |
| 232 | 231 |
| 233 // We don't need to extract any paks because for WebView, they are | |
| 234 // in the system image. | |
| 235 ResourceExtractor.setMandatoryPaksToExtract(0); | |
| 236 | |
| 237 try { | 232 try { |
| 238 LibraryLoader.get(LibraryProcessType.PROCESS_WEBVIEW).ensureInitiali
zed(); | 233 LibraryLoader.get(LibraryProcessType.PROCESS_WEBVIEW).ensureInitiali
zed(); |
| 239 } catch (ProcessInitException e) { | 234 } catch (ProcessInitException e) { |
| 240 throw new RuntimeException("Error initializing WebView library", e); | 235 throw new RuntimeException("Error initializing WebView library", e); |
| 241 } | 236 } |
| 242 | 237 |
| 243 PathService.override(PathService.DIR_MODULE, "/system/lib/"); | 238 PathService.override(PathService.DIR_MODULE, "/system/lib/"); |
| 244 PathService.override(DIR_RESOURCE_PAKS_ANDROID, "/system/framework/webvi
ew/paks"); | 239 PathService.override(DIR_RESOURCE_PAKS_ANDROID, "/system/framework/webvi
ew/paks"); |
| 245 | 240 |
| 246 // Make sure that ResourceProvider is initialized before starting the br
owser process. | 241 // Make sure that ResourceProvider is initialized before starting the br
owser process. |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 463 browserContext.getHttpAuthDatabase(context)); | 458 browserContext.getHttpAuthDatabase(context)); |
| 464 } | 459 } |
| 465 } | 460 } |
| 466 return mWebViewDatabase; | 461 return mWebViewDatabase; |
| 467 } | 462 } |
| 468 | 463 |
| 469 WebViewDelegate getWebViewDelegate() { | 464 WebViewDelegate getWebViewDelegate() { |
| 470 return mWebViewDelegate; | 465 return mWebViewDelegate; |
| 471 } | 466 } |
| 472 } | 467 } |
| OLD | NEW |