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

Unified Diff: third_party/WebKit/Source/platform/inspector_protocol/ValueConversions.h

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/ValueConversions.h
diff --git a/third_party/WebKit/Source/platform/inspector_protocol/ValueConversions.h b/third_party/WebKit/Source/platform/inspector_protocol/ValueConversions.h
index df72ed8414f88c56c41cac54026cd3db182c39f5..dd7b2e786410549f7a9010a8349f32e61883d9c7 100644
--- a/third_party/WebKit/Source/platform/inspector_protocol/ValueConversions.h
+++ b/third_party/WebKit/Source/platform/inspector_protocol/ValueConversions.h
@@ -64,7 +64,7 @@ struct FromValue<int> {
static int parse(protocol::Value* value, ErrorSupport* errors)
{
int result = 0;
- bool success = value ? value->asNumber(&result) : false;
+ bool success = value ? value->asInteger(&result) : false;
if (!success)
errors->addError("integer value expected");
return result;
@@ -76,7 +76,7 @@ struct FromValue<double> {
static double parse(protocol::Value* value, ErrorSupport* errors)
{
double result = 0;
- bool success = value ? value->asNumber(&result) : false;
+ bool success = value ? value->asDouble(&result) : false;
if (!success)
errors->addError("double value expected");
return result;

Powered by Google App Engine
This is Rietveld 408576698