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 "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_android.h" | 8 #include "base/android/jni_android.h" |
| 9 #include "base/android/jni_registrar.h" | 9 #include "base/android/jni_registrar.h" |
| 10 #include "base/android/jni_string.h" | 10 #include "base/android/jni_string.h" |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 29 #include "net/android/net_jni_registrar.h" | 29 #include "net/android/net_jni_registrar.h" |
| 30 #include "ui/base/android/ui_jni_registrar.h" | 30 #include "ui/base/android/ui_jni_registrar.h" |
| 31 #include "ui/gfx/android/gfx_jni_registrar.h" | 31 #include "ui/gfx/android/gfx_jni_registrar.h" |
| 32 #include "ui/gl/android/gl_jni_registrar.h" | 32 #include "ui/gl/android/gl_jni_registrar.h" |
| 33 #include "ui/shell_dialogs/android/shell_dialogs_jni_registrar.h" | 33 #include "ui/shell_dialogs/android/shell_dialogs_jni_registrar.h" |
| 34 | 34 |
| 35 namespace content { | 35 namespace content { |
| 36 | 36 |
| 37 namespace { | 37 namespace { |
| 38 base::AtExitManager* g_at_exit_manager = NULL; | 38 base::AtExitManager* g_at_exit_manager = NULL; |
| 39 std::string library_version_name = ""; | |
|
joth
2013/11/11 20:28:56
g_library_version_name...
joth
2013/11/11 20:28:56
this is a global C++ object, not allowed by style
aberent
2013/11/13 20:20:52
I have changed it to a const char *, but I am sett
| |
| 39 } | 40 } |
| 40 | 41 |
| 41 bool EnsureJniRegistered(JNIEnv* env) { | 42 bool EnsureJniRegistered(JNIEnv* env) { |
| 42 static bool g_jni_init_done = false; | 43 static bool g_jni_init_done = false; |
| 43 | 44 |
| 44 if (!g_jni_init_done) { | 45 if (!g_jni_init_done) { |
| 45 if (!base::android::RegisterJni(env)) | 46 if (!base::android::RegisterJni(env)) |
| 46 return false; | 47 return false; |
| 47 | 48 |
| 48 if (!gfx::android::RegisterJni(env)) | 49 if (!gfx::android::RegisterJni(env)) |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 139 } | 140 } |
| 140 } | 141 } |
| 141 | 142 |
| 142 bool RegisterLibraryLoaderEntryHook(JNIEnv* env) { | 143 bool RegisterLibraryLoaderEntryHook(JNIEnv* env) { |
| 143 // We need the AtExitManager to be created at the very beginning. | 144 // We need the AtExitManager to be created at the very beginning. |
| 144 g_at_exit_manager = new base::AtExitManager(); | 145 g_at_exit_manager = new base::AtExitManager(); |
| 145 | 146 |
| 146 return RegisterNativesImpl(env); | 147 return RegisterNativesImpl(env); |
| 147 } | 148 } |
| 148 | 149 |
| 150 void SetVersionName(const std::string & version_name) { | |
|
joth
2013/11/11 20:28:56
not space before &
(and in header)
aberent
2013/11/13 20:20:52
Done.
| |
| 151 library_version_name = version_name; | |
| 152 } | |
| 153 | |
| 154 jstring GetVersionName(JNIEnv* env, jclass clazz) { | |
| 155 return env->NewStringUTF(library_version_name.c_str()); | |
| 156 } | |
| 157 | |
| 149 } // namespace content | 158 } // namespace content |
| OLD | NEW |