| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 | 10 // A MetricsService instance is typically created at application startup. It |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 #include "chrome/browser/extensions/extension_service.h" | 173 #include "chrome/browser/extensions/extension_service.h" |
| 174 #include "chrome/browser/extensions/process_map.h" | 174 #include "chrome/browser/extensions/process_map.h" |
| 175 #include "chrome/browser/io_thread.h" | 175 #include "chrome/browser/io_thread.h" |
| 176 #include "chrome/browser/memory_details.h" | 176 #include "chrome/browser/memory_details.h" |
| 177 #include "chrome/browser/metrics/metrics_log.h" | 177 #include "chrome/browser/metrics/metrics_log.h" |
| 178 #include "chrome/browser/metrics/metrics_log_serializer.h" | 178 #include "chrome/browser/metrics/metrics_log_serializer.h" |
| 179 #include "chrome/browser/metrics/metrics_reporting_scheduler.h" | 179 #include "chrome/browser/metrics/metrics_reporting_scheduler.h" |
| 180 #include "chrome/browser/metrics/tracking_synchronizer.h" | 180 #include "chrome/browser/metrics/tracking_synchronizer.h" |
| 181 #include "chrome/browser/net/http_pipelining_compatibility_client.h" | 181 #include "chrome/browser/net/http_pipelining_compatibility_client.h" |
| 182 #include "chrome/browser/net/network_stats.h" | 182 #include "chrome/browser/net/network_stats.h" |
| 183 #include "chrome/browser/prefs/pref_registry_simple.h" |
| 183 #include "chrome/browser/prefs/pref_service.h" | 184 #include "chrome/browser/prefs/pref_service.h" |
| 184 #include "chrome/browser/prefs/scoped_user_pref_update.h" | 185 #include "chrome/browser/prefs/scoped_user_pref_update.h" |
| 185 #include "chrome/browser/profiles/profile.h" | 186 #include "chrome/browser/profiles/profile.h" |
| 186 #include "chrome/browser/search_engines/template_url_service.h" | 187 #include "chrome/browser/search_engines/template_url_service.h" |
| 187 #include "chrome/browser/ui/browser_list.h" | 188 #include "chrome/browser/ui/browser_list.h" |
| 188 #include "chrome/browser/ui/browser_otr_state.h" | 189 #include "chrome/browser/ui/browser_otr_state.h" |
| 189 #include "chrome/common/child_process_logging.h" | 190 #include "chrome/common/child_process_logging.h" |
| 190 #include "chrome/common/chrome_notification_types.h" | 191 #include "chrome/common/chrome_notification_types.h" |
| 191 #include "chrome/common/chrome_result_codes.h" | 192 #include "chrome/common/chrome_result_codes.h" |
| 192 #include "chrome/common/chrome_switches.h" | 193 #include "chrome/common/chrome_switches.h" |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 429 } | 430 } |
| 430 | 431 |
| 431 private: | 432 private: |
| 432 ~MetricsMemoryDetails() {} | 433 ~MetricsMemoryDetails() {} |
| 433 | 434 |
| 434 base::Closure callback_; | 435 base::Closure callback_; |
| 435 DISALLOW_COPY_AND_ASSIGN(MetricsMemoryDetails); | 436 DISALLOW_COPY_AND_ASSIGN(MetricsMemoryDetails); |
| 436 }; | 437 }; |
| 437 | 438 |
| 438 // static | 439 // static |
| 439 void MetricsService::RegisterPrefs(PrefServiceSimple* local_state) { | 440 void MetricsService::RegisterPrefs(PrefRegistrySimple* local_state) { |
| 440 DCHECK(IsSingleThreaded()); | 441 DCHECK(IsSingleThreaded()); |
| 441 local_state->RegisterStringPref(prefs::kMetricsClientID, ""); | 442 local_state->RegisterStringPref(prefs::kMetricsClientID, ""); |
| 442 local_state->RegisterIntegerPref(prefs::kMetricsLowEntropySource, | 443 local_state->RegisterIntegerPref(prefs::kMetricsLowEntropySource, |
| 443 kLowEntropySourceNotSet); | 444 kLowEntropySourceNotSet); |
| 444 local_state->RegisterInt64Pref(prefs::kMetricsClientIDTimestamp, 0); | 445 local_state->RegisterInt64Pref(prefs::kMetricsClientIDTimestamp, 0); |
| 445 local_state->RegisterInt64Pref(prefs::kStabilityLaunchTimeSec, 0); | 446 local_state->RegisterInt64Pref(prefs::kStabilityLaunchTimeSec, 0); |
| 446 local_state->RegisterInt64Pref(prefs::kStabilityLastTimestampSec, 0); | 447 local_state->RegisterInt64Pref(prefs::kStabilityLastTimestampSec, 0); |
| 447 local_state->RegisterStringPref(prefs::kStabilityStatsVersion, ""); | 448 local_state->RegisterStringPref(prefs::kStabilityStatsVersion, ""); |
| 448 local_state->RegisterInt64Pref(prefs::kStabilityStatsBuildTime, 0); | 449 local_state->RegisterInt64Pref(prefs::kStabilityStatsBuildTime, 0); |
| 449 local_state->RegisterBooleanPref(prefs::kStabilityExitedCleanly, true); | 450 local_state->RegisterBooleanPref(prefs::kStabilityExitedCleanly, true); |
| (...skipping 1542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1992 if (local_state) { | 1993 if (local_state) { |
| 1993 const PrefService::Preference* uma_pref = | 1994 const PrefService::Preference* uma_pref = |
| 1994 local_state->FindPreference(prefs::kMetricsReportingEnabled); | 1995 local_state->FindPreference(prefs::kMetricsReportingEnabled); |
| 1995 if (uma_pref) { | 1996 if (uma_pref) { |
| 1996 bool success = uma_pref->GetValue()->GetAsBoolean(&result); | 1997 bool success = uma_pref->GetValue()->GetAsBoolean(&result); |
| 1997 DCHECK(success); | 1998 DCHECK(success); |
| 1998 } | 1999 } |
| 1999 } | 2000 } |
| 2000 return result; | 2001 return result; |
| 2001 } | 2002 } |
| OLD | NEW |