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

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: convert one more case in extension_webrequest_api_unittest.cc 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..e1d84c37775c50ff3329370ea28c0ffbc7c959c8 100644
--- a/chrome/test/automation/javascript_message_utils.h
+++ b/chrome/test/automation/javascript_message_utils.h
@@ -52,10 +52,10 @@ struct ValueConversionTraits<std::vector<T> > {
return value;
}
static bool SetFromValue(const Value* value, std::vector<T>* t) {
- if (!value->IsType(Value::TYPE_LIST))
+ const 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