summaryrefslogtreecommitdiffstats
path: root/base/android/java
diff options
context:
space:
mode:
authorhjd@chromium.org <hjd@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-11 13:36:00 +0000
committerhjd@chromium.org <hjd@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-11 13:37:30 +0000
commit28eb8a28986c00f24221b0a25757f02b9a942839 (patch)
tree8a12f58a62773f87f06354f03ae3caa4b77b1e4f /base/android/java
parent18953a234c906f27e6344c45f444a8a779aa18c2 (diff)
downloadchromium_src-28eb8a28986c00f24221b0a25757f02b9a942839.zip
chromium_src-28eb8a28986c00f24221b0a25757f02b9a942839.tar.gz
chromium_src-28eb8a28986c00f24221b0a25757f02b9a942839.tar.bz2
The WebView has a path (early use of the CookieManager) which
needs access to the native command line arguments before we have initialized Chromium. This cl moves the setting up of the native command line to just after the LibraryLoaded.load step rather than just before the LibraryLoaded.initialise step. We remove the ability to pass the command line to initialize (which doesn't seem to be used) and remove the command line argument from the LibraryLoaded hook. You can access the native command line arguments instead which will have been set up. BUG=331424 Review URL: https://codereview.chromium.org/289303004 Cr-Commit-Position: refs/heads/master@{#288697} git-svn-id: svn://svn.chromium.org/chrome/trunk/src@288697 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/android/java')
-rw-r--r--base/android/java/src/org/chromium/base/library_loader/LibraryLoader.java23
1 files changed, 13 insertions, 10 deletions
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 278dcfe..32d8d80 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
@@ -83,7 +83,7 @@ public class LibraryLoader {
return;
}
loadAlreadyLocked(context, shouldDeleteOldWorkaroundLibraries);
- initializeAlreadyLocked(CommandLine.getJavaSwitchesOrNull());
+ initializeAlreadyLocked();
}
}
@@ -130,12 +130,10 @@ public class LibraryLoader {
* initializes the library here and now: must be called on the thread that the
* native will call its "main" thread. The library must have previously been
* loaded with loadNow.
- * @param initCommandLine The command line arguments that native command line will
- * be initialized with.
*/
- public static void initialize(String[] initCommandLine) throws ProcessInitException {
+ public static void initialize() throws ProcessInitException {
synchronized (sLock) {
- initializeAlreadyLocked(initCommandLine);
+ initializeAlreadyLocked();
}
}
@@ -190,6 +188,10 @@ public class LibraryLoader {
stopTime - startTime,
startTime % 10000,
stopTime % 10000));
+
+ nativeInitCommandLine(CommandLine.getJavaSwitchesOrNull());
+ CommandLine.enableNativeProxy();
+
sLoaded = true;
}
} catch (UnsatisfiedLinkError e) {
@@ -207,12 +209,12 @@ public class LibraryLoader {
}
// Invoke base::android::LibraryLoaded in library_loader_hooks.cc
- private static void initializeAlreadyLocked(String[] initCommandLine)
- throws ProcessInitException {
+ private static void initializeAlreadyLocked() throws ProcessInitException {
if (sInitialized) {
return;
}
- if (!nativeLibraryLoaded(initCommandLine)) {
+
+ if (!nativeLibraryLoaded()) {
Log.e(TAG, "error calling nativeLibraryLoaded");
throw new ProcessInitException(LoaderErrors.LOADER_ERROR_FAILED_TO_REGISTER_JNI);
}
@@ -220,7 +222,6 @@ public class LibraryLoader {
// shouldn't complain from now on (and in fact, it's used by the
// following calls).
sInitialized = true;
- CommandLine.enableNativeProxy();
// From now on, keep tracing in sync with native.
TraceEvent.registerNativeEnabledObserver();
@@ -234,13 +235,15 @@ public class LibraryLoader {
nativeRecordNativeLibraryHack(sNativeLibraryHackWasUsed);
}
+ private static native void nativeInitCommandLine(String[] initCommandLine);
+
// Only methods needed before or during normal JNI registration are during System.OnLoad.
// nativeLibraryLoaded is then called to register everything else. This process is called
// "initialization". This method will be mapped (by generated code) to the LibraryLoaded
// definition in base/android/library_loader/library_loader_hooks.cc.
//
// Return true on success and false on failure.
- private static native boolean nativeLibraryLoaded(String[] initCommandLine);
+ private static native boolean nativeLibraryLoaded();
// Method called to record statistics about the Chromium linker operation,
// i.e. whether the library failed to be loaded at a fixed address, and