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

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

Issue 1823503002: Reland Use CopyOnWriteBuffer instead of Buffer to avoid unnecessary copies. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: 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
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 875 matching lines...) Expand 10 before | Expand all | Expand 10 after
886 } 886 }
887 887
888 JOW(void, DataChannel_close)(JNIEnv* jni, jobject j_dc) { 888 JOW(void, DataChannel_close)(JNIEnv* jni, jobject j_dc) {
889 ExtractNativeDC(jni, j_dc)->Close(); 889 ExtractNativeDC(jni, j_dc)->Close();
890 } 890 }
891 891
892 JOW(jboolean, DataChannel_sendNative)(JNIEnv* jni, jobject j_dc, 892 JOW(jboolean, DataChannel_sendNative)(JNIEnv* jni, jobject j_dc,
893 jbyteArray data, jboolean binary) { 893 jbyteArray data, jboolean binary) {
894 jbyte* bytes = jni->GetByteArrayElements(data, NULL); 894 jbyte* bytes = jni->GetByteArrayElements(data, NULL);
895 bool ret = ExtractNativeDC(jni, j_dc)->Send(DataBuffer( 895 bool ret = ExtractNativeDC(jni, j_dc)->Send(DataBuffer(
896 rtc::Buffer(bytes, jni->GetArrayLength(data)), 896 rtc::CopyOnWriteBuffer(bytes, jni->GetArrayLength(data)),
897 binary)); 897 binary));
898 jni->ReleaseByteArrayElements(data, bytes, JNI_ABORT); 898 jni->ReleaseByteArrayElements(data, bytes, JNI_ABORT);
899 return ret; 899 return ret;
900 } 900 }
901 901
902 JOW(void, DataChannel_dispose)(JNIEnv* jni, jobject j_dc) { 902 JOW(void, DataChannel_dispose)(JNIEnv* jni, jobject j_dc) {
903 CHECK_RELEASE(ExtractNativeDC(jni, j_dc)); 903 CHECK_RELEASE(ExtractNativeDC(jni, j_dc));
904 } 904 }
905 905
906 JOW(void, Logging_nativeEnableTracing)( 906 JOW(void, Logging_nativeEnableTracing)(
(...skipping 1197 matching lines...) Expand 10 before | Expand all | Expand 10 after
2104 return JavaStringFromStdString( 2104 return JavaStringFromStdString(
2105 jni, 2105 jni,
2106 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->id()); 2106 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->id());
2107 } 2107 }
2108 2108
2109 JOW(void, RtpReceiver_free)(JNIEnv* jni, jclass, jlong j_rtp_receiver_pointer) { 2109 JOW(void, RtpReceiver_free)(JNIEnv* jni, jclass, jlong j_rtp_receiver_pointer) {
2110 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->Release(); 2110 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->Release();
2111 } 2111 }
2112 2112
2113 } // namespace webrtc_jni 2113 } // namespace webrtc_jni
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698