| OLD | NEW |
| 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 | 97 |
| 98 def generate_callback_interface(callback_interface): | 98 def generate_callback_interface(callback_interface): |
| 99 includes.clear() | 99 includes.clear() |
| 100 includes.update(CALLBACK_INTERFACE_CPP_INCLUDES) | 100 includes.update(CALLBACK_INTERFACE_CPP_INCLUDES) |
| 101 name = callback_interface.name | 101 name = callback_interface.name |
| 102 | 102 |
| 103 methods = [generate_method(operation) | 103 methods = [generate_method(operation) |
| 104 for operation in callback_interface.operations] | 104 for operation in callback_interface.operations] |
| 105 template_contents = { | 105 template_contents = { |
| 106 'conditional_string': v8_utilities.conditional_string(callback_interface
), | 106 'conditional_string': v8_utilities.conditional_string(callback_interface
), |
| 107 'cpp_class_name': name, | 107 'cpp_class': name, |
| 108 'v8_class_name': v8_utilities.v8_class_name(callback_interface), | 108 'v8_class': v8_utilities.v8_class_name(callback_interface), |
| 109 'header_includes': CALLBACK_INTERFACE_H_INCLUDES, | 109 'header_includes': CALLBACK_INTERFACE_H_INCLUDES, |
| 110 'methods': methods, | 110 'methods': methods, |
| 111 'ref_counted': name in LEGACY_REF_COUNTED_CALLBACK_INTERFACES, | 111 'ref_counted': name in LEGACY_REF_COUNTED_CALLBACK_INTERFACES, |
| 112 } | 112 } |
| 113 return template_contents | 113 return template_contents |
| 114 | 114 |
| 115 | 115 |
| 116 def add_includes_for_operation(operation): | 116 def add_includes_for_operation(operation): |
| 117 v8_types.add_includes_for_type(operation.idl_type) | 117 v8_types.add_includes_for_type(operation.idl_type) |
| 118 for argument in operation.arguments: | 118 for argument in operation.arguments: |
| (...skipping 30 matching lines...) Expand all Loading... |
| 149 argument_declarations = [ | 149 argument_declarations = [ |
| 150 '%s %s' % (cpp_type(argument.idl_type), argument.name) | 150 '%s %s' % (cpp_type(argument.idl_type), argument.name) |
| 151 for argument in arguments] | 151 for argument in arguments] |
| 152 if call_with_this_handle: | 152 if call_with_this_handle: |
| 153 argument_declarations.insert(0, 'ScriptValue thisValue') | 153 argument_declarations.insert(0, 'ScriptValue thisValue') |
| 154 return { | 154 return { |
| 155 'argument_declarations': argument_declarations, | 155 'argument_declarations': argument_declarations, |
| 156 'arguments': [generate_argument(argument) for argument in arguments], | 156 'arguments': [generate_argument(argument) for argument in arguments], |
| 157 'handles': ['%sHandle' % argument.name for argument in arguments], | 157 'handles': ['%sHandle' % argument.name for argument in arguments], |
| 158 } | 158 } |
| OLD | NEW |