Index: chrome/test/automation/value_conversion_traits.cc |
diff --git a/chrome/test/automation/value_conversion_traits.cc b/chrome/test/automation/value_conversion_traits.cc |
index 16d6510355f55ee26f3aef2747756cc495260ac3..f5c1f2c00ac66f7278b5cffa3243705ed2ac72dd 100644 |
--- a/chrome/test/automation/value_conversion_traits.cc |
+++ b/chrome/test/automation/value_conversion_traits.cc |
@@ -71,15 +71,14 @@ Value* ValueConversionTraits<ListValue*>::CreateValueFrom(const ListValue* t) { |
bool ValueConversionTraits<ListValue*>::SetFromValue(const Value* value, |
ListValue** t) { |
- ListValue* list = const_cast<Value*>(value)->AsList(); |
- if (!list) |
+ if (!value->IsType(Value::TYPE_LIST)) |
return false; |
- *t = list->DeepCopy(); |
+ *t = static_cast<const ListValue*>(value)->DeepCopy(); |
return true; |
} |
bool ValueConversionTraits<ListValue*>::CanConvert(const Value* value) { |
- return const_cast<Value*>(value)->AsList(); |
+ return value->IsType(Value::TYPE_LIST); |
} |
Value* ValueConversionTraits<DictionaryValue*>::CreateValueFrom( |