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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 #include "base/single_thread_task_runner.h" | 142 #include "base/single_thread_task_runner.h" |
143 #include "base/strings/string_number_conversions.h" | 143 #include "base/strings/string_number_conversions.h" |
144 #include "base/strings/utf_string_conversions.h" | 144 #include "base/strings/utf_string_conversions.h" |
145 #include "base/threading/platform_thread.h" | 145 #include "base/threading/platform_thread.h" |
146 #include "base/threading/thread.h" | 146 #include "base/threading/thread.h" |
147 #include "base/threading/thread_restrictions.h" | 147 #include "base/threading/thread_restrictions.h" |
148 #include "base/threading/thread_task_runner_handle.h" | 148 #include "base/threading/thread_task_runner_handle.h" |
149 #include "base/time/time.h" | 149 #include "base/time/time.h" |
150 #include "base/tracked_objects.h" | 150 #include "base/tracked_objects.h" |
151 #include "build/build_config.h" | 151 #include "build/build_config.h" |
| 152 #include "components/browser_watcher/stability_data_names.h" |
| 153 #include "components/browser_watcher/stability_debugging.h" |
152 #include "components/metrics/data_use_tracker.h" | 154 #include "components/metrics/data_use_tracker.h" |
153 #include "components/metrics/metrics_log.h" | 155 #include "components/metrics/metrics_log.h" |
154 #include "components/metrics/metrics_log_manager.h" | 156 #include "components/metrics/metrics_log_manager.h" |
155 #include "components/metrics/metrics_log_uploader.h" | 157 #include "components/metrics/metrics_log_uploader.h" |
156 #include "components/metrics/metrics_pref_names.h" | 158 #include "components/metrics/metrics_pref_names.h" |
157 #include "components/metrics/metrics_reporting_scheduler.h" | 159 #include "components/metrics/metrics_reporting_scheduler.h" |
158 #include "components/metrics/metrics_service_client.h" | 160 #include "components/metrics/metrics_service_client.h" |
159 #include "components/metrics/metrics_state_manager.h" | 161 #include "components/metrics/metrics_state_manager.h" |
160 #include "components/prefs/pref_registry_simple.h" | 162 #include "components/prefs/pref_registry_simple.h" |
161 #include "components/prefs/pref_service.h" | 163 #include "components/prefs/pref_service.h" |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
492 // Redundant setting to be sure we call for a clean shutdown. | 494 // Redundant setting to be sure we call for a clean shutdown. |
493 clean_shutdown_status_ = NEED_TO_SHUTDOWN; | 495 clean_shutdown_status_ = NEED_TO_SHUTDOWN; |
494 } | 496 } |
495 #endif // defined(OS_ANDROID) || defined(OS_IOS) | 497 #endif // defined(OS_ANDROID) || defined(OS_IOS) |
496 | 498 |
497 // static | 499 // static |
498 void MetricsService::SetExecutionPhase(ExecutionPhase execution_phase, | 500 void MetricsService::SetExecutionPhase(ExecutionPhase execution_phase, |
499 PrefService* local_state) { | 501 PrefService* local_state) { |
500 execution_phase_ = execution_phase; | 502 execution_phase_ = execution_phase; |
501 local_state->SetInteger(prefs::kStabilityExecutionPhase, execution_phase_); | 503 local_state->SetInteger(prefs::kStabilityExecutionPhase, execution_phase_); |
| 504 browser_watcher::SetStabilityDataInt( |
| 505 browser_watcher::kStabilityExecutionPhase, execution_phase_); |
502 } | 506 } |
503 | 507 |
504 void MetricsService::RecordBreakpadRegistration(bool success) { | 508 void MetricsService::RecordBreakpadRegistration(bool success) { |
505 if (!success) | 509 if (!success) |
506 IncrementPrefValue(prefs::kStabilityBreakpadRegistrationFail); | 510 IncrementPrefValue(prefs::kStabilityBreakpadRegistrationFail); |
507 else | 511 else |
508 IncrementPrefValue(prefs::kStabilityBreakpadRegistrationSuccess); | 512 IncrementPrefValue(prefs::kStabilityBreakpadRegistrationSuccess); |
509 } | 513 } |
510 | 514 |
511 void MetricsService::RecordBreakpadHasDebugger(bool has_debugger) { | 515 void MetricsService::RecordBreakpadHasDebugger(bool has_debugger) { |
(...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1230 base::Time::Now().ToTimeT()); | 1234 base::Time::Now().ToTimeT()); |
1231 } | 1235 } |
1232 | 1236 |
1233 void MetricsService::SkipAndDiscardUpload() { | 1237 void MetricsService::SkipAndDiscardUpload() { |
1234 log_manager_.DiscardStagedLog(); | 1238 log_manager_.DiscardStagedLog(); |
1235 scheduler_->UploadCancelled(); | 1239 scheduler_->UploadCancelled(); |
1236 log_upload_in_progress_ = false; | 1240 log_upload_in_progress_ = false; |
1237 } | 1241 } |
1238 | 1242 |
1239 } // namespace metrics | 1243 } // namespace metrics |
OLD | NEW |