summaryrefslogtreecommitdiffstats
path: root/base/android/jni_utils.h
diff options
context:
space:
mode:
authormkosiba@chromium.org <mkosiba@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-20 11:19:36 +0000
committermkosiba@chromium.org <mkosiba@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-20 11:20:53 +0000
commit1b58f8f7e2e49846838eb893360535c642755ede (patch)
treebb360bfba0158767c52af8ebebb48f1d06ada96f /base/android/jni_utils.h
parent40cae85091de0fe2fde8b8a1cce68c4d4e8f9d41 (diff)
downloadchromium_src-1b58f8f7e2e49846838eb893360535c642755ede.zip
chromium_src-1b58f8f7e2e49846838eb893360535c642755ede.tar.gz
chromium_src-1b58f8f7e2e49846838eb893360535c642755ede.tar.bz2
Make class lookup lazy in jni_generator when using lazy method lookup.
This removes the eager class registration from RegisterNatives when possible. BUG=402003 TBR=sievers@chromium.org, brettw@chromium.org Review URL: https://codereview.chromium.org/472553002 Cr-Commit-Position: refs/heads/master@{#290810} git-svn-id: svn://svn.chromium.org/chrome/trunk/src@290810 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/android/jni_utils.h')
-rw-r--r--base/android/jni_utils.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/base/android/jni_utils.h b/base/android/jni_utils.h
new file mode 100644
index 0000000..b793aed
--- /dev/null
+++ b/base/android/jni_utils.h
@@ -0,0 +1,27 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef BASE_ANDROID_JNI_UTILS_H_
+#define BASE_ANDROID_JNI_UTILS_H_
+
+#include <jni.h>
+
+#include "base/android/scoped_java_ref.h"
+
+namespace base {
+
+namespace android {
+
+// Gets a ClassLoader instance capable of loading Chromium java classes.
+// This should be called either from JNI_OnLoad or from within a method called
+// via JNI from Java.
+BASE_EXPORT ScopedJavaLocalRef<jobject> GetClassLoader(JNIEnv* env);
+
+bool RegisterJNIUtils(JNIEnv* env);
+
+} // namespace android
+} // namespace base
+
+#endif // BASE_ANDROID_JNI_UTILS_H_
+