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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 includes.clear() | 78 includes.clear() |
79 includes.update(CALLBACK_INTERFACE_CPP_INCLUDES) | 79 includes.update(CALLBACK_INTERFACE_CPP_INCLUDES) |
80 name = callback_interface.name | 80 name = callback_interface.name |
81 | 81 |
82 methods = [generate_method(operation) | 82 methods = [generate_method(operation) |
83 for operation in callback_interface.operations] | 83 for operation in callback_interface.operations] |
84 template_contents = { | 84 template_contents = { |
85 'conditional_string': v8_utilities.conditional_string(callback_interface
), | 85 'conditional_string': v8_utilities.conditional_string(callback_interface
), |
86 'cpp_class': name, | 86 'cpp_class': name, |
87 'v8_class': v8_utilities.v8_class_name(callback_interface), | 87 'v8_class': v8_utilities.v8_class_name(callback_interface), |
| 88 'has_class_bindings': True, |
88 'header_includes': set(CALLBACK_INTERFACE_H_INCLUDES), | 89 'header_includes': set(CALLBACK_INTERFACE_H_INCLUDES), |
89 'methods': methods, | 90 'methods': methods, |
90 } | 91 } |
91 return template_contents | 92 return template_contents |
92 | 93 |
93 | 94 |
94 def add_includes_for_operation(operation): | 95 def add_includes_for_operation(operation): |
95 v8_types.add_includes_for_type(operation.idl_type) | 96 v8_types.add_includes_for_type(operation.idl_type) |
96 for argument in operation.arguments: | 97 for argument in operation.arguments: |
97 v8_types.add_includes_for_type(argument.idl_type) | 98 v8_types.add_includes_for_type(argument.idl_type) |
(...skipping 30 matching lines...) Expand all Loading... |
128 argument_declarations = [ | 129 argument_declarations = [ |
129 '%s %s' % (cpp_type(argument.idl_type), argument.name) | 130 '%s %s' % (cpp_type(argument.idl_type), argument.name) |
130 for argument in arguments] | 131 for argument in arguments] |
131 if call_with_this_handle: | 132 if call_with_this_handle: |
132 argument_declarations.insert(0, 'ScriptValue thisValue') | 133 argument_declarations.insert(0, 'ScriptValue thisValue') |
133 return { | 134 return { |
134 'argument_declarations': argument_declarations, | 135 'argument_declarations': argument_declarations, |
135 'arguments': [generate_argument(argument) for argument in arguments], | 136 'arguments': [generate_argument(argument) for argument in arguments], |
136 'handles': ['%sHandle' % argument.name for argument in arguments], | 137 'handles': ['%sHandle' % argument.name for argument in arguments], |
137 } | 138 } |
OLD | NEW |