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

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

Issue 23479016: Introduce Promise mapping to the IDL generator (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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
Index: Source/bindings/scripts/code_generator_v8.py
diff --git a/Source/bindings/scripts/code_generator_v8.py b/Source/bindings/scripts/code_generator_v8.py
index 0e647b49f749dc6951e431c48ed5340f24398a0a..1231a5bb49256d06b62f84c78d8d02bf015a0395 100644
--- a/Source/bindings/scripts/code_generator_v8.py
+++ b/Source/bindings/scripts/code_generator_v8.py
@@ -84,6 +84,7 @@ CPP_TYPE_SPECIAL_CONVERSION_RULES = {
'byte': 'int',
'boolean': 'bool',
'DOMString': 'const String&',
+ 'Promise': 'ScriptPromise',
}
CPP_UNSIGNED_TYPES = set([
'octet',
@@ -91,10 +92,13 @@ 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.
PRIMITIVE_TYPES = set([
'boolean',
'void',
'Date',
+ 'Promise',
'byte',
'octet',
'short',
@@ -211,6 +215,8 @@ def uncapitalize(name):
def includes_for_type(data_type):
if primitive_type(data_type) or data_type == 'DOMString':
return set()
+ if data_type == 'Promise':
+ return set(['ScriptPromise.h'])
if array_or_sequence_type(data_type):
return includes_for_type(array_or_sequence_type(data_type))
return set(['V8%s.h' % data_type])

Powered by Google App Engine
This is Rietveld 408576698