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

Unified Diff: remoting/host/heartbeat_sender.h

Issue 10106013: Chromoting: stopping the service if the host ID is permanently not recognized by the could. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cr feedback. Created 8 years, 8 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/host/heartbeat_sender.h
diff --git a/remoting/host/heartbeat_sender.h b/remoting/host/heartbeat_sender.h
index f2f5a474aafe40056c59637b9c878bd0f035a7fd..560179c39273bfa7694f2743adb5469db005db3e 100644
--- a/remoting/host/heartbeat_sender.h
+++ b/remoting/host/heartbeat_sender.h
@@ -79,10 +79,18 @@ class IqSender;
// </iq>
class HeartbeatSender : public SignalStrategy::Listener {
public:
- // |signal_strategy| and |key_pair| must outlive this
+ class Delegate {
simonmorris 2012/04/17 19:52:30 Optional nit: maybe "Listener" instead of "Delegat
alexeypa (please no reviews) 2012/04/17 20:01:05 Done.
+ public:
+ virtual ~Delegate() { }
+ // Invoked when the host ID is permanently not recognized by the server.
+ virtual void OnUnknownHostIdError() = 0;
+ };
+
+ // |signal_strategy|, |key_pair| and |delegate| must outlive this
// object. Heartbeats will start when the supplied SignalStrategy
// enters the CONNECTED state.
- HeartbeatSender(const std::string& host_id,
+ HeartbeatSender(Delegate* delegate,
+ const std::string& host_id,
SignalStrategy* signal_strategy,
HostKeyPair* key_pair);
virtual ~HeartbeatSender();
@@ -111,6 +119,7 @@ class HeartbeatSender : public SignalStrategy::Listener {
scoped_ptr<buzz::XmlElement> CreateHeartbeatMessage();
scoped_ptr<buzz::XmlElement> CreateSignature();
+ Delegate* delegate_;
std::string host_id_;
SignalStrategy* signal_strategy_;
HostKeyPair* key_pair_;

Powered by Google App Engine
This is Rietveld 408576698