Index: base/values.h |
diff --git a/base/values.h b/base/values.h |
index 026fcf664b0510c884f08c4368b0aa52c2b229ef..1f9be142b4ceeaac1d1f280e24b5b2359fe1b4af 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. |
@@ -320,9 +321,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. |
@@ -424,7 +423,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 |
@@ -449,9 +448,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(); } |