Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(193)

Side by Side Diff: content/app/android/library_loader_hooks.cc

Issue 59533009: Check library version and handle library load errors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Answer review comments Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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>
Yaron 2013/11/16 00:10:26 Nit: should go after the header include for this f
Yaron 2013/11/18 19:07:59 bump
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
29 #include "net/android/net_jni_registrar.h" 31 #include "net/android/net_jni_registrar.h"
30 #include "ui/base/android/ui_jni_registrar.h" 32 #include "ui/base/android/ui_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 = "";
Yaron 2013/11/16 00:10:26 nit: unnecessary space
aberent 2013/11/18 15:11:37 Done.
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698