| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 //------------------------------------------------------------------------------ | 5 //------------------------------------------------------------------------------ |
| 6 // Description of the life cycle of a instance of MetricsService. | 6 // Description of the life cycle of a instance of MetricsService. |
| 7 // | 7 // |
| 8 // OVERVIEW | 8 // OVERVIEW |
| 9 // | 9 // |
| 10 // A MetricsService instance is typically created at application startup. It | 10 // A MetricsService instance is typically created at application startup. It |
| (...skipping 1250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1261 | 1261 |
| 1262 void MetricsService::PrepareFetchWithPendingLog() { | 1262 void MetricsService::PrepareFetchWithPendingLog() { |
| 1263 DCHECK(pending_log()); | 1263 DCHECK(pending_log()); |
| 1264 DCHECK(!current_fetch_.get()); | 1264 DCHECK(!current_fetch_.get()); |
| 1265 PreparePendingLogText(); | 1265 PreparePendingLogText(); |
| 1266 DCHECK(!compressed_log_.empty()); | 1266 DCHECK(!compressed_log_.empty()); |
| 1267 | 1267 |
| 1268 current_fetch_.reset(new URLFetcher(GURL(WideToUTF16(server_url_)), | 1268 current_fetch_.reset(new URLFetcher(GURL(WideToUTF16(server_url_)), |
| 1269 URLFetcher::POST, | 1269 URLFetcher::POST, |
| 1270 this)); | 1270 this)); |
| 1271 current_fetch_->set_request_context(Profile::GetDefaultRequestContext()); | 1271 current_fetch_->set_request_context( |
| 1272 Profile::Deprecated::GetDefaultRequestContext()); |
| 1272 current_fetch_->set_upload_data(kMetricsType, compressed_log_); | 1273 current_fetch_->set_upload_data(kMetricsType, compressed_log_); |
| 1273 } | 1274 } |
| 1274 | 1275 |
| 1275 static const char* StatusToString(const net::URLRequestStatus& status) { | 1276 static const char* StatusToString(const net::URLRequestStatus& status) { |
| 1276 switch (status.status()) { | 1277 switch (status.status()) { |
| 1277 case net::URLRequestStatus::SUCCESS: | 1278 case net::URLRequestStatus::SUCCESS: |
| 1278 return "SUCCESS"; | 1279 return "SUCCESS"; |
| 1279 | 1280 |
| 1280 case net::URLRequestStatus::IO_PENDING: | 1281 case net::URLRequestStatus::IO_PENDING: |
| 1281 return "IO_PENDING"; | 1282 return "IO_PENDING"; |
| (...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1691 thread_id = base::PlatformThread::CurrentId(); | 1692 thread_id = base::PlatformThread::CurrentId(); |
| 1692 return base::PlatformThread::CurrentId() == thread_id; | 1693 return base::PlatformThread::CurrentId() == thread_id; |
| 1693 } | 1694 } |
| 1694 | 1695 |
| 1695 #if defined(OS_CHROMEOS) | 1696 #if defined(OS_CHROMEOS) |
| 1696 void MetricsService::StartExternalMetrics() { | 1697 void MetricsService::StartExternalMetrics() { |
| 1697 external_metrics_ = new chromeos::ExternalMetrics; | 1698 external_metrics_ = new chromeos::ExternalMetrics; |
| 1698 external_metrics_->Start(); | 1699 external_metrics_->Start(); |
| 1699 } | 1700 } |
| 1700 #endif | 1701 #endif |
| OLD | NEW |