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

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

Issue 329223002: Android: enable chromium linker on the shells. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments Created 6 years, 6 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 | chrome/chrome_android.gypi » ('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 54a672d7f166e9b625b736beef5ec6ae0ade6bdf..408906cb827d6c77c438c9de436f70dbbdde8b48 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
@@ -474,15 +474,24 @@ public class Linker {
public static void useSharedRelros(Bundle bundle) {
// Ensure the bundle uses the application's class loader, not the framework
// one which doesn't know anything about LibInfo.
- if (bundle != null)
+ // Also, hold a fresh copy of it so the caller can't recycle it.
+ Bundle clonedBundle = null;
+ if (bundle != null) {
bundle.setClassLoader(LibInfo.class.getClassLoader());
-
- if (DEBUG) Log.i(TAG, "useSharedRelros() called with " + bundle);
-
+ clonedBundle = new Bundle(LibInfo.class.getClassLoader());
+ Parcel p = Parcel.obtain();
+ bundle.writeToParcel(p, 0);
+ clonedBundle.readFromParcel(p);
+ p.recycle();
+ }
+ if (DEBUG) {
+ Log.i(TAG, "useSharedRelros() called with " + bundle +
+ ",cloned " + clonedBundle);
+ }
synchronized (Linker.class) {
// Note that in certain cases, this can be called before
// initServiceProcess() in service processes.
- sSharedRelros = bundle;
+ sSharedRelros = clonedBundle;
// Tell any listener blocked in finishLibraryLoad() about it.
Linker.class.notifyAll();
}
« no previous file with comments | « no previous file | chrome/chrome_android.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698