summaryrefslogtreecommitdiffstats
path: root/android/jni
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2010-11-19 12:37:23 +0000
committerBen Murdoch <benm@google.com>2010-11-19 16:52:35 +0000
commit76a88e2c298122bfdfc498a5df61aab702184639 (patch)
tree755358c235b4d839842b272e1462a26e68d8c159 /android/jni
parent34b5a0345856ab7743b6daa5a1fea1dcbe0c3394 (diff)
downloadexternal_chromium-76a88e2c298122bfdfc498a5df61aab702184639.zip
external_chromium-76a88e2c298122bfdfc498a5df61aab702184639.tar.gz
external_chromium-76a88e2c298122bfdfc498a5df61aab702184639.tar.bz2
Merge Chromium at r65505: OpenSSL support
Import OpenSSL support and tweak for our Chromium port (JNI functions). See https://chromereview.prom.corp.google.com/2010002/ Change-Id: Ia081dd3b1eae5ec05ebb96b66b682f039bfa1b81
Diffstat (limited to 'android/jni')
-rw-r--r--android/jni/jni_utils.cc18
-rw-r--r--android/jni/jni_utils.h6
2 files changed, 24 insertions, 0 deletions
diff --git a/android/jni/jni_utils.cc b/android/jni/jni_utils.cc
index ceb0777..91e5266 100644
--- a/android/jni/jni_utils.cc
+++ b/android/jni/jni_utils.cc
@@ -14,6 +14,7 @@
namespace JSC {
namespace Bindings {
JNIEnv* getJNIEnv();
+JavaVM* getJavaVM();
}
}
@@ -21,6 +22,7 @@ JNIEnv* getJNIEnv();
namespace android {
std::string jstringToStdString(JNIEnv* env, jstring jstr);
string16 jstringToString16(JNIEnv* env, jstring jstr);
+bool checkException(JNIEnv*);
}
namespace android {
@@ -38,5 +40,21 @@ string16 JstringToString16(JNIEnv* env, jstring jstr)
return jstringToString16(env, jstr);
}
+bool CheckException(JNIEnv* env)
+{
+ return checkException(env);
+}
+
+jstring ConvertUTF8ToJavaString(JNIEnv* env, std::string str)
+{
+ return env->NewStringUTF(str.c_str());
+}
+
+void DetachFromVM()
+{
+ JavaVM* vm = JSC::Bindings::getJavaVM();
+ vm->DetachCurrentThread();
+}
+
} // namespace android
diff --git a/android/jni/jni_utils.h b/android/jni/jni_utils.h
index f45de7a..60d7cde 100644
--- a/android/jni/jni_utils.h
+++ b/android/jni/jni_utils.h
@@ -17,5 +17,11 @@ std::string JstringToStdString(JNIEnv* env, jstring jstr);
string16 JstringToString16(JNIEnv* env, jstring jstr);
+jstring ConvertUTF8ToJavaString(JNIEnv* env, std::string str);
+
+bool CheckException(JNIEnv*);
+
+void DetachFromVM();
+
} // namespace android