| 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 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 assert Thread.holdsLock(mLock) && ThreadUtils.runningOnUiThread(); | 373 assert Thread.holdsLock(mLock) && ThreadUtils.runningOnUiThread(); |
| 374 | 374 |
| 375 // The post-condition of this method is everything is ready, so notify n
ow to cover all | 375 // The post-condition of this method is everything is ready, so notify n
ow to cover all |
| 376 // return paths. (Other threads will not wake-up until we release |mLock
|, whatever). | 376 // return paths. (Other threads will not wake-up until we release |mLock
|, whatever). |
| 377 mLock.notifyAll(); | 377 mLock.notifyAll(); |
| 378 | 378 |
| 379 if (mStarted) { | 379 if (mStarted) { |
| 380 return; | 380 return; |
| 381 } | 381 } |
| 382 | 382 |
| 383 Context context = ContextUtils.getApplicationContext(); | |
| 384 try { | 383 try { |
| 385 LibraryLoader.get(LibraryProcessType.PROCESS_WEBVIEW).ensureInitiali
zed(context); | 384 LibraryLoader.get(LibraryProcessType.PROCESS_WEBVIEW).ensureInitiali
zed(); |
| 386 } catch (ProcessInitException e) { | 385 } catch (ProcessInitException e) { |
| 387 throw new RuntimeException("Error initializing WebView library", e); | 386 throw new RuntimeException("Error initializing WebView library", e); |
| 388 } | 387 } |
| 389 | 388 |
| 390 PathService.override(PathService.DIR_MODULE, "/system/lib/"); | 389 PathService.override(PathService.DIR_MODULE, "/system/lib/"); |
| 391 PathService.override(DIR_RESOURCE_PAKS_ANDROID, "/system/framework/webvi
ew/paks"); | 390 PathService.override(DIR_RESOURCE_PAKS_ANDROID, "/system/framework/webvi
ew/paks"); |
| 392 | 391 |
| 393 // Make sure that ResourceProvider is initialized before starting the br
owser process. | 392 // Make sure that ResourceProvider is initialized before starting the br
owser process. |
| 394 final String webViewPackageName = WebViewFactory.getLoadedPackageInfo().
packageName; | 393 final String webViewPackageName = WebViewFactory.getLoadedPackageInfo().
packageName; |
| 394 Context context = ContextUtils.getApplicationContext(); |
| 395 setUpResources(webViewPackageName, context); | 395 setUpResources(webViewPackageName, context); |
| 396 ResourceBundle.initializeLocalePaks(context, R.array.locale_paks); | 396 ResourceBundle.initializeLocalePaks(context, R.array.locale_paks); |
| 397 initPlatSupportLibrary(); | 397 initPlatSupportLibrary(); |
| 398 initNetworkChangeNotifier(context); | 398 initNetworkChangeNotifier(context); |
| 399 final int extraBindFlags = Context.BIND_EXTERNAL_SERVICE; | 399 final int extraBindFlags = Context.BIND_EXTERNAL_SERVICE; |
| 400 AwBrowserProcess.configureChildProcessLauncher(webViewPackageName, extra
BindFlags); | 400 AwBrowserProcess.configureChildProcessLauncher(webViewPackageName, extra
BindFlags); |
| 401 AwBrowserProcess.start(); | 401 AwBrowserProcess.start(); |
| 402 | 402 |
| 403 if (isBuildDebuggable()) { | 403 if (isBuildDebuggable()) { |
| 404 setWebContentsDebuggingEnabled(true); | 404 setWebContentsDebuggingEnabled(true); |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 654 mWebViewDatabase = new WebViewDatabaseAdapter(this, awDatabase); | 654 mWebViewDatabase = new WebViewDatabaseAdapter(this, awDatabase); |
| 655 } | 655 } |
| 656 } | 656 } |
| 657 return mWebViewDatabase; | 657 return mWebViewDatabase; |
| 658 } | 658 } |
| 659 | 659 |
| 660 WebViewDelegate getWebViewDelegate() { | 660 WebViewDelegate getWebViewDelegate() { |
| 661 return mWebViewDelegate; | 661 return mWebViewDelegate; |
| 662 } | 662 } |
| 663 } | 663 } |
| OLD | NEW |