Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2034)

Unified Diff: base/android/java/src/org/chromium/base/library_loader/LibraryLoader.java

Issue 2593653002: Split JNI init so native library preloading dosn't cause native init. (Closed)
Patch Set: Add library initialization to AwCookieManager constructor Created 3 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: base/android/java/src/org/chromium/base/library_loader/LibraryLoader.java
diff --git a/base/android/java/src/org/chromium/base/library_loader/LibraryLoader.java b/base/android/java/src/org/chromium/base/library_loader/LibraryLoader.java
index 79dc8d6bc3f27a6efde1df1f4fb3b3e40a5dfc27..f833abba1ad31443eb68b268edf8faec8b88846b 100644
--- a/base/android/java/src/org/chromium/base/library_loader/LibraryLoader.java
+++ b/base/android/java/src/org/chromium/base/library_loader/LibraryLoader.java
@@ -324,15 +324,6 @@ public class LibraryLoader {
} catch (UnsatisfiedLinkError e) {
throw new ProcessInitException(LoaderErrors.LOADER_ERROR_NATIVE_LIBRARY_LOAD_FAILED, e);
}
- // Check that the version of the library we have loaded matches the version we expect
- Log.i(TAG, String.format(
- "Expected native library version number \"%s\", "
- + "actual native library version number \"%s\"",
- NativeLibraries.sVersionNumber,
- nativeGetVersionNumber()));
- if (!NativeLibraries.sVersionNumber.equals(nativeGetVersionNumber())) {
- throw new ProcessInitException(LoaderErrors.LOADER_ERROR_NATIVE_LIBRARY_WRONG_VERSION);
- }
}
// The WebView requires the Command Line to be switched over before
@@ -374,6 +365,14 @@ public class LibraryLoader {
throw new ProcessInitException(LoaderErrors.LOADER_ERROR_FAILED_TO_REGISTER_JNI);
}
+ // Check that the version of the library we have loaded matches the version we expect
Torne 2017/01/03 12:13:50 Why was it necessary to move this? Just curious.
Tobias Sargeant 2017/01/04 00:24:53 The native native library version is set by the in
+ Log.i(TAG, String.format("Expected native library version number \"%s\", "
+ + "actual native library version number \"%s\"",
+ NativeLibraries.sVersionNumber, nativeGetVersionNumber()));
+ if (!NativeLibraries.sVersionNumber.equals(nativeGetVersionNumber())) {
+ throw new ProcessInitException(LoaderErrors.LOADER_ERROR_NATIVE_LIBRARY_WRONG_VERSION);
+ }
+
// From now on, keep tracing in sync with native.
TraceEvent.registerNativeEnabledObserver();

Powered by Google App Engine
This is Rietveld 408576698