OLD | NEW |
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 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 transport_context_->port_allocator_factory()->CreatePortAllocator( | 292 transport_context_->port_allocator_factory()->CreatePortAllocator( |
293 transport_context_); | 293 transport_context_); |
294 | 294 |
295 // Takes ownership of video_encoder_factory_. | 295 // Takes ownership of video_encoder_factory_. |
296 peer_connection_wrapper_.reset(new PeerConnectionWrapper( | 296 peer_connection_wrapper_.reset(new PeerConnectionWrapper( |
297 worker_thread, base::WrapUnique(video_encoder_factory_), | 297 worker_thread, base::WrapUnique(video_encoder_factory_), |
298 std::move(port_allocator), weak_factory_.GetWeakPtr())); | 298 std::move(port_allocator), weak_factory_.GetWeakPtr())); |
299 } | 299 } |
300 | 300 |
301 WebrtcTransport::~WebrtcTransport() { | 301 WebrtcTransport::~WebrtcTransport() { |
| 302 DCHECK(thread_checker_.CalledOnValidThread()); |
302 Close(OK); | 303 Close(OK); |
303 } | 304 } |
304 | 305 |
305 webrtc::PeerConnectionInterface* WebrtcTransport::peer_connection() { | 306 webrtc::PeerConnectionInterface* WebrtcTransport::peer_connection() { |
306 return peer_connection_wrapper_ ? peer_connection_wrapper_->peer_connection() | 307 return peer_connection_wrapper_ ? peer_connection_wrapper_->peer_connection() |
307 : nullptr; | 308 : nullptr; |
308 } | 309 } |
309 | 310 |
310 webrtc::PeerConnectionFactoryInterface* | 311 webrtc::PeerConnectionFactoryInterface* |
311 WebrtcTransport::peer_connection_factory() { | 312 WebrtcTransport::peer_connection_factory() { |
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
722 // the stack and so it must be destroyed later. | 723 // the stack and so it must be destroyed later. |
723 base::ThreadTaskRunnerHandle::Get()->DeleteSoon( | 724 base::ThreadTaskRunnerHandle::Get()->DeleteSoon( |
724 FROM_HERE, peer_connection_wrapper_.release()); | 725 FROM_HERE, peer_connection_wrapper_.release()); |
725 | 726 |
726 if (error != OK) | 727 if (error != OK) |
727 event_handler_->OnWebrtcTransportError(error); | 728 event_handler_->OnWebrtcTransportError(error); |
728 } | 729 } |
729 | 730 |
730 } // namespace protocol | 731 } // namespace protocol |
731 } // namespace remoting | 732 } // namespace remoting |
OLD | NEW |