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

Unified Diff: remoting/protocol/fake_session.cc

Issue 2757723002: Update ICE protocol to handle closed channel (Closed)
Patch Set: . Created 3 years, 9 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
« no previous file with comments | « remoting/protocol/connection_tester.cc ('k') | remoting/protocol/fake_stream_socket.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/fake_session.cc
diff --git a/remoting/protocol/fake_session.cc b/remoting/protocol/fake_session.cc
index 0ed08daa29c450672d9bb212d45e2d6ca8fcea55..5c6d1806feaf2c701a932a80c85fd4d100a8b255 100644
--- a/remoting/protocol/fake_session.cc
+++ b/remoting/protocol/fake_session.cc
@@ -77,11 +77,18 @@ void FakeSession::Close(ErrorCode error) {
error_ = error;
event_handler_->OnSessionStateChange(CLOSED);
- FakeSession* peer = peer_.get();
+ base::WeakPtr<FakeSession> peer = peer_;
if (peer) {
peer->peer_.reset();
peer_.reset();
- peer->Close(error);
+
+ if (signaling_delay_.is_zero()) {
+ peer->Close(error);
+ } else {
+ base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
+ FROM_HERE, base::Bind(&FakeSession::Close, peer, error),
+ signaling_delay_);
+ }
}
}
« no previous file with comments | « remoting/protocol/connection_tester.cc ('k') | remoting/protocol/fake_stream_socket.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698