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

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: Fix BrowserStartupControllerTest Created 7 years 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 "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/command_line_android.h" 8 #include "base/android/command_line_android.h"
9 #include "base/android/jni_android.h" 9 #include "base/android/jni_android.h"
10 #include "base/android/jni_registrar.h" 10 #include "base/android/jni_registrar.h"
(...skipping 18 matching lines...) Expand all
29 #include "net/android/net_jni_registrar.h" 29 #include "net/android/net_jni_registrar.h"
30 #include "ui/base/android/ui_base_jni_registrar.h" 30 #include "ui/base/android/ui_base_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 const char* g_library_version_number = "";
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
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 SetVersionNumber(const char* version_number) {
151 g_library_version_number = strdup(version_number);
152 }
153
154 jstring GetVersionNumber(JNIEnv* env, jclass clazz) {
155 return env->NewStringUTF(g_library_version_number);
156 }
157
149 } // namespace content 158 } // namespace content
OLDNEW
« no previous file with comments | « chrome/chrome_android.gypi ('k') | content/public/android/java/src/org/chromium/content/app/ChildProcessService.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698