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

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

Issue 409373002: IDL: Binding code generation for dictionaries (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_definitions.py
diff --git a/Source/bindings/scripts/idl_definitions.py b/Source/bindings/scripts/idl_definitions.py
index ab3b0c500df1f67c40d8160de7fa0c2a832dface..69e7c2655d1cbfb61fba08f25d9e787c300b83fb 100644
--- a/Source/bindings/scripts/idl_definitions.py
+++ b/Source/bindings/scripts/idl_definitions.py
@@ -206,15 +206,20 @@ class IdlCallbackFunction(TypedObject):
class IdlDictionary(object):
def __init__(self, node):
- self.parent = None
+ self.extended_attributes = {}
+ self.is_partial = node.GetProperty('Partial') or False
self.name = node.GetName()
self.members = []
+ self.parent = None
for child in node.GetChildren():
child_class = child.GetClass()
if child_class == 'Inherit':
self.parent = child.GetName()
elif child_class == 'Key':
self.members.append(IdlDictionaryMember(child))
+ elif child_class == 'ExtAttributes':
+ self.extended_attributes = (
+ ext_attributes_node_to_extended_attributes(child))
else:
raise ValueError('Unrecognized node class: %s' % child_class)
@@ -230,9 +235,10 @@ class IdlDictionaryMember(object):
if child_class == 'Type':
self.idl_type = type_node_to_type(child)
elif child_class == 'Default':
- self.default_value = child.GetProperty('VALUE')
+ self.default_value = default_node_to_idl_literal(child)
elif child_class == 'ExtAttributes':
- self.extended_attributes = ext_attributes_node_to_extended_attributes(child)
+ self.extended_attributes = (
+ ext_attributes_node_to_extended_attributes(child))
else:
raise ValueError('Unrecognized node class: %s' % child_class)
« no previous file with comments | « Source/bindings/scripts/compute_interfaces_info_individual.py ('k') | Source/bindings/scripts/idl_reader.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698