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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 # avoid the overhead of using a Ref<> temporary, but for some cases | 166 # avoid the overhead of using a Ref<> temporary, but for some cases |
167 # (nullable types, EventHandler, [CachedAttribute], or if there are | 167 # (nullable types, EventHandler, [CachedAttribute], or if there are |
168 # exceptions), we need to use a local variable. | 168 # exceptions), we need to use a local variable. |
169 # FIXME: check if compilers are smart enough to inline this, and if so, | 169 # FIXME: check if compilers are smart enough to inline this, and if so, |
170 # always use a local variable (for readability and CG simplicity). | 170 # always use a local variable (for readability and CG simplicity). |
171 release = False | 171 release = False |
172 if (idl_type.is_nullable or | 172 if (idl_type.is_nullable or |
173 base_idl_type == 'EventHandler' or | 173 base_idl_type == 'EventHandler' or |
174 'CachedAttribute' in extended_attributes or | 174 'CachedAttribute' in extended_attributes or |
175 'ReflectOnly' in extended_attributes or | 175 'ReflectOnly' in extended_attributes or |
| 176 context['is_keep_alive_for_gc'] or |
176 context['is_getter_raises_exception']): | 177 context['is_getter_raises_exception']): |
177 context['cpp_value_original'] = cpp_value | 178 context['cpp_value_original'] = cpp_value |
178 cpp_value = 'v8Value' | 179 cpp_value = 'v8Value' |
179 # EventHandler has special handling | 180 # EventHandler has special handling |
180 if base_idl_type != 'EventHandler' and idl_type.is_interface_type: | 181 if base_idl_type != 'EventHandler' and idl_type.is_interface_type: |
181 release = True | 182 release = True |
182 | 183 |
183 def v8_set_return_value_statement(for_main_world=False): | 184 def v8_set_return_value_statement(for_main_world=False): |
184 if context['is_keep_alive_for_gc']: | 185 if context['is_keep_alive_for_gc']: |
185 return 'v8SetReturnValue(info, wrapper)' | 186 return 'v8SetReturnValue(info, wrapper)' |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
431 lambda self: strip_suffix(self.base_type, 'Constructor')) | 432 lambda self: strip_suffix(self.base_type, 'Constructor')) |
432 | 433 |
433 | 434 |
434 def is_constructor_attribute(attribute): | 435 def is_constructor_attribute(attribute): |
435 # FIXME: replace this with [ConstructorAttribute] extended attribute | 436 # FIXME: replace this with [ConstructorAttribute] extended attribute |
436 return attribute.idl_type.base_type.endswith('Constructor') | 437 return attribute.idl_type.base_type.endswith('Constructor') |
437 | 438 |
438 | 439 |
439 def constructor_getter_context(interface, attribute, context): | 440 def constructor_getter_context(interface, attribute, context): |
440 context['needs_constructor_getter_callback'] = context['measure_as'] or cont
ext['deprecate_as'] | 441 context['needs_constructor_getter_callback'] = context['measure_as'] or cont
ext['deprecate_as'] |
OLD | NEW |