| 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 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 | 201 |
| 202 peer_connection_ = peer_connection_factory_->CreatePeerConnection( | 202 peer_connection_ = peer_connection_factory_->CreatePeerConnection( |
| 203 rtc_config, &constraints, std::move(port_allocator), nullptr, this); | 203 rtc_config, &constraints, std::move(port_allocator), nullptr, this); |
| 204 } | 204 } |
| 205 virtual ~PeerConnectionWrapper() { | 205 virtual ~PeerConnectionWrapper() { |
| 206 // PeerConnection creates threads internally, which are stopped when the | 206 // PeerConnection creates threads internally, which are stopped when the |
| 207 // connection is closed. Thread.Stop() is a blocking operation. | 207 // connection is closed. Thread.Stop() is a blocking operation. |
| 208 // See crbug.com/660081. | 208 // See crbug.com/660081. |
| 209 base::ThreadRestrictions::ScopedAllowIO allow_io; | 209 base::ThreadRestrictions::ScopedAllowIO allow_io; |
| 210 peer_connection_->Close(); | 210 peer_connection_->Close(); |
| 211 peer_connection_ = nullptr; |
| 212 peer_connection_factory_ = nullptr; |
| 213 audio_module_ = nullptr; |
| 211 } | 214 } |
| 212 | 215 |
| 213 WebrtcAudioModule* audio_module() { | 216 WebrtcAudioModule* audio_module() { |
| 214 return audio_module_.get(); | 217 return audio_module_.get(); |
| 215 } | 218 } |
| 216 | 219 |
| 217 webrtc::PeerConnectionInterface* peer_connection() { | 220 webrtc::PeerConnectionInterface* peer_connection() { |
| 218 return peer_connection_.get(); | 221 return peer_connection_.get(); |
| 219 } | 222 } |
| 220 | 223 |
| (...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 718 // the stack and so it must be destroyed later. | 721 // the stack and so it must be destroyed later. |
| 719 base::ThreadTaskRunnerHandle::Get()->DeleteSoon( | 722 base::ThreadTaskRunnerHandle::Get()->DeleteSoon( |
| 720 FROM_HERE, peer_connection_wrapper_.release()); | 723 FROM_HERE, peer_connection_wrapper_.release()); |
| 721 | 724 |
| 722 if (error != OK) | 725 if (error != OK) |
| 723 event_handler_->OnWebrtcTransportError(error); | 726 event_handler_->OnWebrtcTransportError(error); |
| 724 } | 727 } |
| 725 | 728 |
| 726 } // namespace protocol | 729 } // namespace protocol |
| 727 } // namespace remoting | 730 } // namespace remoting |
| OLD | NEW |