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

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

Issue 860353002: IDL: Add toRestricted{Float,Double}() helpers to V8Binding.h (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: add FIXME comment Created 5 years, 11 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: Source/bindings/scripts/v8_methods.py
diff --git a/Source/bindings/scripts/v8_methods.py b/Source/bindings/scripts/v8_methods.py
index dc506e957cfa56700b1fabcd9eb985b86902af0d..cf33213bc8976e6ca3e039b40049df93fc899205 100644
--- a/Source/bindings/scripts/v8_methods.py
+++ b/Source/bindings/scripts/v8_methods.py
@@ -198,6 +198,10 @@ def argument_context(interface, method, argument, index):
has_extended_attribute_value(method, 'TypeChecking', 'Interface')) and
idl_type.is_wrapper_type)
+ restricted_float = (
+ has_extended_attribute_value(interface, 'TypeChecking', 'Unrestricted') or
+ has_extended_attribute_value(method, 'TypeChecking', 'Unrestricted'))
+
if ('ImplementedInPrivateScript' in extended_attributes and
not idl_type.is_wrapper_type and
not idl_type.is_basic_type):
@@ -216,10 +220,6 @@ def argument_context(interface, method, argument, index):
# FIXME: remove once [Default] removed and just use argument.default_value
'has_default': 'Default' in extended_attributes or set_default_value,
'has_type_checking_interface': type_checking_interface,
- 'has_type_checking_unrestricted':
- (has_extended_attribute_value(interface, 'TypeChecking', 'Unrestricted') or
- has_extended_attribute_value(method, 'TypeChecking', 'Unrestricted')) and
- idl_type.name in ('Float', 'Double'),
# Dictionary is special-cased, but arrays and sequences shouldn't be
'idl_type': idl_type.base_type,
'idl_type_object': idl_type,
@@ -240,7 +240,7 @@ def argument_context(interface, method, argument, index):
'use_permissive_dictionary_conversion': 'PermissiveDictionaryConversion' in extended_attributes,
'v8_set_return_value': v8_set_return_value(interface.name, method, this_cpp_value),
'v8_set_return_value_for_main_world': v8_set_return_value(interface.name, method, this_cpp_value, for_main_world=True),
- 'v8_value_to_local_cpp_value': v8_value_to_local_cpp_value(argument, index, return_promise=method.returns_promise),
+ 'v8_value_to_local_cpp_value': v8_value_to_local_cpp_value(argument, index, return_promise=method.returns_promise, restricted_float=restricted_float),
'vector_type': v8_types.cpp_ptr_type('Vector', 'HeapVector', idl_type.gc_type),
}
@@ -367,7 +367,7 @@ def v8_value_to_local_cpp_variadic_value(argument, index, return_promise):
return '%s%s(%s)' % (macro, suffix, ', '.join(macro_args))
-def v8_value_to_local_cpp_value(argument, index, return_promise=False):
+def v8_value_to_local_cpp_value(argument, index, return_promise=False, restricted_float=False):
extended_attributes = argument.extended_attributes
idl_type = argument.idl_type
name = argument.name
@@ -375,7 +375,8 @@ def v8_value_to_local_cpp_value(argument, index, return_promise=False):
return v8_value_to_local_cpp_variadic_value(argument, index, return_promise)
return idl_type.v8_value_to_local_cpp_value(extended_attributes, 'info[%s]' % index,
name, index=index, declare_variable=False,
- return_promise=return_promise)
+ return_promise=return_promise,
+ restricted_float=restricted_float)
################################################################################

Powered by Google App Engine
This is Rietveld 408576698