OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/public/app/android_library_loader_hooks.h" | 5 #include "content/public/app/android_library_loader_hooks.h" |
6 | 6 |
7 #include "base/android/base_jni_registrar.h" | 7 #include "base/android/base_jni_registrar.h" |
8 #include "base/android/jni_registrar.h" | 8 #include "base/android/jni_registrar.h" |
9 #include "base/android/jni_android.h" | 9 #include "base/android/jni_android.h" |
10 #include "base/android/jni_string.h" | 10 #include "base/android/jni_string.h" |
11 #include "base/at_exit.h" | 11 #include "base/at_exit.h" |
12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
13 #include "base/debug/trace_event.h" | 13 #include "base/debug/trace_event.h" |
14 #include "base/file_path.h" | 14 #include "base/file_path.h" |
15 #include "base/file_util.h" | 15 #include "base/file_util.h" |
16 #include "base/logging.h" | 16 #include "base/logging.h" |
17 #include "base/string_tokenizer.h" | 17 #include "base/string_tokenizer.h" |
18 #include "base/string_util.h" | 18 #include "base/string_util.h" |
19 #include "base/tracked_objects.h" | 19 #include "base/tracked_objects.h" |
20 #include "content/app/android/content_jni_registrar.h" | 20 #include "content/app/android/content_jni_registrar.h" |
21 #include "content/browser/android/command_line.h" | 21 #include "content/common/android/command_line.h" |
22 #include "content/public/common/content_switches.h" | 22 #include "content/public/common/content_switches.h" |
23 #include "media/base/android/media_jni_registrar.h" | 23 #include "media/base/android/media_jni_registrar.h" |
24 #include "net/android/net_jni_registrar.h" | 24 #include "net/android/net_jni_registrar.h" |
25 | 25 |
26 namespace { | 26 namespace { |
27 base::AtExitManager* g_at_exit_manager = NULL; | 27 base::AtExitManager* g_at_exit_manager = NULL; |
28 } | 28 } |
29 | 29 |
30 jboolean LibraryLoaderEntryHook(JNIEnv* env, jclass clazz, | 30 jboolean LibraryLoaderEntryHook(JNIEnv* env, jclass clazz, |
31 jobjectArray init_command_line) { | 31 jobjectArray init_command_line) { |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
82 } | 82 } |
83 | 83 |
84 bool RegisterLibraryLoaderEntryHook(JNIEnv* env) { | 84 bool RegisterLibraryLoaderEntryHook(JNIEnv* env) { |
85 // TODO(bulach): use the jni generator once we move jni_helper methods here. | 85 // TODO(bulach): use the jni generator once we move jni_helper methods here. |
86 const JNINativeMethod kMethods[] = { | 86 const JNINativeMethod kMethods[] = { |
87 { "nativeLibraryLoadedOnMainThread", "([Ljava/lang/String;)Z", | 87 { "nativeLibraryLoadedOnMainThread", "([Ljava/lang/String;)Z", |
88 reinterpret_cast<void*>(LibraryLoaderEntryHook) }, | 88 reinterpret_cast<void*>(LibraryLoaderEntryHook) }, |
89 }; | 89 }; |
90 const int kMethodsSize = arraysize(kMethods); | 90 const int kMethodsSize = arraysize(kMethods); |
91 const char kLibraryLoaderPath[] = | 91 const char kLibraryLoaderPath[] = |
92 "org/chromium/content/browser/LibraryLoader"; | 92 "org/chromium/content/app/LibraryLoader"; |
Yaron
2012/06/15 17:40:35
If you rebase this function is gone (replaced with
no sievers
2012/06/15 20:34:41
Done.
| |
93 base::android::ScopedJavaLocalRef<jclass> clazz = | 93 base::android::ScopedJavaLocalRef<jclass> clazz = |
94 base::android::GetClass(env, kLibraryLoaderPath); | 94 base::android::GetClass(env, kLibraryLoaderPath); |
95 | 95 |
96 if (env->RegisterNatives(clazz.obj(), | 96 if (env->RegisterNatives(clazz.obj(), |
97 kMethods, | 97 kMethods, |
98 kMethodsSize) < 0) { | 98 kMethodsSize) < 0) { |
99 return false; | 99 return false; |
100 } | 100 } |
101 return true; | 101 return true; |
102 } | 102 } |
103 | 103 |
104 } // namespace content | 104 } // namespace content |
OLD | NEW |