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

Unified Diff: remoting/host/heartbeat_sender.cc

Issue 12221123: Include version information in heartbeats. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use an element instead of an attribute for the host version. Created 7 years, 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/heartbeat_sender.cc
diff --git a/remoting/host/heartbeat_sender.cc b/remoting/host/heartbeat_sender.cc
index 0a5a1815342e89d142b47f2becc0bf59af54d14a..faf354a25014260fd5dc3986873a0b97589a7c6a 100644
--- a/remoting/host/heartbeat_sender.cc
+++ b/remoting/host/heartbeat_sender.cc
@@ -11,6 +11,7 @@
#include "base/message_loop_proxy.h"
#include "base/rand_util.h"
#include "base/string_number_conversions.h"
+#include "base/strings/stringize_macros.h"
#include "base/time.h"
#include "remoting/base/constants.h"
#include "remoting/host/server_log_entry.h"
@@ -28,6 +29,7 @@ namespace {
const char kHeartbeatQueryTag[] = "heartbeat";
const char kHostIdAttr[] = "hostid";
+const char kHostVersionTag[] = "host-version";
const char kHeartbeatSignatureTag[] = "signature";
const char kSequenceIdAttr[] = "sequence-id";
@@ -242,6 +244,11 @@ scoped_ptr<XmlElement> HeartbeatSender::CreateHeartbeatMessage() {
query->AddAttr(QName(kChromotingXmlNamespace, kSequenceIdAttr),
base::IntToString(sequence_id_));
query->AddElement(CreateSignature().release());
+ // Append host version.
+ scoped_ptr<XmlElement> version_tag(new XmlElement(
+ QName(kChromotingXmlNamespace, kHostVersionTag)));
+ version_tag->AddText(STRINGIZE(VERSION));
+ query->AddElement(version_tag.release());
Sergey Ulanov 2013/02/13 18:46:44 Actually this should be a child of <heartbeat> ele
Jamie 2013/02/13 19:04:38 I think both the host version and the log are alre
Sergey Ulanov 2013/02/13 19:23:57 Ah, sorry, I misread this code. |query| is not the
Jamie 2013/02/13 19:29:01 Agreed. I've changed it to |heartbeat|.
// Append log message (which isn't signed).
scoped_ptr<XmlElement> log(ServerLogEntry::MakeStanza());
scoped_ptr<ServerLogEntry> log_entry(ServerLogEntry::MakeForHeartbeat());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698