Skip to content

Commit

Permalink
Fix DCHECK in the chromoting host when disconnecting a WebRTC connect…
Browse files Browse the repository at this point in the history
…ion.

WebRTC creates threads internally. Thread::Stop() is a blocking operation,
so it's not allowed on the network thread. To work around this problem
WebrtcTransport::PeerConnectionWrapper uses ScopedAllowIO when closing
PeerConnection. But it's not longer enough - some threads are stopped
later when the factory is destroyed. Updated PeerConnectionWrapper
destructor to destroy the PeerConnectionFactory with ScopedAllowIO.

BUG=714699

Review-Url: https://codereview.chromium.org/2847803003
Cr-Commit-Position: refs/heads/master@{#467838}
  • Loading branch information
SergeyUlanov authored and Commit bot committed Apr 28, 2017
1 parent 3e1e45d commit 8c6a6fa
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions remoting/protocol/webrtc_transport.cc
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,9 @@ class WebrtcTransport::PeerConnectionWrapper
// See crbug.com/660081.
base::ThreadRestrictions::ScopedAllowIO allow_io;
peer_connection_->Close();
peer_connection_ = nullptr;
peer_connection_factory_ = nullptr;
audio_module_ = nullptr;
}

WebrtcAudioModule* audio_module() {
Expand Down

0 comments on commit 8c6a6fa

Please sign in to comment.