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

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

Issue 23479016: Introduce Promise mapping to the IDL generator (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add hasNoValue Created 7 years, 3 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 | « Source/bindings/scripts/deprecated_idl_parser.pm ('k') | Source/bindings/v8/ScriptPromise.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/scripts/v8_types.py
diff --git a/Source/bindings/scripts/v8_types.py b/Source/bindings/scripts/v8_types.py
index 40316ae0841428564e1d7829780836432bf7117b..b8c0095be93a2cc03fe18837c4d11f0455eb1d4a 100644
--- a/Source/bindings/scripts/v8_types.py
+++ b/Source/bindings/scripts/v8_types.py
@@ -46,9 +46,14 @@ CPP_UNSIGNED_TYPES = set([
'unsigned long',
'unsigned short',
])
+# Promise is not yet in the Web IDL spec but is going to be speced
+# as primitive types in the future.
+# Since V8 dosn't provide Promise primitive object currently,
+# PRIMITIVE_TYPES doesn't contain Promise.
CPP_TYPE_SPECIAL_CONVERSION_RULES = {
'boolean': 'bool',
'DOMString': 'const String&',
+ 'Promise': 'ScriptPromise',
}
PRIMITIVE_TYPES = set([
# http://www.w3.org/TR/WebIDL/#dfn-primitive-type
@@ -164,6 +169,8 @@ def v8_set_return_value(idl_type, cpp_value, callback_info=''):
def includes_for_type(idl_type):
if primitive_type(idl_type) or idl_type == 'DOMString':
return set()
+ if idl_type == 'Promise':
+ return set(['ScriptPromise.h'])
this_array_or_sequence_type = array_or_sequence_type(idl_type)
if this_array_or_sequence_type:
return includes_for_type(this_array_or_sequence_type)
« no previous file with comments | « Source/bindings/scripts/deprecated_idl_parser.pm ('k') | Source/bindings/v8/ScriptPromise.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698