| Index: chrome/browser/devtools/devtools_protocol.cc
|
| diff --git a/chrome/browser/devtools/devtools_protocol.cc b/chrome/browser/devtools/devtools_protocol.cc
|
| index 5ba6a2213d58601d352c13e968dad2e3f5f8de8a..c6c8dad7545a74ebe5e80bc00a2c92caff049d45 100644
|
| --- a/chrome/browser/devtools/devtools_protocol.cc
|
| +++ b/chrome/browser/devtools/devtools_protocol.cc
|
| @@ -22,7 +22,7 @@ const char kParamsParam[] = "params";
|
| const char kResultParam[] = "result";
|
|
|
| // JSON RPC 2.0 spec: http://www.jsonrpc.org/specification#error_object
|
| -enum Error { kErrorInvalidParams = -32602 };
|
| +enum Error { kErrorInvalidParams = -32602, kErrorServerError = -32000 };
|
|
|
| } // namespace
|
|
|
| @@ -58,6 +58,20 @@ DevToolsProtocol::CreateInvalidParamsResponse(int command_id,
|
| }
|
|
|
| // static
|
| +std::unique_ptr<base::DictionaryValue> DevToolsProtocol::CreateErrorResponse(
|
| + int command_id,
|
| + const std::string& error_message) {
|
| + std::unique_ptr<base::DictionaryValue> response(new base::DictionaryValue());
|
| + response->SetInteger(kIdParam, command_id);
|
| + auto error_object = base::MakeUnique<base::DictionaryValue>();
|
| + error_object->SetInteger(kErrorCodeParam, kErrorServerError);
|
| + error_object->SetString(kErrorMessageParam, error_message);
|
| + response->Set(kErrorParam, std::move(error_object));
|
| +
|
| + return response;
|
| +}
|
| +
|
| +// static
|
| std::unique_ptr<base::DictionaryValue> DevToolsProtocol::CreateSuccessResponse(
|
| int command_id,
|
| std::unique_ptr<base::DictionaryValue> result) {
|
|
|