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

Unified Diff: remoting/host/heartbeat_sender.h

Issue 5510006: Use heartbeat interval received from the bot. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 10 years 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 | « no previous file | remoting/host/heartbeat_sender.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/heartbeat_sender.h
diff --git a/remoting/host/heartbeat_sender.h b/remoting/host/heartbeat_sender.h
index e2befa9bc4fb16e4bc2a0874c2a6d4f6a8113841..ef310b40b9eb91a5879d0ccacc14ec2e870b4a12 100644
--- a/remoting/host/heartbeat_sender.h
+++ b/remoting/host/heartbeat_sender.h
@@ -37,6 +37,22 @@ class MutableHostConfig;
// being signed is the full Jid concatenated with the time value, separated by
// space. For example, for the heartbeat stanza above the message that is being
// signed is "user@gmail.com/chromoting123123 1279061748".
+//
+// Bot sends the following result stanza in response to each heartbeat:
+//
+// <iq type="set" from="remoting@bot.talk.google.com"
+// to="user@gmail.com/chromoting123123" id="5" xmlns="jabber:client">
+// <rem:heartbeat-result xmlns:rem="google:remoting">
+// <rem:set-interval>300</rem:set-interval>
+// </rem:heartbeat>
+// </iq>
+//
+// The set-interval tag is used to specify desired heartbeat interval
+// in seconds. The heartbeat-result and the set-interval tags are
+// optional. Host uses default heartbeat interval if it doesn't find
+// set-interval tag in the result Iq stanza it receives from the
+// server.
+//
// TODO(sergeyu): Is it enough to sign JID and nothing else?
class HeartbeatSender : public base::RefCountedThreadSafe<HeartbeatSender> {
public:
@@ -61,6 +77,7 @@ class HeartbeatSender : public base::RefCountedThreadSafe<HeartbeatSender> {
private:
FRIEND_TEST_ALL_PREFIXES(HeartbeatSenderTest, DoSendStanza);
FRIEND_TEST_ALL_PREFIXES(HeartbeatSenderTest, CreateHeartbeatMessage);
+ FRIEND_TEST_ALL_PREFIXES(HeartbeatSenderTest, ProcessResponse);
enum State {
CREATED,
@@ -84,6 +101,7 @@ class HeartbeatSender : public base::RefCountedThreadSafe<HeartbeatSender> {
scoped_ptr<IqRequest> request_;
std::string host_id_;
HostKeyPair key_pair_;
+ int interval_ms_;
DISALLOW_COPY_AND_ASSIGN(HeartbeatSender);
};
« no previous file with comments | « no previous file | remoting/host/heartbeat_sender.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698