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 //------------------------------------------------------------------------------ | 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 is | 10 // A MetricsService instance is typically created at application startup. It is |
(...skipping 982 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
993 void MetricsService::SendStagedLog() { | 993 void MetricsService::SendStagedLog() { |
994 DCHECK(log_store_.has_staged_log()); | 994 DCHECK(log_store_.has_staged_log()); |
995 if (!log_store_.has_staged_log()) | 995 if (!log_store_.has_staged_log()) |
996 return; | 996 return; |
997 | 997 |
998 DCHECK(!log_upload_in_progress_); | 998 DCHECK(!log_upload_in_progress_); |
999 log_upload_in_progress_ = true; | 999 log_upload_in_progress_ = true; |
1000 | 1000 |
1001 if (!log_uploader_) { | 1001 if (!log_uploader_) { |
1002 log_uploader_ = client_->CreateUploader( | 1002 log_uploader_ = client_->CreateUploader( |
1003 client_->GetMetricsServerUrl(), | 1003 client_->GetMetricsServerUrl(), metrics::kDefaultMetricsMimeType, |
1004 metrics::kDefaultMetricsMimeType, | 1004 metrics::MetricsLogUploader::UMA, |
1005 base::Bind(&MetricsService::OnLogUploadComplete, | 1005 base::Bind(&MetricsService::OnLogUploadComplete, |
1006 self_ptr_factory_.GetWeakPtr())); | 1006 self_ptr_factory_.GetWeakPtr())); |
1007 } | 1007 } |
1008 const std::string hash = base::HexEncode(log_store_.staged_log_hash().data(), | 1008 const std::string hash = base::HexEncode(log_store_.staged_log_hash().data(), |
1009 log_store_.staged_log_hash().size()); | 1009 log_store_.staged_log_hash().size()); |
1010 log_uploader_->UploadLog(log_store_.staged_log(), hash); | 1010 log_uploader_->UploadLog(log_store_.staged_log(), hash); |
1011 | 1011 |
1012 if (!upload_scheduler_) | 1012 if (!upload_scheduler_) |
1013 HandleIdleSinceLastTransmission(true); | 1013 HandleIdleSinceLastTransmission(true); |
1014 } | 1014 } |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1210 // Redundant setting to assure that we always reset this value at shutdown | 1210 // Redundant setting to assure that we always reset this value at shutdown |
1211 // (and that we don't use some alternate path, and not call LogCleanShutdown). | 1211 // (and that we don't use some alternate path, and not call LogCleanShutdown). |
1212 clean_shutdown_status_ = CLEANLY_SHUTDOWN; | 1212 clean_shutdown_status_ = CLEANLY_SHUTDOWN; |
1213 client_->OnLogCleanShutdown(); | 1213 client_->OnLogCleanShutdown(); |
1214 clean_exit_beacon_.WriteBeaconValue(true); | 1214 clean_exit_beacon_.WriteBeaconValue(true); |
1215 SetExecutionPhase(ExecutionPhase::SHUTDOWN_COMPLETE, local_state_); | 1215 SetExecutionPhase(ExecutionPhase::SHUTDOWN_COMPLETE, local_state_); |
1216 StabilityMetricsProvider(local_state_).MarkSessionEndCompleted(end_completed); | 1216 StabilityMetricsProvider(local_state_).MarkSessionEndCompleted(end_completed); |
1217 } | 1217 } |
1218 | 1218 |
1219 } // namespace metrics | 1219 } // namespace metrics |
OLD | NEW |