Chromium Code Reviews

Side by Side Diff: third_party/WebKit/Source/bindings/scripts/v8_interface.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.
Jump to:
View unified diff |
OLDNEW
1 # Copyright (C) 2013 Google Inc. All rights reserved. 1 # Copyright (C) 2013 Google Inc. All rights reserved.
2 # coding=utf-8 2 # coding=utf-8
3 # 3 #
4 # Redistribution and use in source and binary forms, with or without 4 # Redistribution and use in source and binary forms, with or without
5 # modification, are permitted provided that the following conditions are 5 # modification, are permitted provided that the following conditions are
6 # met: 6 # met:
7 # 7 #
8 # * Redistributions of source code must retain the above copyright 8 # * Redistributions of source code must retain the above copyright
9 # notice, this list of conditions and the following disclaimer. 9 # notice, this list of conditions and the following disclaimer.
10 # * Redistributions in binary form must reproduce the above 10 # * Redistributions in binary form must reproduce the above
(...skipping 335 matching lines...)
346 argument.extended_attributes.update(extended_attributes) 346 argument.extended_attributes.update(extended_attributes)
347 return argument 347 return argument
348 348
349 # [Iterable], iterable<>, maplike<> and setlike<> 349 # [Iterable], iterable<>, maplike<> and setlike<>
350 iterator_method = None 350 iterator_method = None
351 # FIXME: support Iterable in partial interfaces. However, we don't 351 # FIXME: support Iterable in partial interfaces. However, we don't
352 # need to support iterator overloads between interface and 352 # need to support iterator overloads between interface and
353 # partial interface definitions. 353 # partial interface definitions.
354 # http://heycam.github.io/webidl/#idl-overloading 354 # http://heycam.github.io/webidl/#idl-overloading
355 if (not interface.is_partial 355 if (not interface.is_partial
356 and (interface.iterable or interface.maplike or interface.setlike 356 and (interface.iterable or interface.legacyiterable or interface.maplike or interface.setlike
357 or 'Iterable' in extended_attributes)): 357 or 'Iterable' in extended_attributes)):
358 358
359 used_extended_attributes = {} 359 used_extended_attributes = {}
360 360
361 if interface.iterable: 361 if interface.iterable:
362 used_extended_attributes.update(interface.iterable.extended_attribut es) 362 used_extended_attributes.update(interface.iterable.extended_attribut es)
363 elif interface.legacyiterable:
364 used_extended_attributes.update(interface.legacyiterable.extended_at tributes)
363 elif interface.maplike: 365 elif interface.maplike:
364 used_extended_attributes.update(interface.maplike.extended_attribute s) 366 used_extended_attributes.update(interface.maplike.extended_attribute s)
365 elif interface.setlike: 367 elif interface.setlike:
366 used_extended_attributes.update(interface.setlike.extended_attribute s) 368 used_extended_attributes.update(interface.setlike.extended_attribute s)
367 369
368 if 'RaisesException' in used_extended_attributes: 370 if 'RaisesException' in used_extended_attributes:
369 raise ValueError('[RaisesException] is implied for iterable<>/maplik e<>/setlike<>') 371 raise ValueError('[RaisesException] is implied for iterable<>/maplik e<>/setlike<>')
370 if 'CallWith' in used_extended_attributes: 372 if 'CallWith' in used_extended_attributes:
371 raise ValueError('[CallWith=ScriptState] is implied for iterable<>/m aplike<>/setlike<>') 373 raise ValueError('[CallWith=ScriptState] is implied for iterable<>/m aplike<>/setlike<>')
372 374
(...skipping 994 matching lines...)
1367 1369
1368 extended_attributes = deleter.extended_attributes 1370 extended_attributes = deleter.extended_attributes
1369 idl_type = deleter.idl_type 1371 idl_type = deleter.idl_type
1370 is_call_with_script_state = v8_utilities.has_extended_attribute_value(delete r, 'CallWith', 'ScriptState') 1372 is_call_with_script_state = v8_utilities.has_extended_attribute_value(delete r, 'CallWith', 'ScriptState')
1371 return { 1373 return {
1372 'is_call_with_script_state': is_call_with_script_state, 1374 'is_call_with_script_state': is_call_with_script_state,
1373 'is_custom': 'Custom' in extended_attributes, 1375 'is_custom': 'Custom' in extended_attributes,
1374 'is_raises_exception': 'RaisesException' in extended_attributes, 1376 'is_raises_exception': 'RaisesException' in extended_attributes,
1375 'name': cpp_name(deleter), 1377 'name': cpp_name(deleter),
1376 } 1378 }
OLDNEW

Powered by Google App Engine