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

Side by Side Diff: base/prefs/pref_service.h

Issue 81183005: Remove JsonPrefStore pruning of empty values on write. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 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 // This provides a way to access the application's current preferences. 5 // This provides a way to access the application's current preferences.
6 6
7 // Chromium settings and storage represent user-selected preferences and 7 // Chromium settings and storage represent user-selected preferences and
8 // information and MUST not be extracted, overwritten or modified except 8 // information and MUST not be extracted, overwritten or modified except
9 // through Chromium defined APIs. 9 // through Chromium defined APIs.
10 10
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 // Changes the default value for a preference. Takes ownership of |value|. 214 // Changes the default value for a preference. Takes ownership of |value|.
215 // 215 //
216 // Will cause a pref change notification to be fired if this causes 216 // Will cause a pref change notification to be fired if this causes
217 // the effective value to change. 217 // the effective value to change.
218 void SetDefaultPrefValue(const char* path, base::Value* value); 218 void SetDefaultPrefValue(const char* path, base::Value* value);
219 219
220 // Returns the default value of the given preference. |path| must point to a 220 // Returns the default value of the given preference. |path| must point to a
221 // registered preference. In that case, will never return NULL. 221 // registered preference. In that case, will never return NULL.
222 const base::Value* GetDefaultPrefValue(const char* path) const; 222 const base::Value* GetDefaultPrefValue(const char* path) const;
223 223
224 // Deprecated. Do not add calls to this method.
225 // Marks that the user store should not prune out empty values for |key| when
226 // writting to disk.
227 // TODO(gab): Enforce this at a lower level for all values and remove this
228 // method.
229 void MarkUserStoreNeedsEmptyValue(const std::string& key) const;
230
231 // Returns true if a value has been set for the specified path. 224 // Returns true if a value has been set for the specified path.
232 // NOTE: this is NOT the same as FindPreference. In particular 225 // NOTE: this is NOT the same as FindPreference. In particular
233 // FindPreference returns whether RegisterXXX has been invoked, where as 226 // FindPreference returns whether RegisterXXX has been invoked, where as
234 // this checks if a value exists for the path. 227 // this checks if a value exists for the path.
235 bool HasPrefPath(const char* path) const; 228 bool HasPrefPath(const char* path) const;
236 229
237 // Returns a dictionary with effective preference values. The ownership 230 // Returns a dictionary with effective preference values. The ownership
238 // is passed to the caller. 231 // is passed to the caller.
239 scoped_ptr<base::DictionaryValue> GetPreferenceValues() const; 232 scoped_ptr<base::DictionaryValue> GetPreferenceValues() const;
240 233
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 351
359 // Local cache of registered Preference objects. The pref_registry_ 352 // Local cache of registered Preference objects. The pref_registry_
360 // is authoritative with respect to what the types and default values 353 // is authoritative with respect to what the types and default values
361 // of registered preferences are. 354 // of registered preferences are.
362 mutable PreferenceMap prefs_map_; 355 mutable PreferenceMap prefs_map_;
363 356
364 DISALLOW_COPY_AND_ASSIGN(PrefService); 357 DISALLOW_COPY_AND_ASSIGN(PrefService);
365 }; 358 };
366 359
367 #endif // BASE_PREFS_PREF_SERVICE_H_ 360 #endif // BASE_PREFS_PREF_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698