summaryrefslogtreecommitdiffstats
path: root/content/app/android/library_loader_hooks.cc
diff options
context:
space:
mode:
authoraberent@chromium.org <aberent@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-19 20:43:55 +0000
committeraberent@chromium.org <aberent@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-19 20:43:55 +0000
commitf4da17db5acfcc233fcd8b5917ed213f4e571477 (patch)
tree2f8c7e91bcddce502ce4307dc4cad3bd3b1c58d2 /content/app/android/library_loader_hooks.cc
parent3263a9f3effa35ca44d7d820154b7f871cab77c8 (diff)
downloadchromium_src-f4da17db5acfcc233fcd8b5917ed213f4e571477.zip
chromium_src-f4da17db5acfcc233fcd8b5917ed213f4e571477.tar.gz
chromium_src-f4da17db5acfcc233fcd8b5917ed213f4e571477.tar.bz2
[Android] Allow JNI initialization on background thread
The code used to insist that JNI initialization only happened on the main (UI) thread. This was because it was believed that the static initialization of the Java classes initialized as a result of JNI calls might only work on the UI thread. In practice it seems that none of these Java classes have this requirement, so this seems to have been an unnecessary restriction, and slowed up startup on Chrome for Android. Remove this restriction, but add locks to ensure that only one thread is trying to initialize the JNI at a time. Also change some function names to reflect this change. BUG=214560 Review URL: https://chromiumcodereview.appspot.com/12700011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@189093 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/app/android/library_loader_hooks.cc')
-rw-r--r--content/app/android/library_loader_hooks.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/content/app/android/library_loader_hooks.cc b/content/app/android/library_loader_hooks.cc
index 213f65e..93a9d07 100644
--- a/content/app/android/library_loader_hooks.cc
+++ b/content/app/android/library_loader_hooks.cc
@@ -35,8 +35,8 @@ base::AtExitManager* g_at_exit_manager = NULL;
namespace content {
-static jint LibraryLoadedOnMainThread(JNIEnv* env, jclass clazz,
- jobjectArray init_command_line) {
+static jint LibraryLoaded(JNIEnv* env, jclass clazz,
+ jobjectArray init_command_line) {
InitNativeCommandLineFromJavaArray(env, init_command_line);
CommandLine* command_line = CommandLine::ForCurrentProcess();