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 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 294 log_upload_in_progress_(false), | 294 log_upload_in_progress_(false), |
| 295 idle_since_last_transmission_(false), | 295 idle_since_last_transmission_(false), |
| 296 session_id_(-1), | 296 session_id_(-1), |
| 297 self_ptr_factory_(this), | 297 self_ptr_factory_(this), |
| 298 state_saver_factory_(this) { | 298 state_saver_factory_(this) { |
| 299 DCHECK(IsSingleThreaded()); | 299 DCHECK(IsSingleThreaded()); |
| 300 DCHECK(state_manager_); | 300 DCHECK(state_manager_); |
| 301 DCHECK(client_); | 301 DCHECK(client_); |
| 302 DCHECK(local_state_); | 302 DCHECK(local_state_); |
| 303 | 303 |
| 304 base::SetRecordActionTaskRunner(client_->GetUIThreadTaskRunner()); | |
|
Ilya Sherman
2016/04/06 02:36:29
I think it makes sense to set this in the same pla
beaudoin
2016/04/06 15:06:13
It seems that a RecordAction is being called befor
Ilya Sherman
2016/04/06 21:48:48
Hmm, yeah, that sounds like a bug for sure -- ther
beaudoin
2016/04/07 18:12:34
Filed as: https://crbug.com/601482
I'll take a lo
| |
| 305 | |
| 304 // Set the install date if this is our first run. | 306 // Set the install date if this is our first run. |
| 305 int64_t install_date = local_state_->GetInt64(prefs::kInstallDate); | 307 int64_t install_date = local_state_->GetInt64(prefs::kInstallDate); |
| 306 if (install_date == 0) | 308 if (install_date == 0) |
| 307 local_state_->SetInt64(prefs::kInstallDate, base::Time::Now().ToTimeT()); | 309 local_state_->SetInt64(prefs::kInstallDate, base::Time::Now().ToTimeT()); |
| 308 } | 310 } |
| 309 | 311 |
| 310 MetricsService::~MetricsService() { | 312 MetricsService::~MetricsService() { |
| 311 DisableRecording(); | 313 DisableRecording(); |
| 312 } | 314 } |
| 313 | 315 |
| (...skipping 847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1161 base::Time::Now().ToTimeT()); | 1163 base::Time::Now().ToTimeT()); |
| 1162 } | 1164 } |
| 1163 | 1165 |
| 1164 void MetricsService::SkipAndDiscardUpload() { | 1166 void MetricsService::SkipAndDiscardUpload() { |
| 1165 log_manager_.DiscardStagedLog(); | 1167 log_manager_.DiscardStagedLog(); |
| 1166 scheduler_->UploadCancelled(); | 1168 scheduler_->UploadCancelled(); |
| 1167 log_upload_in_progress_ = false; | 1169 log_upload_in_progress_ = false; |
| 1168 } | 1170 } |
| 1169 | 1171 |
| 1170 } // namespace metrics | 1172 } // namespace metrics |
| OLD | NEW |