Index: base/values.cc |
diff --git a/base/values.cc b/base/values.cc |
index d3f0f922db51ad6ec38e11830a6237a62f373da5..f17431fce1f3c851d6375543f1bffa238a5ddf57 100644 |
--- a/base/values.cc |
+++ b/base/values.cc |
@@ -97,6 +97,10 @@ StringValue* Value::CreateStringValue(const string16& in_value) { |
return new StringValue(in_value); |
} |
+ListValue* Value::AsList() { |
+ return NULL; |
+} |
+ |
bool Value::GetAsBoolean(bool* out_value) const { |
return false; |
} |
@@ -508,7 +512,7 @@ bool DictionaryValue::GetList(const std::string& path, |
ListValue** out_value) const { |
Value* value; |
bool result = Get(path, &value); |
- if (!result || !value->IsType(TYPE_LIST)) |
+ if (!result || !value->AsList()) |
return false; |
if (out_value) |
@@ -586,7 +590,7 @@ bool DictionaryValue::GetListWithoutPathExpansion(const std::string& key, |
ListValue** out_value) const { |
Value* value; |
bool result = GetWithoutPathExpansion(key, &value); |
- if (!result || !value->IsType(TYPE_LIST)) |
+ if (!result || !value->AsList()) |
return false; |
if (out_value) |
@@ -799,7 +803,7 @@ bool ListValue::GetDictionary(size_t index, DictionaryValue** out_value) const { |
bool ListValue::GetList(size_t index, ListValue** out_value) const { |
Value* value; |
bool result = Get(index, &value); |
- if (!result || !value->IsType(TYPE_LIST)) |
+ if (!result || !value->AsList()) |
return false; |
if (out_value) |
@@ -862,6 +866,10 @@ bool ListValue::Insert(size_t index, Value* in_value) { |
return true; |
} |
+ListValue* ListValue::AsList() { |
+ return this; |
+} |
+ |
bool ListValue::GetAsList(ListValue** out_value) { |
if (out_value) |
*out_value = this; |