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

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

Issue 232563003: API functions returning Promises should not throw exceptions. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 8 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_types.py
diff --git a/Source/bindings/scripts/v8_types.py b/Source/bindings/scripts/v8_types.py
index 46b011633307efbfe35c45d7f6cdf857d2a4e7a0..5b062a9423379c4d9c897aafa9b17d85f47aee04 100644
--- a/Source/bindings/scripts/v8_types.py
+++ b/Source/bindings/scripts/v8_types.py
@@ -223,6 +223,7 @@ def v8_type(interface_name):
# compute_interfaces_info.py to avoid having to parse IDLs of all used interfaces.
IdlType.implemented_as_interfaces = {}
+
def implemented_as(idl_type):
base_idl_type = idl_type.base_type
if base_idl_type in IdlType.implemented_as_interfaces:
@@ -427,7 +428,7 @@ def v8_value_to_cpp_value_array_or_sequence(array_or_sequence_type, v8_value, in
return expression
-def v8_value_to_local_cpp_value(idl_type, extended_attributes, v8_value, variable_name, index=None):
+def v8_value_to_local_cpp_value(idl_type, extended_attributes, v8_value, variable_name, index=None, async=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, used_as_argument=True)
@@ -442,8 +443,13 @@ def v8_value_to_local_cpp_value(idl_type, extended_attributes, v8_value, variabl
else:
macro = 'TONATIVE_VOID'
+ if async:
+ macro += '_ASYNC'
+ args.append('info')
+
return '%s(%s)' % (macro, ', '.join(args))
+
IdlType.v8_value_to_local_cpp_value = v8_value_to_local_cpp_value
IdlUnionType.v8_value_to_local_cpp_value = v8_value_to_local_cpp_value

Powered by Google App Engine
This is Rietveld 408576698