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

Side by Side Diff: third_party/WebKit/Source/bindings/scripts/idl_definitions.py

Issue 2290113002: Add extended attributes to IdlCallbackFunction (Closed)
Patch Set: Addressed comments Created 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (C) 2013 Google Inc. All rights reserved. 1 # Copyright (C) 2013 Google Inc. All rights reserved.
2 # 2 #
3 # Redistribution and use in source and binary forms, with or without 3 # Redistribution and use in source and binary forms, with or without
4 # modification, are permitted provided that the following conditions are 4 # modification, are permitted provided that the following conditions are
5 # met: 5 # met:
6 # 6 #
7 # * Redistributions of source code must retain the above copyright 7 # * Redistributions of source code must retain the above copyright
8 # notice, this list of conditions and the following disclaimer. 8 # notice, this list of conditions and the following disclaimer.
9 # * Redistributions in binary form must reproduce the above 9 # * Redistributions in binary form must reproduce the above
10 # copyright notice, this list of conditions and the following disclaimer 10 # copyright notice, this list of conditions and the following disclaimer
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 166
167 167
168 ################################################################################ 168 ################################################################################
169 # Callback Functions 169 # Callback Functions
170 ################################################################################ 170 ################################################################################
171 171
172 class IdlCallbackFunction(TypedObject): 172 class IdlCallbackFunction(TypedObject):
173 def __init__(self, idl_name, node): 173 def __init__(self, idl_name, node):
174 children = node.GetChildren() 174 children = node.GetChildren()
175 num_children = len(children) 175 num_children = len(children)
176 if num_children != 2: 176 self.extended_attributes = {}
177 raise ValueError('Expected 2 children, got %s' % num_children) 177 if num_children < 2 or num_children > 3:
178 type_node, arguments_node = children 178 raise ValueError('Expected 2 or 3 children, got %s' % num_children)
179 type_node = children[0]
180 arguments_node = children[1]
181 if num_children == 3:
182 ext_attributes_node = children[2]
183 self.extended_attributes = (
184 ext_attributes_node_to_extended_attributes(idl_name, ext_attribu tes_node))
185 else:
186 self.extended_attributes = {}
Yuki 2016/08/30 05:59:41 You already set self.extended_attributes on line 1
lkawai 2016/08/30 06:20:58 Done.
179 arguments_node_class = arguments_node.GetClass() 187 arguments_node_class = arguments_node.GetClass()
180 if arguments_node_class != 'Arguments': 188 if arguments_node_class != 'Arguments':
181 raise ValueError('Expected Arguments node, got %s' % arguments_node_ class) 189 raise ValueError('Expected Arguments node, got %s' % arguments_node_ class)
182 190
183 self.idl_name = idl_name 191 self.idl_name = idl_name
184 self.name = node.GetName() 192 self.name = node.GetName()
185 self.idl_type = type_node_to_type(type_node) 193 self.idl_type = type_node_to_type(type_node)
186 self.arguments = arguments_node_to_arguments(idl_name, arguments_node) 194 self.arguments = arguments_node_to_arguments(idl_name, arguments_node)
187 195
188 def accept(self, visitor): 196 def accept(self, visitor):
(...skipping 930 matching lines...) Expand 10 before | Expand all | Expand 10 after
1119 self.visit_typed_object(argument) 1127 self.visit_typed_object(argument)
1120 1128
1121 def visit_iterable(self, iterable): 1129 def visit_iterable(self, iterable):
1122 self.visit_typed_object(iterable) 1130 self.visit_typed_object(iterable)
1123 1131
1124 def visit_maplike(self, maplike): 1132 def visit_maplike(self, maplike):
1125 self.visit_typed_object(maplike) 1133 self.visit_typed_object(maplike)
1126 1134
1127 def visit_setlike(self, setlike): 1135 def visit_setlike(self, setlike):
1128 self.visit_typed_object(setlike) 1136 self.visit_typed_object(setlike)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698