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

Unified Diff: webrtc/api/datachannel_unittest.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 side-by-side diff with in-line comments
Download patch
Index: webrtc/api/datachannel_unittest.cc
diff --git a/webrtc/api/datachannel_unittest.cc b/webrtc/api/datachannel_unittest.cc
index 880c2aa8406b3535d720433d7f121974f9380898..5958ec02f855eebc7eef3e9636ce632b123152d3 100644
--- a/webrtc/api/datachannel_unittest.cc
+++ b/webrtc/api/datachannel_unittest.cc
@@ -246,7 +246,7 @@ TEST_F(SctpDataChannelTest, SendUnorderedAfterReceivesOpenAck) {
cricket::ReceiveDataParams params;
params.ssrc = init.id;
params.type = cricket::DMT_CONTROL;
- rtc::Buffer payload;
+ rtc::CopyOnWriteBuffer payload;
webrtc::WriteDataChannelOpenAckMessage(&payload);
dc->OnDataReceived(NULL, params, payload);
@@ -404,7 +404,7 @@ TEST_F(SctpDataChannelTest, OpenAckRoleInitialization) {
TEST_F(SctpDataChannelTest, ClosedWhenSendBufferFull) {
SetChannelReady();
- rtc::Buffer buffer(1024);
+ rtc::CopyOnWriteBuffer buffer(1024);
memset(buffer.data(), 0, buffer.size());
webrtc::DataBuffer packet(buffer, true);
@@ -457,7 +457,7 @@ TEST_F(SctpDataChannelTest, RemotePeerRequestClose) {
// Tests that the DataChannel is closed if the received buffer is full.
TEST_F(SctpDataChannelTest, ClosedWhenReceivedBufferFull) {
SetChannelReady();
- rtc::Buffer buffer(1024);
+ rtc::CopyOnWriteBuffer buffer(1024);
memset(buffer.data(), 0, buffer.size());
cricket::ReceiveDataParams params;

Powered by Google App Engine
This is Rietveld 408576698