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

Unified Diff: webrtc/media/engine/webrtcvoiceengine_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/media/engine/webrtcvoiceengine_unittest.cc
diff --git a/webrtc/media/engine/webrtcvoiceengine_unittest.cc b/webrtc/media/engine/webrtcvoiceengine_unittest.cc
index 4fd5918efd1b90b072a819b815e4e354926f9f94..b538c6ff752f2916e05a3d869279be57eb7c106e 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 {
@@ -3081,14 +3081,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 =

Powered by Google App Engine
This is Rietveld 408576698