summaryrefslogtreecommitdiff
path: root/core/java/android/webkit/WebViewLibraryLoader.java
diff options
context:
space:
mode:
authorGustav Sennton <gsennton@google.com>2017-06-21 17:51:27 +0100
committerGustav Sennton <gsennton@google.com>2017-06-26 16:05:33 +0100
commitbeec08679b7e0cfc10f1ef57072716b17ce417c3 (patch)
tree566af8a7dbfaba8f21ebe57a6c915060a5868573 /core/java/android/webkit/WebViewLibraryLoader.java
parentd9dd77ea6a04ccea47c9366785ec7d7171c5c32a (diff)
Use classloader namespace instead of lib paths to load WebView libs.
When loading WebView's native libraries we now have a classloader pointing to the namespace of thise libraries - so we no longer need to explicitly reference those libraries by their path names. Bug: 62860565 Test: Start a WebView-using app. Ensure that libwebviewchromium.so is loaded into the app process. Change-Id: I205131f4b5fac7c33374560515b85ddef19a7ce9
Diffstat (limited to 'core/java/android/webkit/WebViewLibraryLoader.java')
-rw-r--r--core/java/android/webkit/WebViewLibraryLoader.java13
1 files changed, 5 insertions, 8 deletions
diff --git a/core/java/android/webkit/WebViewLibraryLoader.java b/core/java/android/webkit/WebViewLibraryLoader.java
index e385a4832a0c..6f9e8ece4b13 100644
--- a/core/java/android/webkit/WebViewLibraryLoader.java
+++ b/core/java/android/webkit/WebViewLibraryLoader.java
@@ -215,12 +215,10 @@ class WebViewLibraryLoader {
return WebViewFactory.LIBLOAD_ADDRESS_SPACE_NOT_RESERVED;
}
- String[] args = getWebViewNativeLibraryPaths(packageInfo);
- int result = nativeLoadWithRelroFile(args[0] /* path32 */,
- args[1] /* path64 */,
- CHROMIUM_WEBVIEW_NATIVE_RELRO_32,
- CHROMIUM_WEBVIEW_NATIVE_RELRO_64,
- clazzLoader);
+ final String libraryFileName =
+ WebViewFactory.getWebViewLibrary(packageInfo.applicationInfo);
+ int result = nativeLoadWithRelroFile(libraryFileName, CHROMIUM_WEBVIEW_NATIVE_RELRO_32,
+ CHROMIUM_WEBVIEW_NATIVE_RELRO_64, clazzLoader);
if (result != WebViewFactory.LIBLOAD_SUCCESS) {
Log.w(LOGTAG, "failed to load with relro file, proceeding without");
} else if (DEBUG) {
@@ -317,7 +315,6 @@ class WebViewLibraryLoader {
static native boolean nativeReserveAddressSpace(long addressSpaceToReserve);
static native boolean nativeCreateRelroFile(String lib32, String lib64,
String relro32, String relro64);
- static native int nativeLoadWithRelroFile(String lib32, String lib64,
- String relro32, String relro64,
+ static native int nativeLoadWithRelroFile(String lib, String relro32, String relro64,
ClassLoader clazzLoader);
}