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

Unified Diff: third_party/WebKit/Source/platform/inspector_protocol/DispatcherBase.cpp

Issue 2151083002: DevTools: explicitly differentiate ints vs doubles in the protocol bindings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: lcean Created 4 years, 5 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: third_party/WebKit/Source/platform/inspector_protocol/DispatcherBase.cpp
diff --git a/third_party/WebKit/Source/platform/inspector_protocol/DispatcherBase.cpp b/third_party/WebKit/Source/platform/inspector_protocol/DispatcherBase.cpp
index 2b375bcfcf215f1c944e092a8c45f5a782a6fe64..49422eba09a9ca12f0c037896ab173c95bd86a1d 100644
--- a/third_party/WebKit/Source/platform/inspector_protocol/DispatcherBase.cpp
+++ b/third_party/WebKit/Source/platform/inspector_protocol/DispatcherBase.cpp
@@ -73,7 +73,7 @@ void DispatcherBase::sendResponse(int callId, const ErrorString& invocationError
}
std::unique_ptr<protocol::DictionaryValue> responseMessage = DictionaryValue::create();
- responseMessage->setNumber("id", callId);
+ responseMessage->setInteger("id", callId);
responseMessage->setObject("result", std::move(result));
if (m_frontendChannel)
m_frontendChannel->sendProtocolResponse(callId, responseMessage->toJSONString());
@@ -92,14 +92,14 @@ void DispatcherBase::sendResponse(int callId, const ErrorString& invocationError
static void reportProtocolError(FrontendChannel* frontendChannel, int callId, DispatcherBase::CommonErrorCode code, const String16& errorMessage, ErrorSupport* errors)
{
std::unique_ptr<protocol::DictionaryValue> error = DictionaryValue::create();
- error->setNumber("code", code);
+ error->setInteger("code", code);
error->setString("message", errorMessage);
DCHECK(error);
if (errors && errors->hasErrors())
error->setString("data", errors->errors());
std::unique_ptr<protocol::DictionaryValue> message = DictionaryValue::create();
message->setObject("error", std::move(error));
- message->setNumber("id", callId);
+ message->setInteger("id", callId);
frontendChannel->sendProtocolResponse(callId, message->toJSONString());
}
@@ -143,7 +143,7 @@ void UberDispatcher::dispatch(const String16& message)
int callId = 0;
protocol::Value* callIdValue = messageObject->get("id");
- bool success = callIdValue->asNumber(&callId);
+ bool success = callIdValue->asInteger(&callId);
if (!success)
return;

Powered by Google App Engine
This is Rietveld 408576698