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 1014 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1025 void MetricsService::SendStagedLog() { | 1025 void MetricsService::SendStagedLog() { |
1026 DCHECK(log_manager_.has_staged_log()); | 1026 DCHECK(log_manager_.has_staged_log()); |
1027 if (!log_manager_.has_staged_log()) | 1027 if (!log_manager_.has_staged_log()) |
1028 return; | 1028 return; |
1029 | 1029 |
1030 DCHECK(!log_upload_in_progress_); | 1030 DCHECK(!log_upload_in_progress_); |
1031 log_upload_in_progress_ = true; | 1031 log_upload_in_progress_ = true; |
1032 | 1032 |
1033 if (!log_uploader_) { | 1033 if (!log_uploader_) { |
1034 log_uploader_ = client_->CreateUploader( | 1034 log_uploader_ = client_->CreateUploader( |
1035 client_->GetMetricsServerUrl(), | 1035 client_->GetMetricsServerUrl(), metrics::kDefaultMetricsMimeType, |
1036 metrics::kDefaultMetricsMimeType, | 1036 metrics::MetricsLogUploader::UMA, |
1037 base::Bind(&MetricsService::OnLogUploadComplete, | 1037 base::Bind(&MetricsService::OnLogUploadComplete, |
1038 self_ptr_factory_.GetWeakPtr())); | 1038 self_ptr_factory_.GetWeakPtr())); |
1039 } | 1039 } |
1040 const std::string hash = | 1040 const std::string hash = |
1041 base::HexEncode(log_manager_.staged_log_hash().data(), | 1041 base::HexEncode(log_manager_.staged_log_hash().data(), |
1042 log_manager_.staged_log_hash().size()); | 1042 log_manager_.staged_log_hash().size()); |
1043 log_uploader_->UploadLog(log_manager_.staged_log(), hash); | 1043 log_uploader_->UploadLog(log_manager_.staged_log(), hash); |
1044 | 1044 |
1045 if (!upload_scheduler_) | 1045 if (!upload_scheduler_) |
1046 HandleIdleSinceLastTransmission(true); | 1046 HandleIdleSinceLastTransmission(true); |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1249 // Redundant setting to assure that we always reset this value at shutdown | 1249 // Redundant setting to assure that we always reset this value at shutdown |
1250 // (and that we don't use some alternate path, and not call LogCleanShutdown). | 1250 // (and that we don't use some alternate path, and not call LogCleanShutdown). |
1251 clean_shutdown_status_ = CLEANLY_SHUTDOWN; | 1251 clean_shutdown_status_ = CLEANLY_SHUTDOWN; |
1252 client_->OnLogCleanShutdown(); | 1252 client_->OnLogCleanShutdown(); |
1253 clean_exit_beacon_.WriteBeaconValue(true); | 1253 clean_exit_beacon_.WriteBeaconValue(true); |
1254 SetExecutionPhase(ExecutionPhase::SHUTDOWN_COMPLETE, local_state_); | 1254 SetExecutionPhase(ExecutionPhase::SHUTDOWN_COMPLETE, local_state_); |
1255 local_state_->SetBoolean(prefs::kStabilitySessionEndCompleted, end_completed); | 1255 local_state_->SetBoolean(prefs::kStabilitySessionEndCompleted, end_completed); |
1256 } | 1256 } |
1257 | 1257 |
1258 } // namespace metrics | 1258 } // namespace metrics |
OLD | NEW |