| OLD | NEW |
| 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/client/client_telemetry_logger.h" | 5 #include "remoting/client/client_telemetry_logger.h" |
| 6 | 6 |
| 7 #include "base/format_macros.h" | 7 #include "base/format_macros.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/rand_util.h" | 9 #include "base/rand_util.h" |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 const std::string host_version; | 29 const std::string host_version; |
| 30 const ChromotingEvent::Os host_os; | 30 const ChromotingEvent::Os host_os; |
| 31 const std::string host_os_version; | 31 const std::string host_os_version; |
| 32 }; | 32 }; |
| 33 | 33 |
| 34 ClientTelemetryLogger::ClientTelemetryLogger( | 34 ClientTelemetryLogger::ClientTelemetryLogger( |
| 35 ChromotingEventLogWriter* log_writer, | 35 ChromotingEventLogWriter* log_writer, |
| 36 ChromotingEvent::Mode mode) | 36 ChromotingEvent::Mode mode) |
| 37 : mode_(mode), log_writer_(log_writer) {} | 37 : mode_(mode), log_writer_(log_writer) {} |
| 38 | 38 |
| 39 ClientTelemetryLogger::~ClientTelemetryLogger() {} | 39 ClientTelemetryLogger::~ClientTelemetryLogger() { |
| 40 DCHECK(thread_checker_.CalledOnValidThread()); |
| 41 } |
| 40 | 42 |
| 41 void ClientTelemetryLogger::SetHostInfo(const std::string& host_version, | 43 void ClientTelemetryLogger::SetHostInfo(const std::string& host_version, |
| 42 ChromotingEvent::Os host_os, | 44 ChromotingEvent::Os host_os, |
| 43 const std::string& host_os_version) { | 45 const std::string& host_os_version) { |
| 44 host_info_.reset(new HostInfo{host_version, host_os, host_os_version}); | 46 host_info_.reset(new HostInfo{host_version, host_os, host_os_version}); |
| 45 } | 47 } |
| 46 | 48 |
| 47 void ClientTelemetryLogger::LogSessionStateChange( | 49 void ClientTelemetryLogger::LogSessionStateChange( |
| 48 ChromotingEvent::SessionState state, | 50 ChromotingEvent::SessionState state, |
| 49 ChromotingEvent::ConnectionError error) { | 51 ChromotingEvent::ConnectionError error) { |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 return event; | 261 return event; |
| 260 } | 262 } |
| 261 | 263 |
| 262 ChromotingEvent ClientTelemetryLogger::MakeSessionIdNewEvent() { | 264 ChromotingEvent ClientTelemetryLogger::MakeSessionIdNewEvent() { |
| 263 ChromotingEvent event(ChromotingEvent::Type::SESSION_ID_NEW); | 265 ChromotingEvent event(ChromotingEvent::Type::SESSION_ID_NEW); |
| 264 FillEventContext(&event); | 266 FillEventContext(&event); |
| 265 return event; | 267 return event; |
| 266 } | 268 } |
| 267 | 269 |
| 268 } // namespace remoting | 270 } // namespace remoting |
| OLD | NEW |