| 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 93f05de9a93692c5d2608806e939334d2568a07e..521517841ca5ca9e95144077c985f2a40b8e2abc 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
|
| @@ -136,7 +136,7 @@ import javax.annotation.Nullable;
|
| *
|
| * This behaviour is altered by the BROWSER_SHARED_RELRO_CONFIG configuration
|
| * variable below, which may force the browser to load the libraries at
|
| - * fixed addresses to.
|
| + * fixed addresses too.
|
| *
|
| * - Once all libraries are loaded in the browser process, one can call
|
| * getSharedRelros() which returns a Bundle instance containing a map that
|
| @@ -382,6 +382,19 @@ public class Linker {
|
| }
|
|
|
| /**
|
| + * Call this method to determine if the linker is running in the browser
|
| + * process.
|
| + *
|
| + * @return true if the linker is running in the browser process.
|
| + */
|
| + public static boolean isInBrowserProcess() {
|
| + synchronized (Linker.class) {
|
| + ensureInitializedLocked();
|
| + return sInBrowserProcess;
|
| + }
|
| + }
|
| +
|
| + /**
|
| * Call this method to determine if the chromium project must load
|
| * the library directly from the zip file.
|
| */
|
| @@ -820,6 +833,25 @@ public class Linker {
|
| }
|
|
|
| /**
|
| + * Check whether the device supports memory mapping APK files with executable
|
| + * permissions.
|
| + *
|
| + * @param apkFile Filename of the APK.
|
| + * @return true if supported.
|
| + */
|
| + public static boolean checkApkMemoryMappingSupport(String apkFile) {
|
| + synchronized (Linker.class) {
|
| + ensureInitializedLocked();
|
| +
|
| + if (DEBUG) Log.i(TAG, "checkApkMemoryMappingSupport: " + apkFile);
|
| + boolean supported = nativeCheckApkMemoryMappingSupport(apkFile);
|
| + if (DEBUG) Log.i(TAG, "Memory mapping APK files with executable permissions " +
|
| + (supported ? "" : "NOT ") + "supported");
|
| + return supported;
|
| + }
|
| + }
|
| +
|
| + /**
|
| * Move activity from the native thread to the main UI thread.
|
| * Called from native code on its own thread. Posts a callback from
|
| * the UI thread back to native code.
|
| @@ -917,6 +949,16 @@ public class Linker {
|
| private static native long nativeGetRandomBaseLoadAddress(long sizeBytes);
|
|
|
| /**
|
| + * Native method which checks whether the device supports memory mapping APK
|
| + * files with executable permissions
|
| + *
|
| + * @param apkFile Filename of the APK.
|
| + * @return true if supported.
|
| + *
|
| + */
|
| + private static native boolean nativeCheckApkMemoryMappingSupport(String apkFile);
|
| +
|
| + /**
|
| * Record information for a given library.
|
| * IMPORTANT: Native code knows about this class's fields, so
|
| * don't change them without modifying the corresponding C++ sources.
|
|
|