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

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

Issue 2453683007: Revert of Crazylinker: remove the code to load component build library (Closed)
Patch Set: Created 4 years, 2 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
« no previous file with comments | « no previous file | base/android/linker/config.gni » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/android/java/src/org/chromium/base/library_loader/Linker.java
diff --git a/base/android/java/src/org/chromium/base/library_loader/Linker.java b/base/android/java/src/org/chromium/base/library_loader/Linker.java
index 7d1999582963efd31779e68aa7761cedbaf43e45..271e6cb7848d7aa40258efa075ccf871e43e5b0a 100644
--- a/base/android/java/src/org/chromium/base/library_loader/Linker.java
+++ b/base/android/java/src/org/chromium/base/library_loader/Linker.java
@@ -503,24 +503,32 @@
}
/**
- * Determine whether a library is the linker library.
+ * Determine whether a library is the linker library. Also deal with the
+ * component build that adds a .cr suffix to the name.
*
* @param library the name of the library.
* @return true is the library is the Linker's own JNI library.
*/
public boolean isChromiumLinkerLibrary(String library) {
- return library.equals(LINKER_JNI_LIBRARY);
+ return library.equals(LINKER_JNI_LIBRARY) || library.equals(LINKER_JNI_LIBRARY + ".cr");
}
/**
* Load the Linker JNI library. Throws UnsatisfiedLinkError on error.
+ * In a component build, the suffix ".cr" is added to each library name, so
+ * if the initial load fails we retry with a suffix.
*/
protected static void loadLinkerJniLibrary() {
String libName = "lib" + LINKER_JNI_LIBRARY + ".so";
if (DEBUG) {
Log.i(TAG, "Loading " + libName);
}
- System.loadLibrary(LINKER_JNI_LIBRARY);
+ try {
+ System.loadLibrary(LINKER_JNI_LIBRARY);
+ } catch (UnsatisfiedLinkError e) {
+ Log.w(TAG, "Couldn't load " + libName + ", trying " + libName + ".cr");
+ System.loadLibrary(LINKER_JNI_LIBRARY + ".cr");
+ }
}
/**
« no previous file with comments | « no previous file | base/android/linker/config.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698