Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1900)

Unified Diff: chrome/test/automation/javascript_message_utils.h

Issue 7714004: base: Add AsList() function to Value API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more poor const_casts Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/test/automation/javascript_message_utils.h
diff --git a/chrome/test/automation/javascript_message_utils.h b/chrome/test/automation/javascript_message_utils.h
index e4b61f4d9961f222f192336398e99dd2dc185cf8..1ccdc17efff0f0a8983f7d82799337ab2f1b4d09 100644
--- a/chrome/test/automation/javascript_message_utils.h
+++ b/chrome/test/automation/javascript_message_utils.h
@@ -51,11 +51,11 @@ struct ValueConversionTraits<std::vector<T> > {
}
return value;
}
- static bool SetFromValue(const Value* value, std::vector<T>* t) {
- if (!value->IsType(Value::TYPE_LIST))
+ static bool SetFromValue(Value* value, std::vector<T>* t) {
+ ListValue* list_value = value->AsList();
+ if (!list_value)
return false;
- const ListValue* list_value = static_cast<const ListValue*>(value);
ListValue::const_iterator iter;
for (iter = list_value->begin(); iter != list_value->end(); ++iter) {
if (!ValueConversionTraits<T>::CanConvert(*iter))

Powered by Google App Engine
This is Rietveld 408576698