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

Unified Diff: remoting/base/chromoting_event.cc

Issue 2629593003: [Chromoting.com] Make Android telemetry report host version/os/os version (Closed)
Patch Set: PTAL Point Created 3 years, 11 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/base/chromoting_event.h ('k') | remoting/client/client_telemetry_logger.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/base/chromoting_event.cc
diff --git a/remoting/base/chromoting_event.cc b/remoting/base/chromoting_event.cc
index 51f725d9bf5836a095779d1244652ee01a8d8554..1ac93900b7b2002a0ed11f91b9bd4cf005f060f3 100644
--- a/remoting/base/chromoting_event.cc
+++ b/remoting/base/chromoting_event.cc
@@ -4,6 +4,7 @@
#include "remoting/base/chromoting_event.h"
+#include "base/strings/string_util.h"
#include "base/strings/stringize_macros.h"
#include "base/sys_info.h"
@@ -14,6 +15,9 @@ const char ChromotingEvent::kConnectionErrorKey[] = "connection_error";
const char ChromotingEvent::kCpuKey[] = "cpu";
const char ChromotingEvent::kDecodeLatencyKey[] = "decode_latency";
const char ChromotingEvent::kEncodeLatencyKey[] = "encode_latency";
+const char ChromotingEvent::kHostOsKey[] = "host_os";
+const char ChromotingEvent::kHostOsVersionKey[] = "host_os_version";
+const char ChromotingEvent::kHostVersionKey[] = "host_version";
const char ChromotingEvent::kMaxCaptureLatencyKey[] = "max_capture_latency";
const char ChromotingEvent::kMaxDecodeLatencyKey[] = "max_decode_latency";
const char ChromotingEvent::kMaxEncodeLatencyKey[] = "max_encode_latency";
@@ -120,4 +124,25 @@ bool ChromotingEvent::IsEndOfSession(SessionState state) {
state == SessionState::CONNECTION_CANCELED;
}
+// static
+ChromotingEvent::Os ChromotingEvent::ParseOsFromString(const std::string& os) {
+ std::string lower_os = base::ToLowerASCII(os);
+ // TODO(yuweih): Refactor remoting/protocol/name_value_map.h and use it to
+ // map the value.
+ if (lower_os == "linux") {
+ return Os::CHROMOTING_LINUX;
+ } else if (lower_os == "chromeos") {
+ return Os::CHROMOTING_CHROMEOS;
+ } else if (lower_os == "mac") {
+ return Os::CHROMOTING_MAC;
+ } else if (lower_os == "windows") {
+ return Os::CHROMOTING_WINDOWS;
+ } else if (lower_os == "android") {
+ return Os::CHROMOTING_ANDROID;
+ } else if (lower_os == "ios") {
+ return Os::CHROMOTING_IOS;
+ }
+ return Os::OTHER;
+}
+
} // namespace remoting
« no previous file with comments | « remoting/base/chromoting_event.h ('k') | remoting/client/client_telemetry_logger.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698