| 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 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 } | 376 } |
| 377 | 377 |
| 378 bool MetricsService::WasLastShutdownClean() const { | 378 bool MetricsService::WasLastShutdownClean() const { |
| 379 return clean_exit_beacon_.exited_cleanly(); | 379 return clean_exit_beacon_.exited_cleanly(); |
| 380 } | 380 } |
| 381 | 381 |
| 382 std::unique_ptr<const base::FieldTrial::EntropyProvider> | 382 std::unique_ptr<const base::FieldTrial::EntropyProvider> |
| 383 MetricsService::CreateEntropyProvider() { | 383 MetricsService::CreateEntropyProvider() { |
| 384 // TODO(asvitkine): Refactor the code so that MetricsService does not expose | 384 // TODO(asvitkine): Refactor the code so that MetricsService does not expose |
| 385 // this method. | 385 // this method. |
| 386 return state_manager_->CreateEntropyProvider(); | 386 return state_manager_->CreateDefaultEntropyProvider(); |
| 387 } | 387 } |
| 388 | 388 |
| 389 void MetricsService::EnableRecording() { | 389 void MetricsService::EnableRecording() { |
| 390 DCHECK(IsSingleThreaded()); | 390 DCHECK(IsSingleThreaded()); |
| 391 | 391 |
| 392 if (recording_state_ == ACTIVE) | 392 if (recording_state_ == ACTIVE) |
| 393 return; | 393 return; |
| 394 recording_state_ = ACTIVE; | 394 recording_state_ = ACTIVE; |
| 395 | 395 |
| 396 state_manager_->ForceClientIdCreation(); | 396 state_manager_->ForceClientIdCreation(); |
| (...skipping 798 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1195 base::Time::Now().ToTimeT()); | 1195 base::Time::Now().ToTimeT()); |
| 1196 } | 1196 } |
| 1197 | 1197 |
| 1198 void MetricsService::SkipAndDiscardUpload() { | 1198 void MetricsService::SkipAndDiscardUpload() { |
| 1199 log_manager_.DiscardStagedLog(); | 1199 log_manager_.DiscardStagedLog(); |
| 1200 scheduler_->UploadCancelled(); | 1200 scheduler_->UploadCancelled(); |
| 1201 log_upload_in_progress_ = false; | 1201 log_upload_in_progress_ = false; |
| 1202 } | 1202 } |
| 1203 | 1203 |
| 1204 } // namespace metrics | 1204 } // namespace metrics |
| OLD | NEW |