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

Unified Diff: remoting/protocol/webrtc_transport.cc

Issue 2172153005: Ensure that connection can be closed in response to a data message. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 5 months 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
Index: remoting/protocol/webrtc_transport.cc
diff --git a/remoting/protocol/webrtc_transport.cc b/remoting/protocol/webrtc_transport.cc
index ac3b6b32398af1d83681118b97f228692b22d623..76b557c94150cd6421634059432348c025aaceee 100644
--- a/remoting/protocol/webrtc_transport.cc
+++ b/remoting/protocol/webrtc_transport.cc
@@ -135,7 +135,6 @@ class SetSessionDescriptionObserver
DISALLOW_COPY_AND_ASSIGN(SetSessionDescriptionObserver);
};
-
} // namespace
WebrtcTransport::WebrtcTransport(
@@ -150,7 +149,13 @@ WebrtcTransport::WebrtcTransport(
transport_context_->set_relay_mode(TransportContext::RelayMode::TURN);
}
-WebrtcTransport::~WebrtcTransport() {}
+WebrtcTransport::~WebrtcTransport() {
+ // Destroy |fake_audio_device_module_| asynchronously. PeerConnection may be
+ // on the stack and so it will be destroyed later. We need to ensures that
Jamie 2016/07/23 00:03:48 s/ensures/ensure/
Sergey Ulanov 2016/07/23 06:30:04 reworded this comment
+ // |fake_audio_device_module_| is destroyed only after that.
+ base::ThreadTaskRunnerHandle::Get()->DeleteSoon(
+ FROM_HERE, fake_audio_device_module_.release());
+}
std::unique_ptr<MessagePipe> WebrtcTransport::CreateOutgoingChannel(
const std::string& name) {
« remoting/protocol/connection_unittest.cc ('K') | « remoting/protocol/connection_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698