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/idl_types.py

Issue 386963003: [WIP][NotForLand] IDL dictionary support (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 5 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/idl_types.py
diff --git a/Source/bindings/scripts/idl_types.py b/Source/bindings/scripts/idl_types.py
index 00c3e7edd5682c5ff1dbdf191af1fbec4d4bdac3..098a65e5a50bb91b4370a2f492bf0d688569b408 100644
--- a/Source/bindings/scripts/idl_types.py
+++ b/Source/bindings/scripts/idl_types.py
@@ -105,6 +105,7 @@ class IdlType(object):
# as orthogonal properties (via flags).
callback_functions = set()
callback_interfaces = set()
+ dictionaries = set()
enums = {} # name -> values
def __init__(self, base_type, is_array=False, is_sequence=False, is_nullable=False, is_unrestricted=False):
@@ -159,6 +160,10 @@ class IdlType(object):
return self.base_type in IdlType.callback_interfaces
@property
+ def is_dictionary(self):
+ return self.base_type in IdlType.dictionaries
+
+ @property
def is_composite_type(self):
return (self.name == 'Any' or
self.array_element_type or
@@ -196,6 +201,7 @@ class IdlType(object):
return not(self.is_basic_type or
self.is_composite_type or
self.is_callback_function or
+ self.is_dictionary or
self.is_enum or
self.name == 'Object' or
self.name == 'Promise') # Promise will be basic in future
@@ -242,6 +248,10 @@ class IdlType(object):
cls.callback_interfaces.update(new_callback_interfaces)
@classmethod
+ def set_dictionaries(cls, new_dictionaries):
+ cls.dictionaries.update(new_dictionaries)
+
+ @classmethod
def set_enums(cls, new_enums):
cls.enums.update(new_enums)
@@ -305,6 +315,10 @@ class IdlUnionType(object):
return False
@property
+ def is_dictionary(self):
+ return False
+
+ @property
def is_enum(self):
return False

Powered by Google App Engine
This is Rietveld 408576698