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

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

Issue 1383093002: [bindings] support legacyiterable<> WebIDL syntax (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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
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 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 self.attributes = [] 279 self.attributes = []
280 self.constants = [] 280 self.constants = []
281 self.constructors = [] 281 self.constructors = []
282 self.custom_constructors = [] 282 self.custom_constructors = []
283 self.extended_attributes = {} 283 self.extended_attributes = {}
284 self.operations = [] 284 self.operations = []
285 self.parent = None 285 self.parent = None
286 self.serializer = None 286 self.serializer = None
287 self.stringifier = None 287 self.stringifier = None
288 self.iterable = None 288 self.iterable = None
289 self.legacyiterable = None
289 self.maplike = None 290 self.maplike = None
290 self.setlike = None 291 self.setlike = None
291 self.original_interface = None 292 self.original_interface = None
292 self.partial_interfaces = [] 293 self.partial_interfaces = []
293 if not node: # Early exit for IdlException.__init__ 294 if not node: # Early exit for IdlException.__init__
294 return 295 return
295 296
296 self.is_callback = bool(node.GetProperty('CALLBACK')) 297 self.is_callback = bool(node.GetProperty('CALLBACK'))
297 self.is_exception = False 298 self.is_exception = False
298 # FIXME: uppercase 'Partial' => 'PARTIAL' in base IDL parser 299 # FIXME: uppercase 'Partial' => 'PARTIAL' in base IDL parser
(...skipping 20 matching lines...) Expand all
319 elif child_class == 'Inherit': 320 elif child_class == 'Inherit':
320 self.parent = child.GetName() 321 self.parent = child.GetName()
321 elif child_class == 'Serializer': 322 elif child_class == 'Serializer':
322 self.serializer = IdlSerializer(idl_name, child) 323 self.serializer = IdlSerializer(idl_name, child)
323 self.process_serializer() 324 self.process_serializer()
324 elif child_class == 'Stringifier': 325 elif child_class == 'Stringifier':
325 self.stringifier = IdlStringifier(idl_name, child) 326 self.stringifier = IdlStringifier(idl_name, child)
326 self.process_stringifier() 327 self.process_stringifier()
327 elif child_class == 'Iterable': 328 elif child_class == 'Iterable':
328 self.iterable = IdlIterable(idl_name, child) 329 self.iterable = IdlIterable(idl_name, child)
330 elif child_class == 'LegacyIterable':
331 self.legacyiterable = IdlIterable(idl_name, child)
329 elif child_class == 'Maplike': 332 elif child_class == 'Maplike':
330 self.maplike = IdlMaplike(idl_name, child) 333 self.maplike = IdlMaplike(idl_name, child)
331 elif child_class == 'Setlike': 334 elif child_class == 'Setlike':
332 self.setlike = IdlSetlike(idl_name, child) 335 self.setlike = IdlSetlike(idl_name, child)
333 else: 336 else:
334 raise ValueError('Unrecognized node class: %s' % child_class) 337 raise ValueError('Unrecognized node class: %s' % child_class)
335 338
336 if len(filter(None, [self.iterable, self.maplike, self.setlike])) > 1: 339 if len(filter(None, [self.iterable, self.maplike, self.setlike])) > 1:
337 raise ValueError('Interface can only have one of iterable<>, maplike <> and setlike<>.') 340 raise ValueError('Interface can only have one of iterable<>, maplike <> and setlike<>.')
338 341
(...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after
1088 self.visit_typed_object(argument) 1091 self.visit_typed_object(argument)
1089 1092
1090 def visit_iterable(self, iterable): 1093 def visit_iterable(self, iterable):
1091 self.visit_typed_object(iterable) 1094 self.visit_typed_object(iterable)
1092 1095
1093 def visit_maplike(self, maplike): 1096 def visit_maplike(self, maplike):
1094 self.visit_typed_object(maplike) 1097 self.visit_typed_object(maplike)
1095 1098
1096 def visit_setlike(self, setlike): 1099 def visit_setlike(self, setlike):
1097 self.visit_typed_object(setlike) 1100 self.visit_typed_object(setlike)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698