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

Side by Side Diff: base/android/jni_generator/jni_generator_helper.h

Issue 2501193003: Selectively perform JNI registration in render processes on Android. (Closed)
Patch Set: Address Ted C comments Created 3 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
OLDNEW
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_JNI_GENERATOR_JNI_GENERATOR_HELPER_H_ 5 #ifndef BASE_ANDROID_JNI_GENERATOR_JNI_GENERATOR_HELPER_H_
6 #define BASE_ANDROID_JNI_GENERATOR_JNI_GENERATOR_HELPER_H_ 6 #define BASE_ANDROID_JNI_GENERATOR_JNI_GENERATOR_HELPER_H_
7 7
8 #include <jni.h> 8 #include <jni.h>
9 9
10 #include "base/android/jni_android.h" 10 #include "base/android/jni_android.h"
(...skipping 24 matching lines...) Expand all
35 inline void HandleRegistrationError(JNIEnv* env, 35 inline void HandleRegistrationError(JNIEnv* env,
36 jclass clazz, 36 jclass clazz,
37 const char* filename) { 37 const char* filename) {
38 LOG(ERROR) << "RegisterNatives failed in " << filename; 38 LOG(ERROR) << "RegisterNatives failed in " << filename;
39 } 39 }
40 40
41 inline void CheckException(JNIEnv* env) { 41 inline void CheckException(JNIEnv* env) {
42 base::android::CheckException(env); 42 base::android::CheckException(env);
43 } 43 }
44 44
45 inline bool ShouldSkipJniRegistration(bool is_maindex_class) {
46 switch (base::android::GetJniRegistrationType()) {
47 case base::android::ALL_JNI_REGISTRATION:
48 return false;
49 case base::android::NO_JNI_REGISTRATION:
50 // TODO(estevenson): Change this to a DCHECK.
51 return true;
52 case base::android::SELECTIVE_JNI_REGISTRATION:
53 return !is_maindex_class;
54 default:
55 NOTREACHED();
56 return false;
57 }
58 }
59
45 } // namespace jni_generator 60 } // namespace jni_generator
46 61
47 #endif // BASE_ANDROID_JNI_GENERATOR_JNI_GENERATOR_HELPER_H_ 62 #endif // BASE_ANDROID_JNI_GENERATOR_JNI_GENERATOR_HELPER_H_
OLDNEW
« no previous file with comments | « base/android/jni_generator/jni_generator.py ('k') | base/android/jni_generator/jni_generator_tests.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698