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/ExceptionState.h', |
22 'bindings/core/v8/Dictionary.h', | 22 'bindings/core/v8/PropertyBag.h', |
23 ]) | 23 ]) |
24 | 24 |
25 | 25 |
26 def setter_name_for_dictionary_member(member): | 26 def setter_name_for_dictionary_member(member): |
27 return 'set%s' % v8_utilities.capitalize(member.name) | 27 return 'set%s' % v8_utilities.capitalize(member.name) |
28 | 28 |
29 | 29 |
30 def has_method_name_for_dictionary_member(member): | 30 def has_method_name_for_dictionary_member(member): |
31 return 'has%s' % v8_utilities.capitalize(member.name) | 31 return 'has%s' % v8_utilities.capitalize(member.name) |
32 | 32 |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 'getter_expression': getter_expression(), | 127 'getter_expression': getter_expression(), |
128 'has_method_expression': has_method_expression(), | 128 'has_method_expression': has_method_expression(), |
129 'has_method_name': has_method_name_for_dictionary_member(member), | 129 'has_method_name': has_method_name_for_dictionary_member(member), |
130 'is_traceable': (idl_type.is_garbage_collected or | 130 'is_traceable': (idl_type.is_garbage_collected or |
131 idl_type.is_will_be_garbage_collected), | 131 idl_type.is_will_be_garbage_collected), |
132 'member_cpp_type': member_cpp_type(), | 132 'member_cpp_type': member_cpp_type(), |
133 'name': member.name, | 133 'name': member.name, |
134 'rvalue_cpp_type': idl_type.cpp_type_args(used_as_rvalue_type=True), | 134 'rvalue_cpp_type': idl_type.cpp_type_args(used_as_rvalue_type=True), |
135 'setter_name': setter_name_for_dictionary_member(member), | 135 'setter_name': setter_name_for_dictionary_member(member), |
136 } | 136 } |
OLD | NEW |