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

Unified Diff: remoting/protocol/connection_to_host.h

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
« no previous file with comments | « remoting/client/plugin/chromoting_instance.cc ('k') | remoting/protocol/connection_to_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/connection_to_host.h
diff --git a/remoting/protocol/connection_to_host.h b/remoting/protocol/connection_to_host.h
index 4eb7d15251bd1fb7eec757f06130597658f94cf2..6ba89dc93c0a7b4024fb54efdb8a04ba1dad5f57 100644
--- a/remoting/protocol/connection_to_host.h
+++ b/remoting/protocol/connection_to_host.h
@@ -5,6 +5,7 @@
#ifndef REMOTING_PROTOCOL_CONNECTION_TO_HOST_H_
#define REMOTING_PROTOCOL_CONNECTION_TO_HOST_H_
+#include <set>
#include <string>
#include "base/callback_forward.h"
@@ -64,6 +65,12 @@ class ConnectionToHost : public SignalStrategy::Listener,
// Called when state of the connection changes.
virtual void OnConnectionState(State state, ErrorCode error) = 0;
+
+ // Called when ready state of the connection changes. When |ready|
+ // is set to false some data sent by the peers may be
+ // delayed. This is used to indicate in the UI when connection is
+ // temporarily broken.
+ virtual void OnConnectionReady(bool ready) = 0;
};
ConnectionToHost(bool allow_nat_traversal);
@@ -104,6 +111,8 @@ class ConnectionToHost : public SignalStrategy::Listener,
virtual void OnSessionStateChange(Session::State state) OVERRIDE;
virtual void OnSessionRouteChange(const std::string& channel_name,
const TransportRoute& route) OVERRIDE;
+ virtual void OnSessionChannelReady(const std::string& channel_name,
+ bool ready) OVERRIDE;
// Return the current state of ConnectionToHost.
State state() const;
@@ -150,6 +159,9 @@ class ConnectionToHost : public SignalStrategy::Listener,
State state_;
ErrorCode error_;
+ // List of channels that are not currently ready.
+ std::set<std::string> not_ready_channels_;
+
private:
DISALLOW_COPY_AND_ASSIGN(ConnectionToHost);
};
« no previous file with comments | « remoting/client/plugin/chromoting_instance.cc ('k') | remoting/protocol/connection_to_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698