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

Unified Diff: remoting/protocol/connection_to_host.cc

Issue 10692179: Propagate connection state from networking layer to UI. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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/connection_to_host.cc
diff --git a/remoting/protocol/connection_to_host.cc b/remoting/protocol/connection_to_host.cc
index 5794c50216f15daff92d3da49b1890f40c3e2612..0ebc3c0d8316fa95b459fb2142f69f03642a18c5 100644
--- a/remoting/protocol/connection_to_host.cc
+++ b/remoting/protocol/connection_to_host.cc
@@ -209,6 +209,21 @@ void ConnectionToHost::OnSessionRouteChange(const std::string& channel_name,
const TransportRoute& route) {
}
+void ConnectionToHost::OnSessionChannelReady(const std::string& channel_name,
+ bool ready) {
+ if (ready) {
+ not_ready_channels_.erase(channel_name);
Wez 2012/07/17 01:47:50 Should we set |not_ready_channels_| to contain all
Sergey Ulanov 2012/07/18 00:52:07 I don't think it's necessary because we know that
+ } else if (!ready) {
+ not_ready_channels_.insert(channel_name);
+ }
+
+ if (ready && not_ready_channels_.size() == 0U) {
Wez 2012/07/17 01:47:50 Can't this entire block be event_callback_.OnConne
Sergey Ulanov 2012/07/18 00:52:07 Done.
+ event_callback_->OnConnectionReady(true);
+ } else if (!ready && not_ready_channels_.size() == 1U) {
+ event_callback_->OnConnectionReady(false);
+ }
+}
+
ConnectionToHost::State ConnectionToHost::state() const {
return state_;
}

Powered by Google App Engine
This is Rietveld 408576698