Chromium Code Reviews| Index: talk/app/webrtc/java/jni/jni_helpers.cc |
| diff --git a/talk/app/webrtc/java/jni/jni_helpers.cc b/talk/app/webrtc/java/jni/jni_helpers.cc |
| index 3a7ff21e77257bb094c0ab0ce3b34d28e0665103..25b340ff79a9902ba2ad7e7a0eeb72db497cbee6 100644 |
| --- a/talk/app/webrtc/java/jni/jni_helpers.cc |
| +++ b/talk/app/webrtc/java/jni/jni_helpers.cc |
| @@ -27,6 +27,8 @@ |
| */ |
| #include "talk/app/webrtc/java/jni/jni_helpers.h" |
|
AlexG
2016/01/15 18:32:37
nit: extra white space?
honghaiz3
2016/01/15 19:17:56
Are you saying extra blank line?
We need a separat
|
| +#include "talk/app/webrtc/java/jni/classreferenceholder.h" |
| + |
| #include <asm/unistd.h> |
| #include <sys/prctl.h> |
| #include <sys/syscall.h> |
| @@ -256,6 +258,19 @@ jobject JavaEnumFromIndex(JNIEnv* jni, jclass state_class, |
| return ret; |
| } |
| +std::string GetJavaEnumName(JNIEnv* jni, |
| + const std::string& className, |
| + jobject j_enum) { |
| + jclass enumClass = FindClass(jni, className.c_str()); |
| + jmethodID nameMethod = |
| + GetMethodID(jni, enumClass, "name", "()Ljava/lang/String;"); |
| + jstring name = |
| + reinterpret_cast<jstring>(jni->CallObjectMethod(j_enum, nameMethod)); |
| + CHECK_EXCEPTION(jni) << "error during CallObjectMethod for " << className |
| + << ".name"; |
| + return JavaToStdString(jni, name); |
| +} |
| + |
| jobject NewGlobalRef(JNIEnv* jni, jobject o) { |
| jobject ret = jni->NewGlobalRef(o); |
| CHECK_EXCEPTION(jni) << "error during NewGlobalRef"; |