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

Unified Diff: chrome/browser/prefs/pref_metrics_service.cc

Issue 81183005: Remove JsonPrefStore pruning of empty values on write. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove else Created 7 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/prefs/pref_metrics_service.h ('k') | components/user_prefs/pref_registry_syncable.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/prefs/pref_metrics_service.cc
diff --git a/chrome/browser/prefs/pref_metrics_service.cc b/chrome/browser/prefs/pref_metrics_service.cc
index 6bbfa4aa0a7e61e98e8097d4662c3c2a15046e41..7c3f920495c43b0a5d2859b5d0021dba1f56c3ce 100644
--- a/chrome/browser/prefs/pref_metrics_service.cc
+++ b/chrome/browser/prefs/pref_metrics_service.cc
@@ -92,8 +92,6 @@ PrefMetricsService::PrefMetricsService(Profile* profile)
RegisterSyncedPrefObservers();
- MarkNeedsEmptyValueForTrackedPreferences();
-
// The following code might cause callbacks into this instance before we exit
// the constructor. This instance should be initialized at this point.
#if defined(OS_WIN) || defined(OS_MACOSX)
@@ -122,7 +120,6 @@ PrefMetricsService::PrefMetricsService(Profile* profile,
tracked_pref_path_count_(tracked_pref_path_count),
checked_tracked_prefs_(false),
weak_factory_(this) {
- MarkNeedsEmptyValueForTrackedPreferences();
CheckTrackedPreferences();
}
@@ -273,19 +270,6 @@ void PrefMetricsService::GetDeviceIdCallback(const std::string& device_id) {
CheckTrackedPreferences();
}
-void PrefMetricsService::MarkNeedsEmptyValueForTrackedPreferences() {
- for (int i = 0; i < tracked_pref_path_count_; ++i) {
- // Skip prefs that haven't been registered.
- if (!prefs_->FindPreference(tracked_pref_paths_[i]))
- continue;
-
- // Make sure tracked prefs are saved to disk even if empty.
- // TODO(gab): Guarantee this for all prefs at a lower level and remove this
- // hack.
- prefs_->MarkUserStoreNeedsEmptyValue(tracked_pref_paths_[i]);
- }
-}
-
// To detect changes to Preferences that happen outside of Chrome, we hash
// selected pref values and save them in local state. CheckTrackedPreferences
// compares the saved values to the values observed in the profile's prefs. A
« no previous file with comments | « chrome/browser/prefs/pref_metrics_service.h ('k') | components/user_prefs/pref_registry_syncable.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698