Chromium Code Reviews| 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 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 297 idle_since_last_transmission_(false), | 297 idle_since_last_transmission_(false), |
| 298 session_id_(-1), | 298 session_id_(-1), |
| 299 data_use_tracker_(DataUseTracker::Create(local_state_)), | 299 data_use_tracker_(DataUseTracker::Create(local_state_)), |
| 300 self_ptr_factory_(this), | 300 self_ptr_factory_(this), |
| 301 state_saver_factory_(this) { | 301 state_saver_factory_(this) { |
| 302 DCHECK(IsSingleThreaded()); | 302 DCHECK(IsSingleThreaded()); |
| 303 DCHECK(state_manager_); | 303 DCHECK(state_manager_); |
| 304 DCHECK(client_); | 304 DCHECK(client_); |
| 305 DCHECK(local_state_); | 305 DCHECK(local_state_); |
| 306 | 306 |
| 307 base::SetRecordActionTaskRunner(client_->GetMainThreadTaskRunner()); | |
|
Alexei Svitkine (slow)
2016/04/13 14:43:12
I wasn't following the full discussion here. I lik
beaudoin
2016/04/13 16:19:36
This wasn't specifically discussed.
Here's what w
Ilya Sherman
2016/04/13 19:23:15
I'm not too particular about where this initializa
| |
| 308 | |
| 307 // Set the install date if this is our first run. | 309 // Set the install date if this is our first run. |
| 308 int64_t install_date = local_state_->GetInt64(prefs::kInstallDate); | 310 int64_t install_date = local_state_->GetInt64(prefs::kInstallDate); |
| 309 if (install_date == 0) | 311 if (install_date == 0) |
| 310 local_state_->SetInt64(prefs::kInstallDate, base::Time::Now().ToTimeT()); | 312 local_state_->SetInt64(prefs::kInstallDate, base::Time::Now().ToTimeT()); |
| 311 } | 313 } |
| 312 | 314 |
| 313 MetricsService::~MetricsService() { | 315 MetricsService::~MetricsService() { |
| 314 DisableRecording(); | 316 DisableRecording(); |
| 315 } | 317 } |
| 316 | 318 |
| (...skipping 873 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1190 base::Time::Now().ToTimeT()); | 1192 base::Time::Now().ToTimeT()); |
| 1191 } | 1193 } |
| 1192 | 1194 |
| 1193 void MetricsService::SkipAndDiscardUpload() { | 1195 void MetricsService::SkipAndDiscardUpload() { |
| 1194 log_manager_.DiscardStagedLog(); | 1196 log_manager_.DiscardStagedLog(); |
| 1195 scheduler_->UploadCancelled(); | 1197 scheduler_->UploadCancelled(); |
| 1196 log_upload_in_progress_ = false; | 1198 log_upload_in_progress_ = false; |
| 1197 } | 1199 } |
| 1198 | 1200 |
| 1199 } // namespace metrics | 1201 } // namespace metrics |
| OLD | NEW |