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

Side by Side Diff: talk/app/webrtc/java/jni/peerconnection_jni.cc

Issue 1230613002: Expose the disable encryption option to JNI. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | talk/app/webrtc/java/src/org/webrtc/PeerConnectionFactory.java » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * libjingle 2 * libjingle
3 * Copyright 2013 Google Inc. 3 * Copyright 2013 Google Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met: 6 * modification, are permitted provided that the following conditions are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright notice, 8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer. 9 * this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice, 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
(...skipping 1156 matching lines...) Expand 10 before | Expand all | Expand 10 after
1167 1167
1168 JOW(void, PeerConnectionFactory_nativeSetOptions)( 1168 JOW(void, PeerConnectionFactory_nativeSetOptions)(
1169 JNIEnv* jni, jclass, jlong native_factory, jobject options) { 1169 JNIEnv* jni, jclass, jlong native_factory, jobject options) {
1170 rtc::scoped_refptr<PeerConnectionFactoryInterface> factory( 1170 rtc::scoped_refptr<PeerConnectionFactoryInterface> factory(
1171 factoryFromJava(native_factory)); 1171 factoryFromJava(native_factory));
1172 jclass options_class = jni->GetObjectClass(options); 1172 jclass options_class = jni->GetObjectClass(options);
1173 jfieldID network_ignore_mask_field = 1173 jfieldID network_ignore_mask_field =
1174 jni->GetFieldID(options_class, "networkIgnoreMask", "I"); 1174 jni->GetFieldID(options_class, "networkIgnoreMask", "I");
1175 int network_ignore_mask = 1175 int network_ignore_mask =
1176 jni->GetIntField(options, network_ignore_mask_field); 1176 jni->GetIntField(options, network_ignore_mask_field);
1177
1178 jfieldID disable_encryption_field =
1179 jni->GetFieldID(options_class, "disableEncryption", "Z");
1180 bool disable_encryption =
1181 jni->GetBooleanField(options, disable_encryption_field);
1182
1177 PeerConnectionFactoryInterface::Options options_to_set; 1183 PeerConnectionFactoryInterface::Options options_to_set;
1178 1184
1179 // This doesn't necessarily match the c++ version of this struct; feel free 1185 // This doesn't necessarily match the c++ version of this struct; feel free
1180 // to add more parameters as necessary. 1186 // to add more parameters as necessary.
1181 options_to_set.network_ignore_mask = network_ignore_mask; 1187 options_to_set.network_ignore_mask = network_ignore_mask;
1188 options_to_set.disable_encryption = disable_encryption;
1182 factory->SetOptions(options_to_set); 1189 factory->SetOptions(options_to_set);
1183 } 1190 }
1184 1191
1185 static std::string 1192 static std::string
1186 GetJavaEnumName(JNIEnv* jni, const std::string& className, jobject j_enum) { 1193 GetJavaEnumName(JNIEnv* jni, const std::string& className, jobject j_enum) {
1187 jclass enumClass = FindClass(jni, className.c_str()); 1194 jclass enumClass = FindClass(jni, className.c_str());
1188 jmethodID nameMethod = 1195 jmethodID nameMethod =
1189 GetMethodID(jni, enumClass, "name", "()Ljava/lang/String;"); 1196 GetMethodID(jni, enumClass, "name", "()Ljava/lang/String;");
1190 jstring name = 1197 jstring name =
1191 reinterpret_cast<jstring>(jni->CallObjectMethod(j_enum, nameMethod)); 1198 reinterpret_cast<jstring>(jni->CallObjectMethod(j_enum, nameMethod));
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after
1693 } 1700 }
1694 1701
1695 JOW(void, VideoTrack_nativeRemoveRenderer)( 1702 JOW(void, VideoTrack_nativeRemoveRenderer)(
1696 JNIEnv* jni, jclass, 1703 JNIEnv* jni, jclass,
1697 jlong j_video_track_pointer, jlong j_renderer_pointer) { 1704 jlong j_video_track_pointer, jlong j_renderer_pointer) {
1698 reinterpret_cast<VideoTrackInterface*>(j_video_track_pointer)->RemoveRenderer( 1705 reinterpret_cast<VideoTrackInterface*>(j_video_track_pointer)->RemoveRenderer(
1699 reinterpret_cast<VideoRendererInterface*>(j_renderer_pointer)); 1706 reinterpret_cast<VideoRendererInterface*>(j_renderer_pointer));
1700 } 1707 }
1701 1708
1702 } // namespace webrtc_jni 1709 } // namespace webrtc_jni
OLDNEW
« no previous file with comments | « no previous file | talk/app/webrtc/java/src/org/webrtc/PeerConnectionFactory.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698