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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 return CONTENT_ATTRIBUTE_GETTER_NAMES[idl_type] | 178 return CONTENT_ATTRIBUTE_GETTER_NAMES[idl_type] |
179 if 'URL' in attribute.extended_attributes: | 179 if 'URL' in attribute.extended_attributes: |
180 return 'getURLAttribute' | 180 return 'getURLAttribute' |
181 return 'fastGetAttribute' | 181 return 'fastGetAttribute' |
182 | 182 |
183 | 183 |
184 def is_keep_alive_for_gc(attribute): | 184 def is_keep_alive_for_gc(attribute): |
185 idl_type = attribute.idl_type | 185 idl_type = attribute.idl_type |
186 extended_attributes = attribute.extended_attributes | 186 extended_attributes = attribute.extended_attributes |
187 return ( | 187 return ( |
188 'KeepAttributeAliveForGC' in extended_attributes or | |
189 # For readonly attributes, for performance reasons we keep the attribute | 188 # For readonly attributes, for performance reasons we keep the attribute |
190 # wrapper alive while the owner wrapper is alive, because the attribute | 189 # wrapper alive while the owner wrapper is alive, because the attribute |
191 # never changes. | 190 # never changes. |
192 (attribute.is_read_only and | 191 (attribute.is_read_only and |
193 v8_types.is_wrapper_type(idl_type) and | 192 v8_types.is_wrapper_type(idl_type) and |
194 # There are some exceptions, however: | 193 # There are some exceptions, however: |
195 not( | 194 not( |
196 # Node lifetime is managed by object grouping. | 195 # Node lifetime is managed by object grouping. |
197 v8_types.is_dom_node_type(idl_type) or | 196 v8_types.is_dom_node_type(idl_type) or |
198 # A self-reference is unnecessary. | 197 # A self-reference is unnecessary. |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 if ('NotEnumerable' in extended_attributes or | 345 if ('NotEnumerable' in extended_attributes or |
347 is_constructor_attribute(attribute)): | 346 is_constructor_attribute(attribute)): |
348 property_attributes_list.append('v8::DontEnum') | 347 property_attributes_list.append('v8::DontEnum') |
349 if 'Unforgeable' in extended_attributes: | 348 if 'Unforgeable' in extended_attributes: |
350 property_attributes_list.append('v8::DontDelete') | 349 property_attributes_list.append('v8::DontDelete') |
351 return property_attributes_list or ['v8::None'] | 350 return property_attributes_list or ['v8::None'] |
352 | 351 |
353 | 352 |
354 def is_constructor_attribute(attribute): | 353 def is_constructor_attribute(attribute): |
355 return attribute.idl_type.endswith('Constructor') | 354 return attribute.idl_type.endswith('Constructor') |
OLD | NEW |