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

Unified Diff: webrtc/sdk/android/src/jni/jni_helpers.h

Issue 2992103002: Relanding: Break peerconnection_jni.cc into multiple files, in "pc" directory. (Closed)
Patch Set: Add OWNERS file. Created 3 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
« no previous file with comments | « webrtc/sdk/android/src/jni/classreferenceholder.h ('k') | webrtc/sdk/android/src/jni/jni_helpers.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/sdk/android/src/jni/jni_helpers.h
diff --git a/webrtc/sdk/android/src/jni/jni_helpers.h b/webrtc/sdk/android/src/jni/jni_helpers.h
index 19b7741fb58633f1d0d288fceb024b71c7a661ad..c18a17b5c4822d09dff6cbfb0be50d01f1bb3c60 100644
--- a/webrtc/sdk/android/src/jni/jni_helpers.h
+++ b/webrtc/sdk/android/src/jni/jni_helpers.h
@@ -34,6 +34,11 @@
#define CHECK_RELEASE(ptr) \
RTC_CHECK_EQ(0, (ptr)->Release()) << "Unexpected refcount."
+// Convenience macro defining JNI-accessible methods in the org.webrtc package.
+// Eliminates unnecessary boilerplate and line-wraps, reducing visual clutter.
+#define JOW(rettype, name) \
magjed_webrtc 2017/08/01 12:52:17 This is unrelated to your CL, but I have been plan
Taylor Brandstetter 2017/08/01 20:53:54 I'm not sure I agree; it may be more transparent,
magjed_webrtc 2017/08/02 14:15:46 So we have three different options. A concrete exa
Taylor Brandstetter 2017/08/02 21:13:49 Since this CL already probably makes more changes
+ extern "C" JNIEXPORT rettype JNICALL Java_org_webrtc_##name
+
namespace webrtc_jni {
jint InitGlobalJniVariables(JavaVM *jvm);
@@ -97,6 +102,12 @@ std::string JavaToStdString(JNIEnv* jni, const jstring& j_string);
jobject JavaEnumFromIndex(JNIEnv* jni, jclass state_class,
const std::string& state_class_name, int index);
+// Return the (singleton) Java Enum object corresponding to |index|;
+// |state_class_fragment| is something like "MediaSource$State".
+jobject JavaEnumFromIndexAndClassName(JNIEnv* jni,
+ const std::string& state_class_fragment,
+ int index);
+
// Returns the name of a Java enum.
std::string GetJavaEnumName(JNIEnv* jni,
const std::string& className,
« no previous file with comments | « webrtc/sdk/android/src/jni/classreferenceholder.h ('k') | webrtc/sdk/android/src/jni/jni_helpers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698