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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "remoting/base/chromoting_event.h" 5 #include "remoting/base/chromoting_event.h"
6 6
7 #include "base/strings/string_util.h"
7 #include "base/strings/stringize_macros.h" 8 #include "base/strings/stringize_macros.h"
8 #include "base/sys_info.h" 9 #include "base/sys_info.h"
9 10
10 namespace remoting { 11 namespace remoting {
11 12
12 const char ChromotingEvent::kCaptureLatencyKey[] = "capture_latency"; 13 const char ChromotingEvent::kCaptureLatencyKey[] = "capture_latency";
13 const char ChromotingEvent::kConnectionErrorKey[] = "connection_error"; 14 const char ChromotingEvent::kConnectionErrorKey[] = "connection_error";
14 const char ChromotingEvent::kCpuKey[] = "cpu"; 15 const char ChromotingEvent::kCpuKey[] = "cpu";
15 const char ChromotingEvent::kDecodeLatencyKey[] = "decode_latency"; 16 const char ChromotingEvent::kDecodeLatencyKey[] = "decode_latency";
16 const char ChromotingEvent::kEncodeLatencyKey[] = "encode_latency"; 17 const char ChromotingEvent::kEncodeLatencyKey[] = "encode_latency";
18 const char ChromotingEvent::kHostOsKey[] = "host_os";
19 const char ChromotingEvent::kHostOsVersionKey[] = "host_os_version";
20 const char ChromotingEvent::kHostVersionKey[] = "host_version";
17 const char ChromotingEvent::kMaxCaptureLatencyKey[] = "max_capture_latency"; 21 const char ChromotingEvent::kMaxCaptureLatencyKey[] = "max_capture_latency";
18 const char ChromotingEvent::kMaxDecodeLatencyKey[] = "max_decode_latency"; 22 const char ChromotingEvent::kMaxDecodeLatencyKey[] = "max_decode_latency";
19 const char ChromotingEvent::kMaxEncodeLatencyKey[] = "max_encode_latency"; 23 const char ChromotingEvent::kMaxEncodeLatencyKey[] = "max_encode_latency";
20 const char ChromotingEvent::kMaxRenderLatencyKey[] = "max_render_latency"; 24 const char ChromotingEvent::kMaxRenderLatencyKey[] = "max_render_latency";
21 const char ChromotingEvent::kMaxRoundtripLatencyKey[] = "max_roundtrip_latency"; 25 const char ChromotingEvent::kMaxRoundtripLatencyKey[] = "max_roundtrip_latency";
22 const char ChromotingEvent::kModeKey[] = "mode"; 26 const char ChromotingEvent::kModeKey[] = "mode";
23 const char ChromotingEvent::kOsKey[] = "os"; 27 const char ChromotingEvent::kOsKey[] = "os";
24 const char ChromotingEvent::kOsVersionKey[] = "os_version"; 28 const char ChromotingEvent::kOsVersionKey[] = "os_version";
25 const char ChromotingEvent::kRenderLatencyKey[] = "render_latency"; 29 const char ChromotingEvent::kRenderLatencyKey[] = "render_latency";
26 const char ChromotingEvent::kRoleKey[] = "role"; 30 const char ChromotingEvent::kRoleKey[] = "role";
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 } 117 }
114 118
115 // static 119 // static
116 bool ChromotingEvent::IsEndOfSession(SessionState state) { 120 bool ChromotingEvent::IsEndOfSession(SessionState state) {
117 return state == SessionState::CLOSED || 121 return state == SessionState::CLOSED ||
118 state == SessionState::CONNECTION_DROPPED || 122 state == SessionState::CONNECTION_DROPPED ||
119 state == SessionState::CONNECTION_FAILED || 123 state == SessionState::CONNECTION_FAILED ||
120 state == SessionState::CONNECTION_CANCELED; 124 state == SessionState::CONNECTION_CANCELED;
121 } 125 }
122 126
127 // static
128 ChromotingEvent::Os ChromotingEvent::ParseOsFromString(const std::string& os) {
129 std::string lower_os = base::ToLowerASCII(os);
130 if (lower_os == "linux") {
Sergey Ulanov 2017/01/13 02:15:26 FYI there are helpers in remoting/protocol/name_va
Yuwei 2017/01/13 02:27:21 Good to know! Left a TODO and will do it this is c
131 return Os::CHROMOTING_LINUX;
132 } else if (lower_os == "chromeos") {
133 return Os::CHROMOTING_CHROMEOS;
134 } else if (lower_os == "mac") {
135 return Os::CHROMOTING_MAC;
136 } else if (lower_os == "windows") {
137 return Os::CHROMOTING_WINDOWS;
138 } else if (lower_os == "android") {
139 return Os::CHROMOTING_ANDROID;
140 } else if (lower_os == "ios") {
141 return Os::CHROMOTING_IOS;
142 }
143 return Os::OTHER;
144 }
145
123 } // namespace remoting 146 } // namespace remoting
OLDNEW
« 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