Chromium Code Reviews| 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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 194 if base_idl_type != 'EventHandler' and idl_type.is_interface_type: | 194 if base_idl_type != 'EventHandler' and idl_type.is_interface_type: |
| 195 release = True | 195 release = True |
| 196 | 196 |
| 197 def v8_set_return_value_statement(for_main_world=False): | 197 def v8_set_return_value_statement(for_main_world=False): |
| 198 if contents['is_keep_alive_for_gc']: | 198 if contents['is_keep_alive_for_gc']: |
| 199 return 'v8SetReturnValue(info, wrapper)' | 199 return 'v8SetReturnValue(info, wrapper)' |
| 200 return idl_type.v8_set_return_value(cpp_value, extended_attributes=exten ded_attributes, script_wrappable='impl', release=release, for_main_world=for_mai n_world) | 200 return idl_type.v8_set_return_value(cpp_value, extended_attributes=exten ded_attributes, script_wrappable='impl', release=release, for_main_world=for_mai n_world) |
| 201 | 201 |
| 202 contents.update({ | 202 contents.update({ |
| 203 'cpp_value': cpp_value, | 203 'cpp_value': cpp_value, |
| 204 # We need to override cpp_value_to_v8_value to make sure the cpp_value b eing used is in sync. | |
|
haraken
2014/05/16 11:06:22
I'd remove this comment.
| |
| 205 'cpp_value_to_v8_value': idl_type.cpp_value_to_v8_value(cpp_value=cpp_va lue, creation_context='info.Holder()'), | |
| 204 'v8_set_return_value_for_main_world': v8_set_return_value_statement(for_ main_world=True), | 206 'v8_set_return_value_for_main_world': v8_set_return_value_statement(for_ main_world=True), |
| 205 'v8_set_return_value': v8_set_return_value_statement(), | 207 'v8_set_return_value': v8_set_return_value_statement(), |
| 206 }) | 208 }) |
| 207 | 209 |
| 208 | 210 |
| 209 def getter_expression(interface, attribute, contents): | 211 def getter_expression(interface, attribute, contents): |
| 210 arguments = [] | 212 arguments = [] |
| 211 this_getter_base_name = getter_base_name(interface, attribute, arguments) | 213 this_getter_base_name = getter_base_name(interface, attribute, arguments) |
| 212 getter_name = scoped_name(interface, attribute, this_getter_base_name) | 214 getter_name = scoped_name(interface, attribute, this_getter_base_name) |
| 213 | 215 |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 421 lambda self: strip_suffix(self.base_type, 'Constructor')) | 423 lambda self: strip_suffix(self.base_type, 'Constructor')) |
| 422 | 424 |
| 423 | 425 |
| 424 def is_constructor_attribute(attribute): | 426 def is_constructor_attribute(attribute): |
| 425 # FIXME: replace this with [ConstructorAttribute] extended attribute | 427 # FIXME: replace this with [ConstructorAttribute] extended attribute |
| 426 return attribute.idl_type.base_type.endswith('Constructor') | 428 return attribute.idl_type.base_type.endswith('Constructor') |
| 427 | 429 |
| 428 | 430 |
| 429 def generate_constructor_getter(interface, attribute, contents): | 431 def generate_constructor_getter(interface, attribute, contents): |
| 430 contents['needs_constructor_getter_callback'] = contents['measure_as'] or co ntents['deprecate_as'] | 432 contents['needs_constructor_getter_callback'] = contents['measure_as'] or co ntents['deprecate_as'] |
| OLD | NEW |