| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 BASE_ANDROID_LIBRARY_LOADER_LIBRARY_LOADER_HOOKS_H_ | 5 #ifndef BASE_ANDROID_LIBRARY_LOADER_LIBRARY_LOADER_HOOKS_H_ |
| 6 #define BASE_ANDROID_LIBRARY_LOADER_LIBRARY_LOADER_HOOKS_H_ | 6 #define BASE_ANDROID_LIBRARY_LOADER_LIBRARY_LOADER_HOOKS_H_ |
| 7 | 7 |
| 8 #include <jni.h> | 8 #include <jni.h> |
| 9 | 9 |
| 10 #include "base/base_export.h" | 10 #include "base/base_export.h" |
| 11 #include "base/callback.h" |
| 11 | 12 |
| 12 namespace base { | 13 namespace base { |
| 13 namespace android { | 14 namespace android { |
| 14 | 15 |
| 15 // The process the shared library is loaded in. | 16 // The process the shared library is loaded in. |
| 16 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.base.library_loader | 17 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.base.library_loader |
| 17 enum LibraryProcessType { | 18 enum LibraryProcessType { |
| 18 // The LibraryLoad has not been initialized. | 19 // The LibraryLoad has not been initialized. |
| 19 PROCESS_UNINITIALIZED = 0, | 20 PROCESS_UNINITIALIZED = 0, |
| 20 // Shared library is running in browser process. | 21 // Shared library is running in browser process. |
| 21 PROCESS_BROWSER = 1, | 22 PROCESS_BROWSER = 1, |
| 22 // Shared library is running in child process. | 23 // Shared library is running in child process. |
| 23 PROCESS_CHILD = 2, | 24 PROCESS_CHILD = 2, |
| 24 // Shared library is running in the app that uses webview. | 25 // Shared library is running in the app that uses webview. |
| 25 PROCESS_WEBVIEW = 3, | 26 PROCESS_WEBVIEW = 3, |
| 26 // Shared library is running in child process as part of webview. | 27 // Shared library is running in child process as part of webview. |
| 27 PROCESS_WEBVIEW_CHILD = 4, | 28 PROCESS_WEBVIEW_CHILD = 4, |
| 28 }; | 29 }; |
| 29 | 30 |
| 31 typedef bool NativeInitializationHook(); |
| 32 |
| 33 BASE_EXPORT void SetNativeInitializationHook( |
| 34 NativeInitializationHook native_initialization_hook); |
| 35 |
| 30 // Record any pending renderer histogram value as histograms. Pending values | 36 // Record any pending renderer histogram value as histograms. Pending values |
| 31 // are set by RegisterChromiumAndroidLinkerRendererHistogram and | 37 // are set by RegisterChromiumAndroidLinkerRendererHistogram and |
| 32 // RegisterLibraryPreloaderRendererHistogram. | 38 // RegisterLibraryPreloaderRendererHistogram. |
| 33 BASE_EXPORT void RecordLibraryLoaderRendererHistograms(); | 39 BASE_EXPORT void RecordLibraryLoaderRendererHistograms(); |
| 34 | 40 |
| 35 // Registers the callbacks that allows the entry point of the library to be | 41 // Registers the callbacks that allows the entry point of the library to be |
| 36 // exposed to the calling java code. This handles only registering the | 42 // exposed to the calling java code. This handles only registering the |
| 37 // the callbacks needed by the loader. Any application specific JNI bindings | 43 // the callbacks needed by the loader. Any application specific JNI bindings |
| 38 // should happen once the native library has fully loaded, either in the library | 44 // should happen once the native library has fully loaded, either in the library |
| 39 // loaded hook function or later. | 45 // loaded hook function or later. |
| (...skipping 28 matching lines...) Expand all Loading... |
| 68 BASE_EXPORT LibraryProcessType GetLibraryProcessType(JNIEnv* env); | 74 BASE_EXPORT LibraryProcessType GetLibraryProcessType(JNIEnv* env); |
| 69 | 75 |
| 70 // Initialize AtExitManager, this must be done at the begining of loading | 76 // Initialize AtExitManager, this must be done at the begining of loading |
| 71 // shared library. | 77 // shared library. |
| 72 void InitAtExitManager(); | 78 void InitAtExitManager(); |
| 73 | 79 |
| 74 } // namespace android | 80 } // namespace android |
| 75 } // namespace base | 81 } // namespace base |
| 76 | 82 |
| 77 #endif // BASE_ANDROID_LIBRARY_LOADER_LIBRARY_LOADER_HOOKS_H_ | 83 #endif // BASE_ANDROID_LIBRARY_LOADER_LIBRARY_LOADER_HOOKS_H_ |
| OLD | NEW |