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

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

Issue 11570009: Split PrefService into PrefService, PrefServiceSimple and PrefServiceSyncable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments. Created 8 years 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 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 } 429 }
430 430
431 private: 431 private:
432 ~MetricsMemoryDetails() {} 432 ~MetricsMemoryDetails() {}
433 433
434 base::Closure callback_; 434 base::Closure callback_;
435 DISALLOW_COPY_AND_ASSIGN(MetricsMemoryDetails); 435 DISALLOW_COPY_AND_ASSIGN(MetricsMemoryDetails);
436 }; 436 };
437 437
438 // static 438 // static
439 void MetricsService::RegisterPrefs(PrefService* local_state) { 439 void MetricsService::RegisterPrefs(PrefServiceSimple* local_state) {
440 DCHECK(IsSingleThreaded()); 440 DCHECK(IsSingleThreaded());
441 local_state->RegisterStringPref(prefs::kMetricsClientID, ""); 441 local_state->RegisterStringPref(prefs::kMetricsClientID, "");
442 local_state->RegisterIntegerPref(prefs::kMetricsLowEntropySource, 442 local_state->RegisterIntegerPref(prefs::kMetricsLowEntropySource,
443 kLowEntropySourceNotSet); 443 kLowEntropySourceNotSet);
444 local_state->RegisterInt64Pref(prefs::kMetricsClientIDTimestamp, 0); 444 local_state->RegisterInt64Pref(prefs::kMetricsClientIDTimestamp, 0);
445 local_state->RegisterInt64Pref(prefs::kStabilityLaunchTimeSec, 0); 445 local_state->RegisterInt64Pref(prefs::kStabilityLaunchTimeSec, 0);
446 local_state->RegisterInt64Pref(prefs::kStabilityLastTimestampSec, 0); 446 local_state->RegisterInt64Pref(prefs::kStabilityLastTimestampSec, 0);
447 local_state->RegisterStringPref(prefs::kStabilityStatsVersion, ""); 447 local_state->RegisterStringPref(prefs::kStabilityStatsVersion, "");
448 local_state->RegisterInt64Pref(prefs::kStabilityStatsBuildTime, 0); 448 local_state->RegisterInt64Pref(prefs::kStabilityStatsBuildTime, 0);
449 local_state->RegisterBooleanPref(prefs::kStabilityExitedCleanly, true); 449 local_state->RegisterBooleanPref(prefs::kStabilityExitedCleanly, true);
(...skipping 1537 matching lines...) Expand 10 before | Expand all | Expand 10 after
1987 if (local_state) { 1987 if (local_state) {
1988 const PrefService::Preference* uma_pref = 1988 const PrefService::Preference* uma_pref =
1989 local_state->FindPreference(prefs::kMetricsReportingEnabled); 1989 local_state->FindPreference(prefs::kMetricsReportingEnabled);
1990 if (uma_pref) { 1990 if (uma_pref) {
1991 bool success = uma_pref->GetValue()->GetAsBoolean(&result); 1991 bool success = uma_pref->GetValue()->GetAsBoolean(&result);
1992 DCHECK(success); 1992 DCHECK(success);
1993 } 1993 }
1994 } 1994 }
1995 return result; 1995 return result;
1996 } 1996 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698