| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 'core/dom/ExecutionContext.h', | 48 'core/dom/ExecutionContext.h', |
| 49 'bindings/v8/V8Binding.h', | 49 'bindings/v8/V8Binding.h', |
| 50 'bindings/v8/V8Callback.h', | 50 'bindings/v8/V8Callback.h', |
| 51 'wtf/Assertions.h', | 51 'wtf/Assertions.h', |
| 52 ]) | 52 ]) |
| 53 CPP_TO_V8_CONVERSION = 'v8::Handle<v8::Value> {name}Handle = {cpp_value_to_v8_va
lue};' | 53 CPP_TO_V8_CONVERSION = 'v8::Handle<v8::Value> {name}Handle = {cpp_value_to_v8_va
lue};' |
| 54 | 54 |
| 55 | 55 |
| 56 def cpp_to_v8_conversion(idl_type, name): | 56 def cpp_to_v8_conversion(idl_type, name): |
| 57 # Includes handled in includes_for_operation | 57 # Includes handled in includes_for_operation |
| 58 this_cpp_value_to_v8_value = cpp_value_to_v8_value(idl_type, name, set(), 'i
solate', creation_context='v8::Handle<v8::Object>()') | 58 this_cpp_value_to_v8_value = cpp_value_to_v8_value(idl_type, name, set(), 'i
solate') |
| 59 return CPP_TO_V8_CONVERSION.format(name=name, cpp_value_to_v8_value=this_cpp
_value_to_v8_value) | 59 return CPP_TO_V8_CONVERSION.format(name=name, cpp_value_to_v8_value=this_cpp
_value_to_v8_value) |
| 60 | 60 |
| 61 | 61 |
| 62 def generate_callback_interface(callback_interface): | 62 def generate_callback_interface(callback_interface): |
| 63 includes.clear() | 63 includes.clear() |
| 64 includes.update(CALLBACK_INTERFACE_CPP_INCLUDES) | 64 includes.update(CALLBACK_INTERFACE_CPP_INCLUDES) |
| 65 | 65 |
| 66 methods = [generate_method(operation) for operation in callback_interface.op
erations] | 66 methods = [generate_method(operation) for operation in callback_interface.op
erations] |
| 67 template_contents = { | 67 template_contents = { |
| 68 'cpp_class_name': callback_interface.name, | 68 'cpp_class_name': callback_interface.name, |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 } | 108 } |
| 109 | 109 |
| 110 argument_declarations = [argument_declaration(argument) for argument in argu
ments] | 110 argument_declarations = [argument_declaration(argument) for argument in argu
ments] |
| 111 if call_with_this_handle: | 111 if call_with_this_handle: |
| 112 argument_declarations.insert(0, 'ScriptValue thisValue') | 112 argument_declarations.insert(0, 'ScriptValue thisValue') |
| 113 return { | 113 return { |
| 114 'argument_declarations': argument_declarations, | 114 'argument_declarations': argument_declarations, |
| 115 'arguments': [generate_argument(argument) for argument in arguments], | 115 'arguments': [generate_argument(argument) for argument in arguments], |
| 116 'handles': ['%sHandle' % argument.name for argument in arguments], | 116 'handles': ['%sHandle' % argument.name for argument in arguments], |
| 117 } | 117 } |
| OLD | NEW |