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(); } |