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

Unified Diff: content/browser/devtools/devtools_protocol.cc

Issue 300703002: DevToolsProtocol: fix content Response::Parse. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/devtools/devtools_protocol.cc
diff --git a/content/browser/devtools/devtools_protocol.cc b/content/browser/devtools/devtools_protocol.cc
index e6800e702c8f776225ce8c7e83cccc1d00187197..c5d163e143e14c868245dbecc7664074bfabcd94 100644
--- a/content/browser/devtools/devtools_protocol.cc
+++ b/content/browser/devtools/devtools_protocol.cc
@@ -259,11 +259,10 @@ DevToolsProtocol::ParseResponse(
if (!response_dict->GetInteger(kIdParam, &id))
id = kNoId;
- int error_code;
- if (!response_dict->GetInteger(kErrorCodeParam, &error_code))
- return new Response(id, kErrorInternalError, "Invalid response");
-
- if (error_code) {
+ const base::DictionaryValue* error_dict;
+ if (response_dict->GetDictionary(kErrorParam, &error_dict)) {
+ int error_code = kErrorInternalError;
+ response_dict->GetInteger(kErrorCodeParam, &error_code);
std::string error_message;
response_dict->GetString(kErrorMessageParam, &error_message);
return new Response(id, error_code, error_message);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698