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

Unified Diff: base/values.h

Issue 10035042: Rewrite base::JSONReader to be 35-40% faster, depending on the input string. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Really fix Windows, address comments Created 8 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/string_util.cc ('k') | base/values.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/values.h
diff --git a/base/values.h b/base/values.h
index 4bcdc7526e44b39352fdf1763e2ad4c04860a125..1d35d63934f8e93abba97295532c1fa54780b348 100644
--- a/base/values.h
+++ b/base/values.h
@@ -303,11 +303,12 @@ class BASE_EXPORT DictionaryValue : public Value {
// passed out via out_value. If |out_value| is NULL, the removed value will
// be deleted. This method returns true if |path| is a valid path; otherwise
// it will return false and the DictionaryValue object will be unchanged.
- bool Remove(const std::string& path, Value** out_value);
+ virtual bool Remove(const std::string& path, Value** out_value);
// Like Remove(), but without special treatment of '.'. This allows e.g. URLs
// to be used as paths.
- bool RemoveWithoutPathExpansion(const std::string& key, Value** out_value);
+ virtual bool RemoveWithoutPathExpansion(const std::string& key,
+ Value** out_value);
// Makes a copy of |this| but doesn't include empty dictionaries and lists in
// the copy. This never returns NULL, even if |this| itself is empty.
@@ -321,9 +322,7 @@ class BASE_EXPORT DictionaryValue : public Value {
void MergeDictionary(const DictionaryValue* dictionary);
// Swaps contents with the |other| dictionary.
- void Swap(DictionaryValue* other) {
- dictionary_.swap(other->dictionary_);
- }
+ virtual void Swap(DictionaryValue* other);
// This class provides an iterator for the keys in the dictionary.
// It can't be used to modify the dictionary.
@@ -425,7 +424,7 @@ class BASE_EXPORT ListValue : public Value {
// passed out via |out_value|. If |out_value| is NULL, the removed value will
// be deleted. This method returns true if |index| is valid; otherwise
// it will return false and the ListValue object will be unchanged.
- bool Remove(size_t index, Value** out_value);
+ virtual bool Remove(size_t index, Value** out_value);
// Removes the first instance of |value| found in the list, if any, and
// deletes it. |index| is the location where |value| was found. Returns false
@@ -450,9 +449,7 @@ class BASE_EXPORT ListValue : public Value {
const_iterator Find(const Value& value) const;
// Swaps contents with the |other| list.
- void Swap(ListValue* other) {
- list_.swap(other->list_);
- }
+ virtual void Swap(ListValue* other);
// Iteration.
iterator begin() { return list_.begin(); }
« no previous file with comments | « base/string_util.cc ('k') | base/values.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698