| 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 'custom': is_custom, | 107 'custom': is_custom, |
| 108 'idl_type': idl_type_str, | 108 'idl_type': idl_type_str, |
| 109 'name': operation.name, | 109 'name': operation.name, |
| 110 } | 110 } |
| 111 contents.update(generate_arguments_contents(operation.arguments, call_with_t
his_handle)) | 111 contents.update(generate_arguments_contents(operation.arguments, call_with_t
his_handle)) |
| 112 return contents | 112 return contents |
| 113 | 113 |
| 114 | 114 |
| 115 def generate_arguments_contents(arguments, call_with_this_handle): | 115 def generate_arguments_contents(arguments, call_with_this_handle): |
| 116 def generate_argument(argument): | 116 def generate_argument(argument): |
| 117 creation_context = '<Dart%s>' % argument.idl_type.base_type | 117 creation_context = '' |
| 118 if argument.idl_type.native_array_element_type is not None: |
| 119 creation_context = '<Dart%s>' % argument.idl_type.native_array_eleme
nt_type |
| 118 return { | 120 return { |
| 119 'handle': '%sHandle' % argument.name, | 121 'handle': '%sHandle' % argument.name, |
| 120 'cpp_value_to_dart_value': argument.idl_type.cpp_value_to_dart_value
(argument.name, | 122 'cpp_value_to_dart_value': argument.idl_type.cpp_value_to_dart_value
(argument.name, |
| 121
creation_context=creation_context), | 123
creation_context=creation_context), |
| 122 } | 124 } |
| 123 | 125 |
| 124 argument_declarations = [ | 126 argument_declarations = [ |
| 125 '%s %s' % (argument.idl_type.callback_cpp_type, argument.name) | 127 '%s %s' % (argument.idl_type.callback_cpp_type, argument.name) |
| 126 for argument in arguments] | 128 for argument in arguments] |
| 127 if call_with_this_handle: | 129 if call_with_this_handle: |
| 128 argument_declarations.insert(0, 'ScriptValue thisValue') | 130 argument_declarations.insert(0, 'ScriptValue thisValue') |
| 129 return { | 131 return { |
| 130 'argument_declarations': argument_declarations, | 132 'argument_declarations': argument_declarations, |
| 131 'arguments': [generate_argument(argument) for argument in arguments], | 133 'arguments': [generate_argument(argument) for argument in arguments], |
| 132 } | 134 } |
| OLD | NEW |