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

Side by Side Diff: webrtc/api/java/jni/peerconnection_jni.cc

Issue 1785713005: Use CopyOnWriteBuffer instead of Buffer to avoid unnecessary copies. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Feedback from tommi. Created 4 years, 9 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 | « webrtc/api/datachannelinterface.h ('k') | webrtc/api/objc/RTCDataChannel.mm » ('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 * Copyright 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2013 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 833 matching lines...) Expand 10 before | Expand all | Expand 10 after
844 } 844 }
845 845
846 JOW(void, DataChannel_close)(JNIEnv* jni, jobject j_dc) { 846 JOW(void, DataChannel_close)(JNIEnv* jni, jobject j_dc) {
847 ExtractNativeDC(jni, j_dc)->Close(); 847 ExtractNativeDC(jni, j_dc)->Close();
848 } 848 }
849 849
850 JOW(jboolean, DataChannel_sendNative)(JNIEnv* jni, jobject j_dc, 850 JOW(jboolean, DataChannel_sendNative)(JNIEnv* jni, jobject j_dc,
851 jbyteArray data, jboolean binary) { 851 jbyteArray data, jboolean binary) {
852 jbyte* bytes = jni->GetByteArrayElements(data, NULL); 852 jbyte* bytes = jni->GetByteArrayElements(data, NULL);
853 bool ret = ExtractNativeDC(jni, j_dc)->Send(DataBuffer( 853 bool ret = ExtractNativeDC(jni, j_dc)->Send(DataBuffer(
854 rtc::Buffer(bytes, jni->GetArrayLength(data)), 854 rtc::CopyOnWriteBuffer(bytes, jni->GetArrayLength(data)),
855 binary)); 855 binary));
856 jni->ReleaseByteArrayElements(data, bytes, JNI_ABORT); 856 jni->ReleaseByteArrayElements(data, bytes, JNI_ABORT);
857 return ret; 857 return ret;
858 } 858 }
859 859
860 JOW(void, DataChannel_dispose)(JNIEnv* jni, jobject j_dc) { 860 JOW(void, DataChannel_dispose)(JNIEnv* jni, jobject j_dc) {
861 CHECK_RELEASE(ExtractNativeDC(jni, j_dc)); 861 CHECK_RELEASE(ExtractNativeDC(jni, j_dc));
862 } 862 }
863 863
864 JOW(void, Logging_nativeEnableTracing)( 864 JOW(void, Logging_nativeEnableTracing)(
(...skipping 1173 matching lines...) Expand 10 before | Expand all | Expand 10 after
2038 return JavaStringFromStdString( 2038 return JavaStringFromStdString(
2039 jni, 2039 jni,
2040 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->id()); 2040 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->id());
2041 } 2041 }
2042 2042
2043 JOW(void, RtpReceiver_free)(JNIEnv* jni, jclass, jlong j_rtp_receiver_pointer) { 2043 JOW(void, RtpReceiver_free)(JNIEnv* jni, jclass, jlong j_rtp_receiver_pointer) {
2044 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->Release(); 2044 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->Release();
2045 } 2045 }
2046 2046
2047 } // namespace webrtc_jni 2047 } // namespace webrtc_jni
OLDNEW
« no previous file with comments | « webrtc/api/datachannelinterface.h ('k') | webrtc/api/objc/RTCDataChannel.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698