Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(384)

Side by Side Diff: chrome/browser/metrics/metrics_service.cc

Issue 11741003: Remove PrefServiceSimple, replacing it with PrefService and PrefRegistrySimple. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Respond to review comments. Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 #include "chrome/browser/extensions/extension_service.h" 171 #include "chrome/browser/extensions/extension_service.h"
172 #include "chrome/browser/extensions/process_map.h" 172 #include "chrome/browser/extensions/process_map.h"
173 #include "chrome/browser/io_thread.h" 173 #include "chrome/browser/io_thread.h"
174 #include "chrome/browser/memory_details.h" 174 #include "chrome/browser/memory_details.h"
175 #include "chrome/browser/metrics/metrics_log.h" 175 #include "chrome/browser/metrics/metrics_log.h"
176 #include "chrome/browser/metrics/metrics_log_serializer.h" 176 #include "chrome/browser/metrics/metrics_log_serializer.h"
177 #include "chrome/browser/metrics/metrics_reporting_scheduler.h" 177 #include "chrome/browser/metrics/metrics_reporting_scheduler.h"
178 #include "chrome/browser/metrics/tracking_synchronizer.h" 178 #include "chrome/browser/metrics/tracking_synchronizer.h"
179 #include "chrome/browser/net/http_pipelining_compatibility_client.h" 179 #include "chrome/browser/net/http_pipelining_compatibility_client.h"
180 #include "chrome/browser/net/network_stats.h" 180 #include "chrome/browser/net/network_stats.h"
181 #include "chrome/browser/prefs/pref_registry_simple.h"
181 #include "chrome/browser/prefs/pref_service.h" 182 #include "chrome/browser/prefs/pref_service.h"
182 #include "chrome/browser/prefs/scoped_user_pref_update.h" 183 #include "chrome/browser/prefs/scoped_user_pref_update.h"
183 #include "chrome/browser/profiles/profile.h" 184 #include "chrome/browser/profiles/profile.h"
184 #include "chrome/browser/search_engines/template_url_service.h" 185 #include "chrome/browser/search_engines/template_url_service.h"
185 #include "chrome/browser/ui/browser_list.h" 186 #include "chrome/browser/ui/browser_list.h"
186 #include "chrome/browser/ui/browser_otr_state.h" 187 #include "chrome/browser/ui/browser_otr_state.h"
187 #include "chrome/common/child_process_logging.h" 188 #include "chrome/common/child_process_logging.h"
188 #include "chrome/common/chrome_notification_types.h" 189 #include "chrome/common/chrome_notification_types.h"
189 #include "chrome/common/chrome_result_codes.h" 190 #include "chrome/common/chrome_result_codes.h"
190 #include "chrome/common/chrome_switches.h" 191 #include "chrome/common/chrome_switches.h"
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 } 428 }
428 429
429 private: 430 private:
430 ~MetricsMemoryDetails() {} 431 ~MetricsMemoryDetails() {}
431 432
432 base::Closure callback_; 433 base::Closure callback_;
433 DISALLOW_COPY_AND_ASSIGN(MetricsMemoryDetails); 434 DISALLOW_COPY_AND_ASSIGN(MetricsMemoryDetails);
434 }; 435 };
435 436
436 // static 437 // static
437 void MetricsService::RegisterPrefs(PrefServiceSimple* local_state) { 438 void MetricsService::RegisterPrefs(PrefRegistrySimple* local_state) {
438 DCHECK(IsSingleThreaded()); 439 DCHECK(IsSingleThreaded());
439 local_state->RegisterStringPref(prefs::kMetricsClientID, ""); 440 local_state->RegisterStringPref(prefs::kMetricsClientID, "");
440 local_state->RegisterIntegerPref(prefs::kMetricsLowEntropySource, 441 local_state->RegisterIntegerPref(prefs::kMetricsLowEntropySource,
441 kLowEntropySourceNotSet); 442 kLowEntropySourceNotSet);
442 local_state->RegisterInt64Pref(prefs::kMetricsClientIDTimestamp, 0); 443 local_state->RegisterInt64Pref(prefs::kMetricsClientIDTimestamp, 0);
443 local_state->RegisterInt64Pref(prefs::kStabilityLaunchTimeSec, 0); 444 local_state->RegisterInt64Pref(prefs::kStabilityLaunchTimeSec, 0);
444 local_state->RegisterInt64Pref(prefs::kStabilityLastTimestampSec, 0); 445 local_state->RegisterInt64Pref(prefs::kStabilityLastTimestampSec, 0);
445 local_state->RegisterStringPref(prefs::kStabilityStatsVersion, ""); 446 local_state->RegisterStringPref(prefs::kStabilityStatsVersion, "");
446 local_state->RegisterInt64Pref(prefs::kStabilityStatsBuildTime, 0); 447 local_state->RegisterInt64Pref(prefs::kStabilityStatsBuildTime, 0);
447 local_state->RegisterBooleanPref(prefs::kStabilityExitedCleanly, true); 448 local_state->RegisterBooleanPref(prefs::kStabilityExitedCleanly, true);
(...skipping 1491 matching lines...) Expand 10 before | Expand all | Expand 10 after
1939 if (local_state) { 1940 if (local_state) {
1940 const PrefService::Preference* uma_pref = 1941 const PrefService::Preference* uma_pref =
1941 local_state->FindPreference(prefs::kMetricsReportingEnabled); 1942 local_state->FindPreference(prefs::kMetricsReportingEnabled);
1942 if (uma_pref) { 1943 if (uma_pref) {
1943 bool success = uma_pref->GetValue()->GetAsBoolean(&result); 1944 bool success = uma_pref->GetValue()->GetAsBoolean(&result);
1944 DCHECK(success); 1945 DCHECK(success);
1945 } 1946 }
1946 } 1947 }
1947 return result; 1948 return result;
1948 } 1949 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698