Skip to content

Commit

Permalink
DevTools: always return result:{} object for non-errouneous responses.
Browse files Browse the repository at this point in the history
BUG=398041

Review URL: https://codereview.chromium.org/429533002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@286332 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
pfeldman@chromium.org committed Jul 29, 2014
1 parent fde50c7 commit 5970e4c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
7 changes: 5 additions & 2 deletions chrome/browser/devtools/devtools_protocol.cc
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,11 @@ base::DictionaryValue* DevToolsProtocol::Response::Serialize() {
error_object->SetInteger(kErrorCodeParam, error_code_);
if (!error_message_.empty())
error_object->SetString(kErrorMessageParam, error_message_);
} else if (result_) {
response->Set(kResultParam, result_->DeepCopy());
} else {
if (result_)
response->Set(kResultParam, result_->DeepCopy());
else
response->Set(kResultParam, new base::DictionaryValue());
}

return response;
Expand Down
7 changes: 5 additions & 2 deletions content/browser/devtools/devtools_protocol.cc
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,11 @@ std::string DevToolsProtocol::Response::Serialize() {
error_object->SetInteger(kErrorCodeParam, error_code_);
if (!error_message_.empty())
error_object->SetString(kErrorMessageParam, error_message_);
} else if (result_) {
response.Set(kResultParam, result_->DeepCopy());
} else {
if (result_)
response.Set(kResultParam, result_->DeepCopy());
else
response.Set(kResultParam, new base::DictionaryValue());
}

std::string json_response;
Expand Down

0 comments on commit 5970e4c

Please sign in to comment.