Chromium Code Reviews| 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 <string.h> | |
|
joth
2013/11/18 19:45:23
nit - remove
aberent
2013/11/25 18:31:47
Done.
| |
| 6 | |
| 5 #include "content/public/app/android_library_loader_hooks.h" | 7 #include "content/public/app/android_library_loader_hooks.h" |
| 6 | 8 |
| 7 #include "base/android/base_jni_registrar.h" | 9 #include "base/android/base_jni_registrar.h" |
| 8 #include "base/android/jni_android.h" | 10 #include "base/android/jni_android.h" |
| 9 #include "base/android/jni_registrar.h" | 11 #include "base/android/jni_registrar.h" |
| 10 #include "base/android/jni_string.h" | 12 #include "base/android/jni_string.h" |
| 11 #include "base/at_exit.h" | 13 #include "base/at_exit.h" |
| 12 #include "base/base_switches.h" | 14 #include "base/base_switches.h" |
| 13 #include "base/command_line.h" | 15 #include "base/command_line.h" |
| 14 #include "base/debug/trace_event.h" | 16 #include "base/debug/trace_event.h" |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 29 #include "net/android/net_jni_registrar.h" | 31 #include "net/android/net_jni_registrar.h" |
| 30 #include "ui/base/android/ui_base_jni_registrar.h" | 32 #include "ui/base/android/ui_base_jni_registrar.h" |
| 31 #include "ui/gfx/android/gfx_jni_registrar.h" | 33 #include "ui/gfx/android/gfx_jni_registrar.h" |
| 32 #include "ui/gl/android/gl_jni_registrar.h" | 34 #include "ui/gl/android/gl_jni_registrar.h" |
| 33 #include "ui/shell_dialogs/android/shell_dialogs_jni_registrar.h" | 35 #include "ui/shell_dialogs/android/shell_dialogs_jni_registrar.h" |
| 34 | 36 |
| 35 namespace content { | 37 namespace content { |
| 36 | 38 |
| 37 namespace { | 39 namespace { |
| 38 base::AtExitManager* g_at_exit_manager = NULL; | 40 base::AtExitManager* g_at_exit_manager = NULL; |
| 41 const char* g_library_version_number = ""; | |
| 39 } | 42 } |
| 40 | 43 |
| 41 bool EnsureJniRegistered(JNIEnv* env) { | 44 bool EnsureJniRegistered(JNIEnv* env) { |
| 42 static bool g_jni_init_done = false; | 45 static bool g_jni_init_done = false; |
| 43 | 46 |
| 44 if (!g_jni_init_done) { | 47 if (!g_jni_init_done) { |
| 45 if (!base::android::RegisterJni(env)) | 48 if (!base::android::RegisterJni(env)) |
| 46 return false; | 49 return false; |
| 47 | 50 |
| 48 if (!gfx::android::RegisterJni(env)) | 51 if (!gfx::android::RegisterJni(env)) |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 139 } | 142 } |
| 140 } | 143 } |
| 141 | 144 |
| 142 bool RegisterLibraryLoaderEntryHook(JNIEnv* env) { | 145 bool RegisterLibraryLoaderEntryHook(JNIEnv* env) { |
| 143 // We need the AtExitManager to be created at the very beginning. | 146 // We need the AtExitManager to be created at the very beginning. |
| 144 g_at_exit_manager = new base::AtExitManager(); | 147 g_at_exit_manager = new base::AtExitManager(); |
| 145 | 148 |
| 146 return RegisterNativesImpl(env); | 149 return RegisterNativesImpl(env); |
| 147 } | 150 } |
| 148 | 151 |
| 152 void SetVersionNumber(const char* version_number) { | |
| 153 g_library_version_number = strdup(version_number); | |
| 154 } | |
| 155 | |
| 156 jstring GetVersionNumber(JNIEnv* env, jclass clazz) { | |
| 157 return env->NewStringUTF(g_library_version_number); | |
| 158 } | |
| 159 | |
| 149 } // namespace content | 160 } // namespace content |
| OLD | NEW |