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

Unified Diff: remoting/protocol/webrtc_transport.cc

Issue 2567533002: Add ScopedAllowIO in WebrtcTransport when shutting down WebRTC session. (Closed)
Patch Set: . Created 4 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « PRESUBMIT.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/webrtc_transport.cc
diff --git a/remoting/protocol/webrtc_transport.cc b/remoting/protocol/webrtc_transport.cc
index 604a3f1d4229502d3302d3d53297897c8ecba656..5477e718b8dd58e6077eab84f741e6687b60e249 100644
--- a/remoting/protocol/webrtc_transport.cc
+++ b/remoting/protocol/webrtc_transport.cc
@@ -18,6 +18,7 @@
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "base/task_runner_util.h"
+#include "base/threading/thread_restrictions.h"
#include "base/threading/thread_task_runner_handle.h"
#include "jingle/glue/thread_wrapper.h"
#include "remoting/protocol/authenticator.h"
@@ -194,7 +195,13 @@ class WebrtcTransport::PeerConnectionWrapper
peer_connection_ = peer_connection_factory_->CreatePeerConnection(
rtc_config, &constraints, std::move(port_allocator), nullptr, this);
}
- virtual ~PeerConnectionWrapper() { peer_connection_->Close(); }
+ virtual ~PeerConnectionWrapper() {
+ // PeerConnection creates threads internally, which are stopped when the
+ // connection is closed. Thread.Stop() is a blocking operation.
+ // See crbug.com/660081.
+ base::ThreadRestrictions::ScopedAllowIO allow_io;
+ peer_connection_->Close();
+ }
WebrtcAudioModule* audio_module() {
return audio_module_.get();
« no previous file with comments | « PRESUBMIT.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698