OLD | NEW |
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 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
439 if method.name]) # Skip anonymous special operations (metho
ds) | 439 if method.name]) # Skip anonymous special operations (metho
ds) |
440 if interface.partial_interfaces: | 440 if interface.partial_interfaces: |
441 assert len(interface.partial_interfaces) == len(set(interface.partial_in
terfaces)) | 441 assert len(interface.partial_interfaces) == len(set(interface.partial_in
terfaces)) |
442 for partial_interface in interface.partial_interfaces: | 442 for partial_interface in interface.partial_interfaces: |
443 methods.extend([v8_methods.method_context(interface, operation, is_v
isible=False) | 443 methods.extend([v8_methods.method_context(interface, operation, is_v
isible=False) |
444 for operation in partial_interface.operations | 444 for operation in partial_interface.operations |
445 if operation.name]) | 445 if operation.name]) |
446 compute_method_overloads_context(interface, methods) | 446 compute_method_overloads_context(interface, methods) |
447 | 447 |
448 def generated_method(return_type, name, arguments=None, extended_attributes=
None, implemented_as=None): | 448 def generated_method(return_type, name, arguments=None, extended_attributes=
None, implemented_as=None): |
449 operation = IdlOperation(interface.idl_name) | 449 operation = IdlOperation() |
450 operation.idl_type = return_type | 450 operation.idl_type = return_type |
451 operation.name = name | 451 operation.name = name |
452 if arguments: | 452 if arguments: |
453 operation.arguments = arguments | 453 operation.arguments = arguments |
454 if extended_attributes: | 454 if extended_attributes: |
455 operation.extended_attributes.update(extended_attributes) | 455 operation.extended_attributes.update(extended_attributes) |
456 if implemented_as is None: | 456 if implemented_as is None: |
457 implemented_as = name + 'ForBinding' | 457 implemented_as = name + 'ForBinding' |
458 operation.extended_attributes['ImplementedAs'] = implemented_as | 458 operation.extended_attributes['ImplementedAs'] = implemented_as |
459 return v8_methods.method_context(interface, operation) | 459 return v8_methods.method_context(interface, operation) |
460 | 460 |
461 def generated_argument(idl_type, name, is_optional=False, extended_attribute
s=None): | 461 def generated_argument(idl_type, name, is_optional=False, extended_attribute
s=None): |
462 argument = IdlArgument(interface.idl_name) | 462 argument = IdlArgument() |
463 argument.idl_type = idl_type | 463 argument.idl_type = idl_type |
464 argument.name = name | 464 argument.name = name |
465 argument.is_optional = is_optional | 465 argument.is_optional = is_optional |
466 if extended_attributes: | 466 if extended_attributes: |
467 argument.extended_attributes.update(extended_attributes) | 467 argument.extended_attributes.update(extended_attributes) |
468 return argument | 468 return argument |
469 | 469 |
470 # [Iterable], iterable<>, maplike<> and setlike<> | 470 # [Iterable], iterable<>, maplike<> and setlike<> |
471 iterator_method = None | 471 iterator_method = None |
472 | 472 |
(...skipping 976 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1449 extended_attributes = deleter.extended_attributes | 1449 extended_attributes = deleter.extended_attributes |
1450 is_call_with_script_state = v8_utilities.has_extended_attribute_value(delete
r, 'CallWith', 'ScriptState') | 1450 is_call_with_script_state = v8_utilities.has_extended_attribute_value(delete
r, 'CallWith', 'ScriptState') |
1451 is_ce_reactions = 'CEReactions' in extended_attributes | 1451 is_ce_reactions = 'CEReactions' in extended_attributes |
1452 return { | 1452 return { |
1453 'is_call_with_script_state': is_call_with_script_state, | 1453 'is_call_with_script_state': is_call_with_script_state, |
1454 'is_ce_reactions': is_ce_reactions, | 1454 'is_ce_reactions': is_ce_reactions, |
1455 'is_custom': 'Custom' in extended_attributes, | 1455 'is_custom': 'Custom' in extended_attributes, |
1456 'is_raises_exception': 'RaisesException' in extended_attributes, | 1456 'is_raises_exception': 'RaisesException' in extended_attributes, |
1457 'name': cpp_name(deleter), | 1457 'name': cpp_name(deleter), |
1458 } | 1458 } |
OLD | NEW |