Index: chrome/test/webdriver/webdriver_dispatch.cc |
diff --git a/chrome/test/webdriver/webdriver_dispatch.cc b/chrome/test/webdriver/webdriver_dispatch.cc |
index e079f12ec0a24c478d502e4a3a2dcbf7f06012d7..a9dcd4a4ee12cfa2d5f19a4a3f464a11efd32951 100644 |
--- a/chrome/test/webdriver/webdriver_dispatch.cc |
+++ b/chrome/test/webdriver/webdriver_dispatch.cc |
@@ -152,7 +152,7 @@ void PrepareHttpResponse(const Response& command_response, |
// and kMethodNotAllowed should be detected before creating |
// a command_response, and should thus not need conversion. |
case kSeeOther: { |
- Value* value = command_response.GetValue(); |
+ const Value* const value = command_response.GetValue(); |
std::string location; |
if (!value->GetAsString(&location)) { |
// This should never happen. |
@@ -173,9 +173,8 @@ void PrepareHttpResponse(const Response& command_response, |
break; |
case kMethodNotAllowed: { |
- Value* value = command_response.GetValue(); |
- ListValue* list_value = value->AsList(); |
- if (!list_value) { |
+ const Value* const value = command_response.GetValue(); |
+ if (!value->IsType(Value::TYPE_LIST)) { |
// This should never happen. |
http_response->set_status(HttpResponse::kInternalServerError); |
http_response->SetBody( |
@@ -184,6 +183,8 @@ 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; |