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

Unified Diff: third_party/WebKit/Source/platform/inspector_protocol/TypeBuilder_cpp.template

Issue 1730383003: DevTools: consistently use Maybe for optional values in the protocol generator. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments addressed Created 4 years, 10 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/TypeBuilder_cpp.template
diff --git a/third_party/WebKit/Source/platform/inspector_protocol/TypeBuilder_cpp.template b/third_party/WebKit/Source/platform/inspector_protocol/TypeBuilder_cpp.template
index 96db1577221ec1589daab6ddb4cb04593b9918e0..674e7a8737b846b84d88bc147d9560cc5b23595a 100644
--- a/third_party/WebKit/Source/platform/inspector_protocol/TypeBuilder_cpp.template
+++ b/third_party/WebKit/Source/platform/inspector_protocol/TypeBuilder_cpp.template
@@ -9,16 +9,10 @@
namespace blink {
namespace protocol {
-template<>
-PassRefPtr<JSONValue> toValue(const String& param)
-{
- return JSONString::create(param);
-}
-
-OptionalValue<String> optional(const String& value)
-{
- return value.isNull() ? OptionalValue<String>() : OptionalValue<String>(value);
-}
+PassRefPtr<JSONValue> toValue(int value) { return JSONBasicValue::create(value); }
+PassRefPtr<JSONValue> toValue(double value) { return JSONBasicValue::create(value); }
+PassRefPtr<JSONValue> toValue(bool value) { return JSONBasicValue::create(value); }
+PassRefPtr<JSONValue> toValue(const String& param) { return JSONString::create(param); }
// ------------- Enum values from types.
{% for domain in api.domains %}

Powered by Google App Engine
This is Rietveld 408576698