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

Side by Side Diff: webrtc/pc/channel.cc

Issue 1783263002: Replace scoped_ptr with unique_ptr in webrtc/pc/ (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
« no previous file with comments | « webrtc/pc/channel.h ('k') | webrtc/pc/channel_unittest.cc » ('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 2004 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2004 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 11 matching lines...) Expand all
22 #include "webrtc/base/trace_event.h" 22 #include "webrtc/base/trace_event.h"
23 #include "webrtc/media/base/mediaconstants.h" 23 #include "webrtc/media/base/mediaconstants.h"
24 #include "webrtc/media/base/rtputils.h" 24 #include "webrtc/media/base/rtputils.h"
25 #include "webrtc/p2p/base/transportchannel.h" 25 #include "webrtc/p2p/base/transportchannel.h"
26 #include "webrtc/pc/channelmanager.h" 26 #include "webrtc/pc/channelmanager.h"
27 27
28 namespace cricket { 28 namespace cricket {
29 using rtc::Bind; 29 using rtc::Bind;
30 30
31 namespace { 31 namespace {
32 // See comment below for why we need to use a pointer to a scoped_ptr. 32 // See comment below for why we need to use a pointer to a unique_ptr.
33 bool SetRawAudioSink_w(VoiceMediaChannel* channel, 33 bool SetRawAudioSink_w(VoiceMediaChannel* channel,
34 uint32_t ssrc, 34 uint32_t ssrc,
35 rtc::scoped_ptr<webrtc::AudioSinkInterface>* sink) { 35 std::unique_ptr<webrtc::AudioSinkInterface>* sink) {
36 channel->SetRawAudioSink(ssrc, rtc::ScopedToUnique(std::move(*sink))); 36 channel->SetRawAudioSink(ssrc, std::move(*sink));
37 return true; 37 return true;
38 } 38 }
39 } // namespace 39 } // namespace
40 40
41 enum { 41 enum {
42 MSG_EARLYMEDIATIMEOUT = 1, 42 MSG_EARLYMEDIATIMEOUT = 1,
43 MSG_RTPPACKET, 43 MSG_RTPPACKET,
44 MSG_RTCPPACKET, 44 MSG_RTCPPACKET,
45 MSG_CHANNEL_ERROR, 45 MSG_CHANNEL_ERROR,
46 MSG_READYTOSENDDATA, 46 MSG_READYTOSENDDATA,
(...skipping 1323 matching lines...) Expand 10 before | Expand all | Expand 10 after
1370 ssrc, event_code, duration)); 1370 ssrc, event_code, duration));
1371 } 1371 }
1372 1372
1373 bool VoiceChannel::SetOutputVolume(uint32_t ssrc, double volume) { 1373 bool VoiceChannel::SetOutputVolume(uint32_t ssrc, double volume) {
1374 return InvokeOnWorker(Bind(&VoiceMediaChannel::SetOutputVolume, 1374 return InvokeOnWorker(Bind(&VoiceMediaChannel::SetOutputVolume,
1375 media_channel(), ssrc, volume)); 1375 media_channel(), ssrc, volume));
1376 } 1376 }
1377 1377
1378 void VoiceChannel::SetRawAudioSink( 1378 void VoiceChannel::SetRawAudioSink(
1379 uint32_t ssrc, 1379 uint32_t ssrc,
1380 rtc::scoped_ptr<webrtc::AudioSinkInterface> sink) { 1380 std::unique_ptr<webrtc::AudioSinkInterface> sink) {
1381 // We need to work around Bind's lack of support for scoped_ptr and ownership 1381 // We need to work around Bind's lack of support for unique_ptr and ownership
1382 // passing. So we invoke to our own little routine that gets a pointer to 1382 // passing. So we invoke to our own little routine that gets a pointer to
1383 // our local variable. This is OK since we're synchronously invoking. 1383 // our local variable. This is OK since we're synchronously invoking.
1384 InvokeOnWorker(Bind(&SetRawAudioSink_w, media_channel(), ssrc, &sink)); 1384 InvokeOnWorker(Bind(&SetRawAudioSink_w, media_channel(), ssrc, &sink));
1385 } 1385 }
1386 1386
1387 bool VoiceChannel::GetStats(VoiceMediaInfo* stats) { 1387 bool VoiceChannel::GetStats(VoiceMediaInfo* stats) {
1388 return InvokeOnWorker(Bind(&VoiceMediaChannel::GetStats, 1388 return InvokeOnWorker(Bind(&VoiceMediaChannel::GetStats,
1389 media_channel(), stats)); 1389 media_channel(), stats));
1390 } 1390 }
1391 1391
(...skipping 746 matching lines...) Expand 10 before | Expand all | Expand 10 after
2138 return (data_channel_type_ == DCT_RTP) && BaseChannel::ShouldSetupDtlsSrtp(); 2138 return (data_channel_type_ == DCT_RTP) && BaseChannel::ShouldSetupDtlsSrtp();
2139 } 2139 }
2140 2140
2141 void DataChannel::OnStreamClosedRemotely(uint32_t sid) { 2141 void DataChannel::OnStreamClosedRemotely(uint32_t sid) {
2142 rtc::TypedMessageData<uint32_t>* message = 2142 rtc::TypedMessageData<uint32_t>* message =
2143 new rtc::TypedMessageData<uint32_t>(sid); 2143 new rtc::TypedMessageData<uint32_t>(sid);
2144 signaling_thread()->Post(this, MSG_STREAMCLOSEDREMOTELY, message); 2144 signaling_thread()->Post(this, MSG_STREAMCLOSEDREMOTELY, message);
2145 } 2145 }
2146 2146
2147 } // namespace cricket 2147 } // namespace cricket
OLDNEW
« no previous file with comments | « webrtc/pc/channel.h ('k') | webrtc/pc/channel_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698