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

Unified Diff: Source/bindings/scripts/v8_methods.py

Issue 954723002: [bindings] Support is_explicit_nullable for method arguments. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Review comments addressed! Created 5 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
« no previous file with comments | « no previous file | Source/bindings/scripts/v8_types.py » ('j') | Source/bindings/templates/methods.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/scripts/v8_methods.py
diff --git a/Source/bindings/scripts/v8_methods.py b/Source/bindings/scripts/v8_methods.py
index f4253981e4a1c54c1e5af8d2c26bf4a0446f0e82..9e655f3a854f6c1cb728a34352f760e4cae849f4 100644
--- a/Source/bindings/scripts/v8_methods.py
+++ b/Source/bindings/scripts/v8_methods.py
@@ -212,9 +212,13 @@ def argument_context(interface, method, argument, index):
set_default_value = argument.set_default_value
return {
- 'cpp_type': idl_type.cpp_type_args(extended_attributes=extended_attributes,
- raw_type=True,
- used_as_variadic_argument=argument.is_variadic),
+ 'cpp_type': (
+ v8_types.cpp_template_type('Nullable', idl_type.cpp_type)
+ if idl_type.is_explicit_nullable
+ else idl_type.cpp_type_args(
Jens Widell 2015/03/02 07:53:13 I think it would be better to move this call to id
+ extended_attributes=extended_attributes,
+ raw_type=True,
+ used_as_variadic_argument=argument.is_variadic)),
'cpp_value': this_cpp_value,
# FIXME: check that the default value's type is compatible with the argument's
'set_default_value': set_default_value,
@@ -231,6 +235,7 @@ def argument_context(interface, method, argument, index):
'is_callback_interface': idl_type.is_callback_interface,
# FIXME: Remove generic 'Dictionary' special-casing
'is_dictionary': idl_type.is_dictionary or idl_type.base_type == 'Dictionary',
+ 'is_explicit_nullable': idl_type.is_explicit_nullable,
'is_nullable': idl_type.is_nullable,
'is_optional': argument.is_optional,
'is_variadic': argument.is_variadic,
« no previous file with comments | « no previous file | Source/bindings/scripts/v8_types.py » ('j') | Source/bindings/templates/methods.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698