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

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..499932512256d46a6ddb0791b42a03cbb4a6776a 100644
--- a/Source/bindings/scripts/code_generator_v8.py
+++ b/Source/bindings/scripts/code_generator_v8.py
@@ -84,6 +84,8 @@ CPP_TYPE_SPECIAL_CONVERSION_RULES = {
'byte': 'int',
'boolean': 'bool',
'DOMString': 'const String&',
+ 'Promise': 'ScriptPromise',
+ 'PromiseResolver': 'ScriptPromiseResolver',
}
CPP_UNSIGNED_TYPES = set([
'octet',
@@ -211,6 +213,10 @@ 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 data_type == 'PromiseResolver':
+ return set(['ScriptPromiseResolver.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