jni_utils.h 832 B

12345678910111213141516171819202122232425262728
  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
  3. // found in the LICENSE file.
  4. #ifndef BASE_ANDROID_JNI_UTILS_H_
  5. #define BASE_ANDROID_JNI_UTILS_H_
  6. #include <jni.h>
  7. #include "base/android/scoped_java_ref.h"
  8. namespace base {
  9. namespace android {
  10. // Gets a ClassLoader instance capable of loading Chromium java classes.
  11. // This should be called either from JNI_OnLoad or from within a method called
  12. // via JNI from Java.
  13. BASE_EXPORT ScopedJavaLocalRef<jobject> GetClassLoader(JNIEnv* env);
  14. // Returns true if the current process permits selective JNI registration.
  15. BASE_EXPORT bool IsSelectiveJniRegistrationEnabled(JNIEnv* env);
  16. } // namespace android
  17. } // namespace base
  18. #endif // BASE_ANDROID_JNI_UTILS_H_