| 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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 if (command_line->HasSwitch(switches::kOverrideMetricsUploadUrl)) { | 236 if (command_line->HasSwitch(switches::kOverrideMetricsUploadUrl)) { |
| 237 uma_server_url.assign( | 237 uma_server_url.assign( |
| 238 command_line->GetSwitchValueASCII(switches::kOverrideMetricsUploadUrl)); | 238 command_line->GetSwitchValueASCII(switches::kOverrideMetricsUploadUrl)); |
| 239 } | 239 } |
| 240 DCHECK(!uma_server_url.empty()); | 240 DCHECK(!uma_server_url.empty()); |
| 241 return uma_server_url; | 241 return uma_server_url; |
| 242 } | 242 } |
| 243 | 243 |
| 244 std::unique_ptr<::metrics::MetricsLogUploader> | 244 std::unique_ptr<::metrics::MetricsLogUploader> |
| 245 CastMetricsServiceClient::CreateUploader( | 245 CastMetricsServiceClient::CreateUploader( |
| 246 const std::string& server_url, | 246 const base::StringPiece& server_url, |
| 247 const std::string& mime_type, | 247 const base::StringPiece& mime_type, |
| 248 ::metrics::MetricsLogUploader::MetricServiceType service_type, | 248 ::metrics::MetricsLogUploader::MetricServiceType service_type, |
| 249 const base::Callback<void(int)>& on_upload_complete) { | 249 const base::Callback<void(int)>& on_upload_complete) { |
| 250 return std::unique_ptr<::metrics::MetricsLogUploader>( | 250 return std::unique_ptr<::metrics::MetricsLogUploader>( |
| 251 new ::metrics::NetMetricsLogUploader(request_context_, server_url, | 251 new ::metrics::NetMetricsLogUploader(request_context_, server_url, |
| 252 mime_type, service_type, | 252 mime_type, service_type, |
| 253 on_upload_complete)); | 253 on_upload_complete)); |
| 254 } | 254 } |
| 255 | 255 |
| 256 base::TimeDelta CastMetricsServiceClient::GetStandardUploadInterval() { | 256 base::TimeDelta CastMetricsServiceClient::GetStandardUploadInterval() { |
| 257 return base::TimeDelta::FromMinutes(kStandardUploadIntervalMinutes); | 257 return base::TimeDelta::FromMinutes(kStandardUploadIntervalMinutes); |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 404 external_metrics_->StopAndDestroy(); | 404 external_metrics_->StopAndDestroy(); |
| 405 external_metrics_ = nullptr; | 405 external_metrics_ = nullptr; |
| 406 platform_metrics_->StopAndDestroy(); | 406 platform_metrics_->StopAndDestroy(); |
| 407 platform_metrics_ = nullptr; | 407 platform_metrics_ = nullptr; |
| 408 #endif // defined(OS_LINUX) | 408 #endif // defined(OS_LINUX) |
| 409 metrics_service_->Stop(); | 409 metrics_service_->Stop(); |
| 410 } | 410 } |
| 411 | 411 |
| 412 } // namespace metrics | 412 } // namespace metrics |
| 413 } // namespace chromecast | 413 } // namespace chromecast |
| OLD | NEW |