OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chromecast/browser/metrics/cast_metrics_service_client.h" | 5 #include "chromecast/browser/metrics/cast_metrics_service_client.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/guid.h" | 8 #include "base/guid.h" |
9 #include "base/i18n/rtl.h" | 9 #include "base/i18n/rtl.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 const std::string& client_id) { | 109 const std::string& client_id) { |
110 client_id_ = client_id; | 110 client_id_ = client_id; |
111 LOG(INFO) << "Metrics client ID set: " << client_id; | 111 LOG(INFO) << "Metrics client ID set: " << client_id; |
112 shell::CastBrowserProcess::GetInstance()->browser_client()-> | 112 shell::CastBrowserProcess::GetInstance()->browser_client()-> |
113 SetMetricsClientId(client_id); | 113 SetMetricsClientId(client_id); |
114 #if defined(OS_ANDROID) | 114 #if defined(OS_ANDROID) |
115 DumpstateWriter::AddDumpValue(kClientIdName, client_id); | 115 DumpstateWriter::AddDumpValue(kClientIdName, client_id); |
116 #endif | 116 #endif |
117 } | 117 } |
118 | 118 |
119 void CastMetricsServiceClient::OnRecordingDisabled() { | |
120 } | |
121 | |
122 void CastMetricsServiceClient::StoreClientInfo( | 119 void CastMetricsServiceClient::StoreClientInfo( |
123 const ::metrics::ClientInfo& client_info) { | 120 const ::metrics::ClientInfo& client_info) { |
124 const std::string& client_id = client_info.client_id; | 121 const std::string& client_id = client_info.client_id; |
125 DCHECK(client_id.empty() || base::IsValidGUID(client_id)); | 122 DCHECK(client_id.empty() || base::IsValidGUID(client_id)); |
126 // backup client_id or reset to empty. | 123 // backup client_id or reset to empty. |
127 SetMetricsClientId(client_id); | 124 SetMetricsClientId(client_id); |
128 } | 125 } |
129 | 126 |
130 std::unique_ptr<::metrics::ClientInfo> | 127 std::unique_ptr<::metrics::ClientInfo> |
131 CastMetricsServiceClient::LoadClientInfo() { | 128 CastMetricsServiceClient::LoadClientInfo() { |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 external_metrics_->StopAndDestroy(); | 405 external_metrics_->StopAndDestroy(); |
409 external_metrics_ = nullptr; | 406 external_metrics_ = nullptr; |
410 platform_metrics_->StopAndDestroy(); | 407 platform_metrics_->StopAndDestroy(); |
411 platform_metrics_ = nullptr; | 408 platform_metrics_ = nullptr; |
412 #endif // defined(OS_LINUX) | 409 #endif // defined(OS_LINUX) |
413 metrics_service_->Stop(); | 410 metrics_service_->Stop(); |
414 } | 411 } |
415 | 412 |
416 } // namespace metrics | 413 } // namespace metrics |
417 } // namespace chromecast | 414 } // namespace chromecast |
OLD | NEW |