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

Side by Side Diff: base/values.h

Issue 12092021: Remove PersistentPrefStore::MarkNeedsEmptyValue. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix some tests. 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
« no previous file with comments | « base/prefs/testing_pref_store.cc ('k') | base/values.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 file specifies a recursive data storage class called Value intended for 5 // This file specifies a recursive data storage class called Value intended for
6 // storing setting and other persistable data. It includes the ability to 6 // storing setting and other persistable data. It includes the ability to
7 // specify (recursive) lists and dictionaries, so it's fairly expressive. 7 // specify (recursive) lists and dictionaries, so it's fairly expressive.
8 // However, the API is optimized for the common case, namely storing a 8 // However, the API is optimized for the common case, namely storing a
9 // hierarchical tree of simple values. Given a DictionaryValue root, you can 9 // hierarchical tree of simple values. Given a DictionaryValue root, you can
10 // easily do things like: 10 // easily do things like:
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 // passed out via out_value. If |out_value| is NULL, the removed value will 315 // passed out via out_value. If |out_value| is NULL, the removed value will
316 // be deleted. This method returns true if |path| is a valid path; otherwise 316 // be deleted. This method returns true if |path| is a valid path; otherwise
317 // it will return false and the DictionaryValue object will be unchanged. 317 // it will return false and the DictionaryValue object will be unchanged.
318 virtual bool Remove(const std::string& path, Value** out_value); 318 virtual bool Remove(const std::string& path, Value** out_value);
319 319
320 // Like Remove(), but without special treatment of '.'. This allows e.g. URLs 320 // Like Remove(), but without special treatment of '.'. This allows e.g. URLs
321 // to be used as paths. 321 // to be used as paths.
322 virtual bool RemoveWithoutPathExpansion(const std::string& key, 322 virtual bool RemoveWithoutPathExpansion(const std::string& key,
323 Value** out_value); 323 Value** out_value);
324 324
325 // Removes a path, clearing out all dictionaries on |path| that remain empty
326 // after removing the value at |path|.
327 virtual bool RemovePath(const std::string& path, Value** out_value);
328
325 // Makes a copy of |this| but doesn't include empty dictionaries and lists in 329 // Makes a copy of |this| but doesn't include empty dictionaries and lists in
326 // the copy. This never returns NULL, even if |this| itself is empty. 330 // the copy. This never returns NULL, even if |this| itself is empty.
327 DictionaryValue* DeepCopyWithoutEmptyChildren(); 331 DictionaryValue* DeepCopyWithoutEmptyChildren();
328 332
329 // Merge |dictionary| into this dictionary. This is done recursively, i.e. any 333 // Merge |dictionary| into this dictionary. This is done recursively, i.e. any
330 // sub-dictionaries will be merged as well. In case of key collisions, the 334 // sub-dictionaries will be merged as well. In case of key collisions, the
331 // passed in dictionary takes precedence and data already present will be 335 // passed in dictionary takes precedence and data already present will be
332 // replaced. Values within |dictionary| are deep-copied, so |dictionary| may 336 // replaced. Values within |dictionary| are deep-copied, so |dictionary| may
333 // be freed any time after this call. 337 // be freed any time after this call.
334 void MergeDictionary(const DictionaryValue* dictionary); 338 void MergeDictionary(const DictionaryValue* dictionary);
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
525 529
526 } // namespace base 530 } // namespace base
527 531
528 // http://crbug.com/88666 532 // http://crbug.com/88666
529 using base::DictionaryValue; 533 using base::DictionaryValue;
530 using base::ListValue; 534 using base::ListValue;
531 using base::StringValue; 535 using base::StringValue;
532 using base::Value; 536 using base::Value;
533 537
534 #endif // BASE_VALUES_H_ 538 #endif // BASE_VALUES_H_
OLDNEW
« no previous file with comments | « base/prefs/testing_pref_store.cc ('k') | base/values.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698