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

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: Fixes relro bundle 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..9bd536236835a8c567583096a5e36f2d3dd4b9b3 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 nullOrCopy = null;
simonb (inactive) 2014/06/16 10:38:38 Perhaps a more descriptive variable name? clonedB
bulach 2014/06/16 21:54:55 Done.
+ if (bundle != null) {
+ if (DEBUG) Log.i(TAG, "useSharedRelros() being DE-SER");
simonb (inactive) 2014/06/16 10:38:38 Old debugging trace? Message seems unhelpful with
bulach 2014/06/16 21:54:55 ops, my bad. deleted.
bundle.setClassLoader(LibInfo.class.getClassLoader());
+ nullOrCopy = new Bundle(LibInfo.class.getClassLoader());
+ Parcel p = Parcel.obtain();
+ bundle.writeToParcel(p, 0);
+ nullOrCopy.readFromParcel(p);
+ p.recycle();
+ }
- if (DEBUG) Log.i(TAG, "useSharedRelros() called with " + bundle);
+ if (DEBUG) Log.i(TAG, "useSharedRelros() called with " + nullOrCopy);
simonb (inactive) 2014/06/16 10:38:38 No longer strictly accurate. Perhaps '... setting
bulach 2014/06/16 21:54:55 Done.
synchronized (Linker.class) {
// Note that in certain cases, this can be called before
// initServiceProcess() in service processes.
- sSharedRelros = bundle;
+ sSharedRelros = nullOrCopy;
// 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