| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 """Generate template contexts of dictionaries for both v8 bindings and | 5 """Generate template contexts of dictionaries for both v8 bindings and |
| 6 implementation classes that are used by blink's core/modules. | 6 implementation classes that are used by blink's core/modules. |
| 7 """ | 7 """ |
| 8 | 8 |
| 9 import operator | 9 import operator |
| 10 from v8_globals import includes | 10 from v8_globals import includes |
| 11 import v8_types | 11 import v8_types |
| 12 import v8_utilities | 12 import v8_utilities |
| 13 | 13 |
| 14 | 14 |
| 15 DICTIONARY_H_INCLUDES = frozenset([ | 15 DICTIONARY_H_INCLUDES = frozenset([ |
| 16 'bindings/core/v8/V8Binding.h', | 16 'bindings/core/v8/V8Binding.h', |
| 17 'platform/heap/Handle.h', | 17 'platform/heap/Handle.h', |
| 18 ]) | 18 ]) |
| 19 | 19 |
| 20 DICTIONARY_CPP_INCLUDES = frozenset([ | 20 DICTIONARY_CPP_INCLUDES = frozenset([ |
| 21 # FIXME: Remove this, http://crbug.com/321462 | 21 'bindings/core/v8/PropertyBag.h', |
| 22 'bindings/core/v8/Dictionary.h', | |
| 23 ]) | 22 ]) |
| 24 | 23 |
| 25 | 24 |
| 26 def setter_name_for_dictionary_member(member): | 25 def setter_name_for_dictionary_member(member): |
| 27 return 'set%s' % v8_utilities.capitalize(member.name) | 26 return 'set%s' % v8_utilities.capitalize(member.name) |
| 28 | 27 |
| 29 | 28 |
| 30 def has_method_name_for_dictionary_member(member): | 29 def has_method_name_for_dictionary_member(member): |
| 31 return 'has%s' % v8_utilities.capitalize(member.name) | 30 return 'has%s' % v8_utilities.capitalize(member.name) |
| 32 | 31 |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 'getter_expression': getter_expression(), | 126 'getter_expression': getter_expression(), |
| 128 'has_method_expression': has_method_expression(), | 127 'has_method_expression': has_method_expression(), |
| 129 'has_method_name': has_method_name_for_dictionary_member(member), | 128 'has_method_name': has_method_name_for_dictionary_member(member), |
| 130 'is_traceable': (idl_type.is_garbage_collected or | 129 'is_traceable': (idl_type.is_garbage_collected or |
| 131 idl_type.is_will_be_garbage_collected), | 130 idl_type.is_will_be_garbage_collected), |
| 132 'member_cpp_type': member_cpp_type(), | 131 'member_cpp_type': member_cpp_type(), |
| 133 'name': member.name, | 132 'name': member.name, |
| 134 'rvalue_cpp_type': idl_type.cpp_type_args(used_as_rvalue_type=True), | 133 'rvalue_cpp_type': idl_type.cpp_type_args(used_as_rvalue_type=True), |
| 135 'setter_name': setter_name_for_dictionary_member(member), | 134 'setter_name': setter_name_for_dictionary_member(member), |
| 136 } | 135 } |
| OLD | NEW |