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

Side by Side Diff: remoting/protocol/webrtc_transport.cc

Issue 2253233004: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 4 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 | « remoting/protocol/video_frame_pump_unittest.cc ('k') | remoting/signaling/server_log_entry.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 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "remoting/protocol/webrtc_transport.h" 5 #include "remoting/protocol/webrtc_transport.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 WebrtcTransport::peer_connection_factory() { 243 WebrtcTransport::peer_connection_factory() {
244 return peer_connection_wrapper_ 244 return peer_connection_wrapper_
245 ? peer_connection_wrapper_->peer_connection_factory() 245 ? peer_connection_wrapper_->peer_connection_factory()
246 : nullptr; 246 : nullptr;
247 } 247 }
248 248
249 std::unique_ptr<MessagePipe> WebrtcTransport::CreateOutgoingChannel( 249 std::unique_ptr<MessagePipe> WebrtcTransport::CreateOutgoingChannel(
250 const std::string& name) { 250 const std::string& name) {
251 webrtc::DataChannelInit config; 251 webrtc::DataChannelInit config;
252 config.reliable = true; 252 config.reliable = true;
253 return base::WrapUnique(new WebrtcDataStreamAdapter( 253 return base::MakeUnique<WebrtcDataStreamAdapter>(
254 peer_connection()->CreateDataChannel(name, &config))); 254 peer_connection()->CreateDataChannel(name, &config));
255 } 255 }
256 256
257 void WebrtcTransport::Start( 257 void WebrtcTransport::Start(
258 Authenticator* authenticator, 258 Authenticator* authenticator,
259 SendTransportInfoCallback send_transport_info_callback) { 259 SendTransportInfoCallback send_transport_info_callback) {
260 DCHECK(thread_checker_.CalledOnValidThread()); 260 DCHECK(thread_checker_.CalledOnValidThread());
261 DCHECK(send_transport_info_callback_.is_null()); 261 DCHECK(send_transport_info_callback_.is_null());
262 262
263 jingle_glue::JingleThreadWrapper::EnsureForCurrentMessageLoop(); 263 jingle_glue::JingleThreadWrapper::EnsureForCurrentMessageLoop();
264 264
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 rtc::scoped_refptr<webrtc::MediaStreamInterface> stream) { 514 rtc::scoped_refptr<webrtc::MediaStreamInterface> stream) {
515 DCHECK(thread_checker_.CalledOnValidThread()); 515 DCHECK(thread_checker_.CalledOnValidThread());
516 event_handler_->OnWebrtcTransportMediaStreamRemoved(stream.get()); 516 event_handler_->OnWebrtcTransportMediaStreamRemoved(stream.get());
517 } 517 }
518 518
519 void WebrtcTransport::OnDataChannel( 519 void WebrtcTransport::OnDataChannel(
520 rtc::scoped_refptr<webrtc::DataChannelInterface> data_channel) { 520 rtc::scoped_refptr<webrtc::DataChannelInterface> data_channel) {
521 DCHECK(thread_checker_.CalledOnValidThread()); 521 DCHECK(thread_checker_.CalledOnValidThread());
522 event_handler_->OnWebrtcTransportIncomingDataChannel( 522 event_handler_->OnWebrtcTransportIncomingDataChannel(
523 data_channel->label(), 523 data_channel->label(),
524 base::WrapUnique(new WebrtcDataStreamAdapter(data_channel))); 524 base::MakeUnique<WebrtcDataStreamAdapter>(data_channel));
525 } 525 }
526 526
527 void WebrtcTransport::OnRenegotiationNeeded() { 527 void WebrtcTransport::OnRenegotiationNeeded() {
528 DCHECK(thread_checker_.CalledOnValidThread()); 528 DCHECK(thread_checker_.CalledOnValidThread());
529 529
530 if (transport_context_->role() == TransportRole::SERVER) { 530 if (transport_context_->role() == TransportRole::SERVER) {
531 RequestNegotiation(); 531 RequestNegotiation();
532 } else { 532 } else {
533 // TODO(sergeyu): Is it necessary to support renegotiation initiated by the 533 // TODO(sergeyu): Is it necessary to support renegotiation initiated by the
534 // client? 534 // client?
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
660 // the stack and so it must be destroyed later. 660 // the stack and so it must be destroyed later.
661 base::ThreadTaskRunnerHandle::Get()->DeleteSoon( 661 base::ThreadTaskRunnerHandle::Get()->DeleteSoon(
662 FROM_HERE, peer_connection_wrapper_.release()); 662 FROM_HERE, peer_connection_wrapper_.release());
663 663
664 if (error != OK) 664 if (error != OK)
665 event_handler_->OnWebrtcTransportError(error); 665 event_handler_->OnWebrtcTransportError(error);
666 } 666 }
667 667
668 } // namespace protocol 668 } // namespace protocol
669 } // namespace remoting 669 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/protocol/video_frame_pump_unittest.cc ('k') | remoting/signaling/server_log_entry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698