diff --git a/PRESUBMIT.py b/PRESUBMIT.py index b7680b1a65d97a..60090e1533deaf 100644 --- a/PRESUBMIT.py +++ b/PRESUBMIT.py @@ -216,6 +216,7 @@ r"^net[\\\/]test[\\\/]spawned_test_server[\\\/]local_test_server\.cc$", r"^net[\\\/]test[\\\/]test_data_directory\.cc$", r"^net[\\\/]url_request[\\\/]test_url_fetcher_factory\.cc$", + r"^remoting[\\\/]protocol[\\\/]webrtc_transport\.cc$", r"^ui[\\\/]base[\\\/]material_design[\\\/]" "material_design_controller\.cc$", r"^ui[\\\/]gl[\\\/]init[\\\/]gl_initializer_mac\.cc$", diff --git a/remoting/protocol/webrtc_transport.cc b/remoting/protocol/webrtc_transport.cc index 604a3f1d422950..5477e718b8dd58 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();