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

Side by Side Diff: base/android/jni_onload_delegate.h

Issue 864563002: Separate JNI registration with initialization (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments and sync Created 5 years, 10 months 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
« no previous file with comments | « base/android/base_jni_onload.cc ('k') | base/base.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef BASE_ANDROID_JNI_ONLOAD_DELEGATE_H_
6 #define BASE_ANDROID_JNI_ONLOAD_DELEGATE_H_
7
8 #include <jni.h>
9
10 #include "base/base_export.h"
11
12 namespace base {
13 namespace android {
14
15 // This delegate class is used to implement component specific JNI registration
16 // and initialization. All methods are called in JNI_OnLoad().
17 //
18 // Both RegisterJNI() and Init() methods are called if the shared library
19 // is loaded by crazy linker that can't find JNI methods without JNI
20 // registration, otherwise, only Init() is invoked where dynamic lookup is
21 // used to find the JNI methods.
22 //
23 // It is important to make sure the JNI registration code is only in
24 // RegisterJNI(), so it could be stripped out when JNI registration isn't
25 // needed.
26 class BASE_EXPORT JNIOnLoadDelegate {
27 public:
28 virtual ~JNIOnLoadDelegate() {}
29
30 // Returns whether the JNI registration succeeded.
31 virtual bool RegisterJNI(JNIEnv* env) = 0;
32
33 // Returns whether the initialization succeeded. This method is called after
34 // RegisterJNI(), all JNI methods shall ready to be used.
35 virtual bool Init() = 0;
36 };
37
38 } // namespace android
39 } // namespace base
40
41 #endif // BASE_ANDROID_JNI_ONLOAD_DELEGATE_H_
OLDNEW
« no previous file with comments | « base/android/base_jni_onload.cc ('k') | base/base.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698