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

Unified Diff: base/android/jni_android.h

Issue 7518032: Android's paths and message loop implementation with JNI (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix dependence again. Created 9 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: base/android/jni_android.h
diff --git a/base/android/jni_android.h b/base/android/jni_android.h
new file mode 100644
index 0000000000000000000000000000000000000000..0e34724d7aee7e470b61f10251f545e8ac5f2847
--- /dev/null
+++ b/base/android/jni_android.h
@@ -0,0 +1,45 @@
+// Copyright (c) 2011 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_ANDROID_H_
+#define BASE_ANDROID_JNI_ANDROID_H_
+
+#include <jni.h>
+#include <sys/types.h>
+
+namespace base {
+namespace android {
+
+// Attach the current thread to the VM (if necessary) and return the JNIEnv*.
+JNIEnv* AttachCurrentThread();
+
+// Detach the current thread from VM if it is attached.
+void DetachFromVM();
+
+// Initializes the global JVM. It is not necessarily called before
+// InitApplicationContext().
+void InitVM(JavaVM* vm);
+
+// Initializes the global application context object. The |context| should be
+// the global reference of application context object. It is not necessarily
+// called after InitVM().
+// TODO: We might combine InitVM() and InitApplicationContext() into one method.
+void InitApplicationContext(jobject context);
+
+jobject GetApplicationContext();
+
+// Get the method ID for a method. Will clear the pending Java
M-A Ruel 2011/11/11 13:09:07 Documentation style is inconsistent; (To me) Havi
+// exception and return 0 if the method is not found.
+jmethodID GetMethodID(JNIEnv* env,
+ jclass clazz,
+ const char* const method,
M-A Ruel 2011/11/11 13:12:42 Making the pointer itself const for function param
+ const char* const jni_signature);
+
+// Returns true if an exception is pending in the provided JNIEnv*.
+// If an exception is pending, it is printed.
+bool CheckException(JNIEnv* env);
+
+} // namespace android
+} // namespace base
+#endif
« no previous file with comments | « base/DEPS ('k') | base/android/jni_android.cc » ('j') | base/android/jni_android.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698