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

Unified Diff: webrtc/media/engine/webrtcvoiceengine_unittest.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/media/engine/webrtcvoiceengine.cc ('k') | webrtc/media/sctp/sctpdataengine.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/media/engine/webrtcvoiceengine_unittest.cc
diff --git a/webrtc/media/engine/webrtcvoiceengine_unittest.cc b/webrtc/media/engine/webrtcvoiceengine_unittest.cc
index 1fe9fc1ab6001f3bbbd1ff16b2b1544c1a4e9b7c..aab140c6f47ad964ac09ac17e1ccc6218a553253 100644
--- a/webrtc/media/engine/webrtcvoiceengine_unittest.cc
+++ b/webrtc/media/engine/webrtcvoiceengine_unittest.cc
@@ -113,7 +113,7 @@ class WebRtcVoiceEngineTestFake : public testing::Test {
EXPECT_FALSE(call_.GetAudioSendStream(kSsrc1));
}
void DeliverPacket(const void* data, int len) {
- rtc::Buffer packet(reinterpret_cast<const uint8_t*>(data), len);
+ rtc::CopyOnWriteBuffer packet(reinterpret_cast<const uint8_t*>(data), len);
channel_->OnPacketReceived(&packet, rtc::PacketTime());
}
void TearDown() override {
@@ -3060,14 +3060,14 @@ TEST_F(WebRtcVoiceEngineTestFake, ConfiguresAudioReceiveStreamRtpExtensions) {
TEST_F(WebRtcVoiceEngineTestFake, DeliverAudioPacket_Call) {
// Test that packets are forwarded to the Call when configured accordingly.
const uint32_t kAudioSsrc = 1;
- rtc::Buffer kPcmuPacket(kPcmuFrame, sizeof(kPcmuFrame));
+ rtc::CopyOnWriteBuffer kPcmuPacket(kPcmuFrame, sizeof(kPcmuFrame));
static const unsigned char kRtcp[] = {
0x80, 0xc9, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02,
0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
- rtc::Buffer kRtcpPacket(kRtcp, sizeof(kRtcp));
+ rtc::CopyOnWriteBuffer kRtcpPacket(kRtcp, sizeof(kRtcp));
EXPECT_TRUE(SetupEngineWithSendStream());
cricket::WebRtcVoiceMediaChannel* media_channel =
« no previous file with comments | « webrtc/media/engine/webrtcvoiceengine.cc ('k') | webrtc/media/sctp/sctpdataengine.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698