| 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 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 context['cpp_value_original'] = cpp_value | 279 context['cpp_value_original'] = cpp_value |
| 280 cpp_value = 'cppValue' | 280 cpp_value = 'cppValue' |
| 281 | 281 |
| 282 def v8_set_return_value_statement(for_main_world=False): | 282 def v8_set_return_value_statement(for_main_world=False): |
| 283 if context['is_keep_alive_for_gc'] or 'CachedAttribute' in extended_attr
ibutes: | 283 if context['is_keep_alive_for_gc'] or 'CachedAttribute' in extended_attr
ibutes: |
| 284 return 'v8SetReturnValue(info, v8Value)' | 284 return 'v8SetReturnValue(info, v8Value)' |
| 285 return idl_type.v8_set_return_value( | 285 return idl_type.v8_set_return_value( |
| 286 cpp_value, extended_attributes=extended_attributes, script_wrappable
='impl', | 286 cpp_value, extended_attributes=extended_attributes, script_wrappable
='impl', |
| 287 for_main_world=for_main_world, is_static=attribute.is_static) | 287 for_main_world=for_main_world, is_static=attribute.is_static) |
| 288 | 288 |
| 289 cpp_value_to_script_wrappable = cpp_value |
| 290 if idl_type.is_array_buffer_view_or_typed_array: |
| 291 cpp_value_to_script_wrappable += '.view()' |
| 292 |
| 289 context.update({ | 293 context.update({ |
| 290 'cpp_value': cpp_value, | 294 'cpp_value': cpp_value, |
| 295 'cpp_value_to_script_wrappable': cpp_value_to_script_wrappable, |
| 291 'cpp_value_to_v8_value': idl_type.cpp_value_to_v8_value( | 296 'cpp_value_to_v8_value': idl_type.cpp_value_to_v8_value( |
| 292 cpp_value=cpp_value, creation_context='holder', | 297 cpp_value=cpp_value, creation_context='holder', |
| 293 extended_attributes=extended_attributes), | 298 extended_attributes=extended_attributes), |
| 294 'v8_set_return_value_for_main_world': v8_set_return_value_statement(for_
main_world=True), | 299 'v8_set_return_value_for_main_world': v8_set_return_value_statement(for_
main_world=True), |
| 295 'v8_set_return_value': v8_set_return_value_statement(), | 300 'v8_set_return_value': v8_set_return_value_statement(), |
| 296 }) | 301 }) |
| 297 | 302 |
| 298 def getter_expression(interface, attribute, context): | 303 def getter_expression(interface, attribute, context): |
| 299 arguments = [] | 304 arguments = [] |
| 300 this_getter_base_name = getter_base_name(interface, attribute, arguments) | 305 this_getter_base_name = getter_base_name(interface, attribute, arguments) |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 560 def is_constructor_attribute(attribute): | 565 def is_constructor_attribute(attribute): |
| 561 return attribute.idl_type.name.endswith('Constructor') | 566 return attribute.idl_type.name.endswith('Constructor') |
| 562 | 567 |
| 563 | 568 |
| 564 def is_named_constructor_attribute(attribute): | 569 def is_named_constructor_attribute(attribute): |
| 565 return attribute.idl_type.name.endswith('ConstructorConstructor') | 570 return attribute.idl_type.name.endswith('ConstructorConstructor') |
| 566 | 571 |
| 567 | 572 |
| 568 def update_constructor_attribute_context(interface, attribute, context): | 573 def update_constructor_attribute_context(interface, attribute, context): |
| 569 context['needs_constructor_getter_callback'] = context['measure_as'] or cont
ext['deprecate_as'] | 574 context['needs_constructor_getter_callback'] = context['measure_as'] or cont
ext['deprecate_as'] |
| OLD | NEW |