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 #ifndef CONTENT_PUBLIC_APP_ANDROID_LIBRARY_LOADER_HOOKS_H_ | 5 #ifndef CONTENT_PUBLIC_APP_ANDROID_LIBRARY_LOADER_HOOKS_H_ |
6 #define CONTENT_PUBLIC_APP_ANDROID_LIBRARY_LOADER_HOOKS_H_ | 6 #define CONTENT_PUBLIC_APP_ANDROID_LIBRARY_LOADER_HOOKS_H_ |
7 | 7 |
8 #include <jni.h> | 8 #include <jni.h> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "content/common/content_export.h" | 11 #include "content/common/content_export.h" |
12 | 12 |
13 namespace content { | 13 namespace content { |
14 | 14 |
15 // Registers the callbacks that allows the entry point of the library to be | |
16 // exposed to the calling java code. This handles only registering the content | |
17 // specific callbacks. Any application specific JNI bindings should happen | |
18 // once the native library has fully loaded. | |
19 CONTENT_EXPORT bool RegisterLibraryLoaderEntryHook(JNIEnv* env); | |
20 | |
21 // Register all content JNI functions now, rather than waiting for the process | 15 // Register all content JNI functions now, rather than waiting for the process |
22 // of fully loading the native library to complete. This must only be called | 16 // of fully loading the native library to complete. |
23 // during JNI_OnLoad. | |
24 CONTENT_EXPORT bool EnsureJniRegistered(JNIEnv* env); | 17 CONTENT_EXPORT bool EnsureJniRegistered(JNIEnv* env); |
25 | 18 |
26 // Pass the version name to Content. This used to check that the library version | 19 // Do the intialization of content needed immediately after the native library |
27 // matches the version expected by Java before completing JNI registration. | 20 // has loaded. |
28 // Note: argument must remain valid at least until library loading is complete. | 21 // This is designed to be used as a hook function to be passed to |
29 CONTENT_EXPORT void SetVersionNumber(const char* version_number); | 22 // base::android::SetLibraryLoadedHook |
30 | 23 CONTENT_EXPORT bool LibraryLoaded(JNIEnv* env, |
31 // Call on exit to delete the AtExitManager which OnLibraryLoadedOnUIThread | 24 jclass clazz, |
32 // created. | 25 jobjectArray init_command_line); |
33 CONTENT_EXPORT void LibraryLoaderExitHook(); | |
34 | 26 |
35 } // namespace content | 27 } // namespace content |
36 | 28 |
37 #endif // CONTENT_PUBLIC_APP_ANDROID_LIBRARY_LOADER_HOOKS_H_ | 29 #endif // CONTENT_PUBLIC_APP_ANDROID_LIBRARY_LOADER_HOOKS_H_ |
OLD | NEW |