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

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

Issue 79013003: Introduce a temporary workaround to ensure tracked preferences set to empty list/dict are not confu… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: mark in constructor 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
« no previous file with comments | « no previous file | base/prefs/pref_service.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
224 // Returns true if a value has been set for the specified path. 231 // Returns true if a value has been set for the specified path.
225 // NOTE: this is NOT the same as FindPreference. In particular 232 // NOTE: this is NOT the same as FindPreference. In particular
226 // FindPreference returns whether RegisterXXX has been invoked, where as 233 // FindPreference returns whether RegisterXXX has been invoked, where as
227 // this checks if a value exists for the path. 234 // this checks if a value exists for the path.
228 bool HasPrefPath(const char* path) const; 235 bool HasPrefPath(const char* path) const;
229 236
230 // Returns a dictionary with effective preference values. The ownership 237 // Returns a dictionary with effective preference values. The ownership
231 // is passed to the caller. 238 // is passed to the caller.
232 scoped_ptr<base::DictionaryValue> GetPreferenceValues() const; 239 scoped_ptr<base::DictionaryValue> GetPreferenceValues() const;
233 240
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 358
352 // Local cache of registered Preference objects. The pref_registry_ 359 // Local cache of registered Preference objects. The pref_registry_
353 // is authoritative with respect to what the types and default values 360 // is authoritative with respect to what the types and default values
354 // of registered preferences are. 361 // of registered preferences are.
355 mutable PreferenceMap prefs_map_; 362 mutable PreferenceMap prefs_map_;
356 363
357 DISALLOW_COPY_AND_ASSIGN(PrefService); 364 DISALLOW_COPY_AND_ASSIGN(PrefService);
358 }; 365 };
359 366
360 #endif // BASE_PREFS_PREF_SERVICE_H_ 367 #endif // BASE_PREFS_PREF_SERVICE_H_
OLDNEW
« no previous file with comments | « no previous file | base/prefs/pref_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698