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

Unified Diff: chrome/test/webdriver/webdriver_dispatch.cc

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/webdriver/webdriver_dispatch.cc
diff --git a/chrome/test/webdriver/webdriver_dispatch.cc b/chrome/test/webdriver/webdriver_dispatch.cc
index a9dcd4a4ee12cfa2d5f19a4a3f464a11efd32951..0a5b03aa6594a6ff688942839c128123996808ad 100644
--- a/chrome/test/webdriver/webdriver_dispatch.cc
+++ b/chrome/test/webdriver/webdriver_dispatch.cc
@@ -173,8 +173,9 @@ void PrepareHttpResponse(const Response& command_response,
break;
case kMethodNotAllowed: {
- const Value* const value = command_response.GetValue();
- if (!value->IsType(Value::TYPE_LIST)) {
+ Value* value = command_response.GetValue();
+ const ListValue* list_value = value->AsList();
+ if (!list_value) {
// This should never happen.
http_response->set_status(HttpResponse::kInternalServerError);
http_response->SetBody(
@@ -183,8 +184,6 @@ void PrepareHttpResponse(const Response& command_response,
return;
}
- const ListValue* const list_value =
- static_cast<const ListValue* const>(value);
std::vector<std::string> allowed_methods;
for (size_t i = 0; i < list_value->GetSize(); ++i) {
std::string method;

Powered by Google App Engine
This is Rietveld 408576698