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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 130 if 'ReflectOnly' in extended_attributes else None, | 130 if 'ReflectOnly' in extended_attributes else None, |
| 131 'setter_callback': setter_callback_name(interface, attribute), | 131 'setter_callback': setter_callback_name(interface, attribute), |
| 132 'v8_type': v8_types.v8_type(idl_type), | 132 'v8_type': v8_types.v8_type(idl_type), |
| 133 'runtime_enabled_function': v8_utilities.runtime_enabled_function_name(a ttribute), # [RuntimeEnabled] | 133 'runtime_enabled_function': v8_utilities.runtime_enabled_function_name(a ttribute), # [RuntimeEnabled] |
| 134 'world_suffixes': ['', 'ForMainWorld'] | 134 'world_suffixes': ['', 'ForMainWorld'] |
| 135 if 'PerWorldBindings' in extended_attributes | 135 if 'PerWorldBindings' in extended_attributes |
| 136 else [''], # [PerWorldBindings] | 136 else [''], # [PerWorldBindings] |
| 137 } | 137 } |
| 138 | 138 |
| 139 if is_constructor_attribute(attribute): | 139 if is_constructor_attribute(attribute): |
| 140 generate_constructor_getter(interface, attribute, contents) | |
| 140 return contents | 141 return contents |
| 141 if not has_custom_getter: | 142 if not has_custom_getter: |
| 142 generate_getter(interface, attribute, contents) | 143 generate_getter(interface, attribute, contents) |
| 143 if (not has_custom_setter and | 144 if (not has_custom_setter and |
| 144 (not attribute.is_read_only or 'PutForwards' in extended_attributes)): | 145 (not attribute.is_read_only or 'PutForwards' in extended_attributes)): |
| 145 generate_setter(interface, attribute, contents) | 146 generate_setter(interface, attribute, contents) |
| 146 | 147 |
| 147 return contents | 148 return contents |
| 148 | 149 |
| 149 | 150 |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 389 property_attributes_list.append('v8::DontDelete') | 390 property_attributes_list.append('v8::DontDelete') |
| 390 return property_attributes_list or ['v8::None'] | 391 return property_attributes_list or ['v8::None'] |
| 391 | 392 |
| 392 | 393 |
| 393 ################################################################################ | 394 ################################################################################ |
| 394 # Constructors | 395 # Constructors |
| 395 ################################################################################ | 396 ################################################################################ |
| 396 | 397 |
| 397 def is_constructor_attribute(attribute): | 398 def is_constructor_attribute(attribute): |
| 398 return attribute.idl_type.endswith('Constructor') | 399 return attribute.idl_type.endswith('Constructor') |
| 400 | |
| 401 | |
| 402 def generate_constructor_getter(interface, attribute, contents): | |
| 403 contents['needs_constructor_callback'] = contents['measure_as'] or contents[ 'deprecate_as'] | |
|
haraken
2014/03/05 14:34:57
needs_constructor_callback => needs_constructor_ge
sof
2014/03/05 14:56:45
Done.
| |
| OLD | NEW |