| 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" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "content/app/android/app_jni_registrar.h" | 21 #include "content/app/android/app_jni_registrar.h" |
| 22 #include "content/browser/android/browser_jni_registrar.h" | 22 #include "content/browser/android/browser_jni_registrar.h" |
| 23 #include "content/common/android/common_jni_registrar.h" | 23 #include "content/common/android/common_jni_registrar.h" |
| 24 #include "content/common/android/command_line.h" | 24 #include "content/common/android/command_line.h" |
| 25 #include "content/public/common/content_switches.h" | 25 #include "content/public/common/content_switches.h" |
| 26 #include "content/public/common/result_codes.h" | 26 #include "content/public/common/result_codes.h" |
| 27 #include "media/base/android/media_jni_registrar.h" | 27 #include "media/base/android/media_jni_registrar.h" |
| 28 #include "net/android/net_jni_registrar.h" | 28 #include "net/android/net_jni_registrar.h" |
| 29 #include "ui/android/ui_jni_registrar.h" | 29 #include "ui/android/ui_jni_registrar.h" |
| 30 #include "jni/LibraryLoader_jni.h" | 30 #include "jni/LibraryLoader_jni.h" |
| 31 #include "ui/gfx/android/gfx_jni_registrar.h" | |
| 32 | 31 |
| 33 namespace { | 32 namespace { |
| 34 base::AtExitManager* g_at_exit_manager = NULL; | 33 base::AtExitManager* g_at_exit_manager = NULL; |
| 35 } | 34 } |
| 36 | 35 |
| 37 namespace content { | 36 namespace content { |
| 38 | 37 |
| 39 static jint LibraryLoadedOnMainThread(JNIEnv* env, jclass clazz, | 38 static jint LibraryLoadedOnMainThread(JNIEnv* env, jclass clazz, |
| 40 jobjectArray init_command_line) { | 39 jobjectArray init_command_line) { |
| 41 InitNativeCommandLineFromJavaArray(env, init_command_line); | 40 InitNativeCommandLineFromJavaArray(env, init_command_line); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 69 false); // Tick count | 68 false); // Tick count |
| 70 VLOG(0) << "Chromium logging enabled: level = " << logging::GetMinLogLevel() | 69 VLOG(0) << "Chromium logging enabled: level = " << logging::GetMinLogLevel() |
| 71 << ", default verbosity = " << logging::GetVlogVerbosity(); | 70 << ", default verbosity = " << logging::GetVlogVerbosity(); |
| 72 | 71 |
| 73 if (!base::android::RegisterJni(env)) | 72 if (!base::android::RegisterJni(env)) |
| 74 return RESULT_CODE_FAILED_TO_REGISTER_JNI; | 73 return RESULT_CODE_FAILED_TO_REGISTER_JNI; |
| 75 | 74 |
| 76 if (!net::android::RegisterJni(env)) | 75 if (!net::android::RegisterJni(env)) |
| 77 return RESULT_CODE_FAILED_TO_REGISTER_JNI; | 76 return RESULT_CODE_FAILED_TO_REGISTER_JNI; |
| 78 | 77 |
| 79 if (!ui::RegisterJni(env)) | 78 if (!ui::android::RegisterJni(env)) |
| 80 return RESULT_CODE_FAILED_TO_REGISTER_JNI; | 79 return RESULT_CODE_FAILED_TO_REGISTER_JNI; |
| 81 | 80 |
| 82 if (!content::android::RegisterCommonJni(env)) | 81 if (!content::android::RegisterCommonJni(env)) |
| 83 return RESULT_CODE_FAILED_TO_REGISTER_JNI; | 82 return RESULT_CODE_FAILED_TO_REGISTER_JNI; |
| 84 | 83 |
| 85 if (!content::android::RegisterBrowserJni(env)) | 84 if (!content::android::RegisterBrowserJni(env)) |
| 86 return RESULT_CODE_FAILED_TO_REGISTER_JNI; | 85 return RESULT_CODE_FAILED_TO_REGISTER_JNI; |
| 87 | 86 |
| 88 if (!content::android::RegisterAppJni(env)) | 87 if (!content::android::RegisterAppJni(env)) |
| 89 return RESULT_CODE_FAILED_TO_REGISTER_JNI; | 88 return RESULT_CODE_FAILED_TO_REGISTER_JNI; |
| 90 | 89 |
| 91 if (!media::RegisterJni(env)) | 90 if (!media::RegisterJni(env)) |
| 92 return RESULT_CODE_FAILED_TO_REGISTER_JNI; | 91 return RESULT_CODE_FAILED_TO_REGISTER_JNI; |
| 93 | 92 |
| 94 if (!gfx::RegisterJni(env)) | |
| 95 return RESULT_CODE_FAILED_TO_REGISTER_JNI; | |
| 96 | |
| 97 return 0; | 93 return 0; |
| 98 } | 94 } |
| 99 | 95 |
| 100 void LibraryLoaderExitHook() { | 96 void LibraryLoaderExitHook() { |
| 101 if (g_at_exit_manager) { | 97 if (g_at_exit_manager) { |
| 102 delete g_at_exit_manager; | 98 delete g_at_exit_manager; |
| 103 g_at_exit_manager = NULL; | 99 g_at_exit_manager = NULL; |
| 104 } | 100 } |
| 105 } | 101 } |
| 106 | 102 |
| 107 bool RegisterLibraryLoaderEntryHook(JNIEnv* env) { | 103 bool RegisterLibraryLoaderEntryHook(JNIEnv* env) { |
| 108 // We need the AtExitManager to be created at the very beginning. | 104 // We need the AtExitManager to be created at the very beginning. |
| 109 g_at_exit_manager = new base::AtExitManager(); | 105 g_at_exit_manager = new base::AtExitManager(); |
| 110 | 106 |
| 111 return RegisterNativesImpl(env); | 107 return RegisterNativesImpl(env); |
| 112 } | 108 } |
| 113 | 109 |
| 114 } // namespace content | 110 } // namespace content |
| OLD | NEW |