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

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

Issue 808373002: IDL: Simplify [TypeChecking=Interface] code generation (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years 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_types.py
diff --git a/Source/bindings/scripts/v8_types.py b/Source/bindings/scripts/v8_types.py
index 2027056702cf4dbf4c56a5882527250660aceb4f..6f5c44a3729290ec14ab6b280c3ba203b131b1d4 100644
--- a/Source/bindings/scripts/v8_types.py
+++ b/Source/bindings/scripts/v8_types.py
@@ -529,7 +529,7 @@ def v8_conversion_is_trivial(idl_type):
IdlType.v8_conversion_is_trivial = property(v8_conversion_is_trivial)
-def v8_value_to_cpp_value(idl_type, extended_attributes, v8_value, variable_name, needs_type_check, index, isolate):
+def v8_value_to_cpp_value(idl_type, extended_attributes, v8_value, variable_name, index, isolate):
if idl_type.name == 'void':
return ''
@@ -562,12 +562,9 @@ def v8_value_to_cpp_value(idl_type, extended_attributes, v8_value, variable_name
if idl_type.includes_nullable_type:
base_idl_type = idl_type.cpp_type + 'OrNull'
cpp_expression_format = 'V8{idl_type}::toImpl({isolate}, {v8_value}, {variable_name}, exceptionState)'
- elif needs_type_check:
- cpp_expression_format = (
- 'V8{idl_type}::toImplWithTypeCheck({isolate}, {v8_value})')
else:
cpp_expression_format = (
- 'V8{idl_type}::toImpl(v8::Handle<v8::Object>::Cast({v8_value}))')
+ 'V8{idl_type}::toImplWithTypeCheck({isolate}, {v8_value})')
return cpp_expression_format.format(arguments=arguments, idl_type=base_idl_type, v8_value=v8_value, variable_name=variable_name, isolate=isolate)
@@ -594,7 +591,7 @@ def v8_value_to_cpp_value_array_or_sequence(native_array_element_type, v8_value,
# FIXME: this function should be refactored, as this takes too many flags.
-def v8_value_to_local_cpp_value(idl_type, extended_attributes, v8_value, variable_name=None, needs_type_check=True, index=None, declare_variable=True, isolate='info.GetIsolate()', used_in_private_script=False, return_promise=False, needs_exception_state_for_string=False):
+def v8_value_to_local_cpp_value(idl_type, extended_attributes, v8_value, variable_name=None, index=None, declare_variable=True, isolate='info.GetIsolate()', used_in_private_script=False, return_promise=False, needs_exception_state_for_string=False):
"""Returns an expression that converts a V8 value to a C++ value and stores it as a local value."""
this_cpp_type = idl_type.cpp_type_args(extended_attributes=extended_attributes, raw_type=True)
@@ -603,7 +600,7 @@ def v8_value_to_local_cpp_value(idl_type, extended_attributes, v8_value, variabl
if idl_type.base_type in ('void', 'object', 'EventHandler', 'EventListener'):
return '/* no V8 -> C++ conversion for IDL type: %s */' % idl_type.name
- cpp_value = v8_value_to_cpp_value(idl_type, extended_attributes, v8_value, variable_name, needs_type_check, index, isolate)
+ cpp_value = v8_value_to_cpp_value(idl_type, extended_attributes, v8_value, variable_name, index, isolate)
if idl_type.is_dictionary or idl_type.is_union_type:
return 'TONATIVE_VOID_EXCEPTIONSTATE_ARGINTERNAL(%s, exceptionState)' % cpp_value

Powered by Google App Engine
This is Rietveld 408576698