Index: base/values.cc |
diff --git a/base/values.cc b/base/values.cc |
index 4719741a12cccabbb05e3af138baa01167ee8b3a..8d7ca351d1e9cc6db28489f822a9f341906f04b5 100644 |
--- a/base/values.cc |
+++ b/base/values.cc |
@@ -143,6 +143,14 @@ bool Value::GetAsList(const ListValue** out_value) const { |
return false; |
} |
+bool Value::GetAsDictionary(DictionaryValue** out_value) { |
+ return false; |
+} |
+ |
+bool Value::GetAsDictionary(const DictionaryValue** out_value) const { |
+ return false; |
+} |
+ |
Value* Value::DeepCopy() const { |
// This method should only be getting called for null Values--all subclasses |
// need to provide their own implementation;. |
@@ -345,6 +353,18 @@ DictionaryValue::~DictionaryValue() { |
Clear(); |
} |
+bool DictionaryValue::GetAsDictionary(DictionaryValue** out_value) { |
+ if (out_value) |
+ *out_value = this; |
+ return true; |
+} |
+ |
+bool DictionaryValue::GetAsDictionary(const DictionaryValue** out_value) const { |
+ if (out_value) |
+ *out_value = this; |
+ return true; |
+} |
+ |
bool DictionaryValue::HasKey(const std::string& key) const { |
DCHECK(IsStringUTF8(key)); |
ValueMap::const_iterator current_entry = dictionary_.find(key); |