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

Unified Diff: remoting/host/register_support_host_request.cc

Issue 2880853002: Reports host version, host os and host os version for It2me Host. (Closed)
Patch Set: Fix Unittest Created 3 years, 7 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/host/it2me/it2me_host_unittest.cc ('k') | remoting/host/register_support_host_request_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/register_support_host_request.cc
diff --git a/remoting/host/register_support_host_request.cc b/remoting/host/register_support_host_request.cc
index 72c234500267a286cb403721bf3b67b5d2ebb40c..95c8be50e074282a6c0d1be03375990407210f95 100644
--- a/remoting/host/register_support_host_request.cc
+++ b/remoting/host/register_support_host_request.cc
@@ -11,9 +11,11 @@
#include "base/logging.h"
#include "base/message_loop/message_loop.h"
#include "base/strings/string_number_conversions.h"
+#include "base/strings/stringize_macros.h"
#include "base/time/time.h"
#include "remoting/base/constants.h"
#include "remoting/host/host_config.h"
+#include "remoting/host/host_details.h"
#include "remoting/signaling/iq_sender.h"
#include "remoting/signaling/jid_util.h"
#include "remoting/signaling/signal_strategy.h"
@@ -32,6 +34,9 @@ const char kRegisterQueryTag[] = "register-support-host";
const char kPublicKeyTag[] = "public-key";
const char kSignatureTag[] = "signature";
const char kSignatureTimeAttr[] = "time";
+const char kHostVersionTag[] = "host-version";
+const char kHostOsNameTag[] = "host-os-name";
+const char kHostOsVersionTag[] = "host-os-version";
// Strings used to parse responses received from the bot.
const char kRegisterQueryResultTag[] = "register-support-host-result";
@@ -84,13 +89,34 @@ bool RegisterSupportHostRequest::OnSignalStrategyIncomingStanza(
std::unique_ptr<XmlElement>
RegisterSupportHostRequest::CreateRegistrationRequest(const std::string& jid) {
- std::unique_ptr<XmlElement> query(
- new XmlElement(QName(kChromotingXmlNamespace, kRegisterQueryTag)));
- XmlElement* public_key = new XmlElement(
+ auto query = base::MakeUnique<XmlElement>(
+ QName(kChromotingXmlNamespace, kRegisterQueryTag));
+
+ auto public_key = base::MakeUnique<XmlElement>(
QName(kChromotingXmlNamespace, kPublicKeyTag));
public_key->AddText(key_pair_->GetPublicKey());
- query->AddElement(public_key);
+ query->AddElement(public_key.release());
+
query->AddElement(CreateSignature(jid).release());
+
+ // Add host version.
+ auto host_version = base::MakeUnique<XmlElement>(
+ QName(kChromotingXmlNamespace, kHostVersionTag));
+ host_version->AddText(STRINGIZE(VERSION));
+ query->AddElement(host_version.release());
+
+ // Add host os name.
+ auto host_os_name = base::MakeUnique<XmlElement>(
+ QName(kChromotingXmlNamespace, kHostOsNameTag));
+ host_os_name->AddText(GetHostOperatingSystemName());
+ query->AddElement(host_os_name.release());
+
+ // Add host os version.
+ auto host_os_version = base::MakeUnique<XmlElement>(
+ QName(kChromotingXmlNamespace, kHostOsVersionTag));
+ host_os_version->AddText(GetHostOperatingSystemVersion());
+ query->AddElement(host_os_version.release());
+
return query;
}
« no previous file with comments | « remoting/host/it2me/it2me_host_unittest.cc ('k') | remoting/host/register_support_host_request_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698