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 idl_types import IdlType | 10 from idl_types import IdlType |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 'cpp_type': unwrapped_idl_type.cpp_type, | 118 'cpp_type': unwrapped_idl_type.cpp_type, |
119 'cpp_value_to_v8_value': unwrapped_idl_type.cpp_value_to_v8_value( | 119 'cpp_value_to_v8_value': unwrapped_idl_type.cpp_value_to_v8_value( |
120 cpp_value='impl.%s()' % cpp_name, isolate='isolate', | 120 cpp_value='impl.%s()' % cpp_name, isolate='isolate', |
121 creation_context='creationContext', | 121 creation_context='creationContext', |
122 extended_attributes=extended_attributes), | 122 extended_attributes=extended_attributes), |
123 'deprecate_as': v8_utilities.deprecate_as(member), | 123 'deprecate_as': v8_utilities.deprecate_as(member), |
124 'enum_type': idl_type.enum_type, | 124 'enum_type': idl_type.enum_type, |
125 'enum_values': unwrapped_idl_type.enum_values, | 125 'enum_values': unwrapped_idl_type.enum_values, |
126 'has_method_name': has_method_name_for_dictionary_member(member), | 126 'has_method_name': has_method_name_for_dictionary_member(member), |
127 'idl_type': idl_type.base_type, | 127 'idl_type': idl_type.base_type, |
128 'is_interface_type': idl_type.is_interface_type and not (idl_type.is_dic
tionary_type or is_deprecated_dictionary), | 128 'is_interface_type': idl_type.is_interface_type and not is_deprecated_di
ctionary, |
129 'is_nullable': idl_type.is_nullable, | 129 'is_nullable': idl_type.is_nullable, |
130 'is_object': unwrapped_idl_type.name == 'Object' or is_deprecated_dictio
nary, | 130 'is_object': unwrapped_idl_type.name == 'Object' or is_deprecated_dictio
nary, |
131 'is_required': member.is_required, | 131 'is_required': member.is_required, |
132 'name': member.name, | 132 'name': member.name, |
133 'runtime_enabled_function': v8_utilities.runtime_enabled_function_name(m
ember), # [RuntimeEnabled] | 133 'runtime_enabled_function': v8_utilities.runtime_enabled_function_name(m
ember), # [RuntimeEnabled] |
134 'setter_name': setter_name_for_dictionary_member(member), | 134 'setter_name': setter_name_for_dictionary_member(member), |
135 'null_setter_name': null_setter_name_for_dictionary_member(member), | 135 'null_setter_name': null_setter_name_for_dictionary_member(member), |
136 'v8_default_value': v8_default_value, | 136 'v8_default_value': v8_default_value, |
137 'v8_value_to_local_cpp_value': unwrapped_idl_type.v8_value_to_local_cpp_
value( | 137 'v8_value_to_local_cpp_value': unwrapped_idl_type.v8_value_to_local_cpp_
value( |
138 extended_attributes, member.name + 'Value', | 138 extended_attributes, member.name + 'Value', |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 'getter_expression': getter_expression(), | 212 'getter_expression': getter_expression(), |
213 'has_method_expression': has_method_expression(), | 213 'has_method_expression': has_method_expression(), |
214 'has_method_name': has_method_name_for_dictionary_member(member), | 214 'has_method_name': has_method_name_for_dictionary_member(member), |
215 'is_nullable': idl_type.is_nullable, | 215 'is_nullable': idl_type.is_nullable, |
216 'is_traceable': idl_type.is_traceable, | 216 'is_traceable': idl_type.is_traceable, |
217 'member_cpp_type': member_cpp_type(), | 217 'member_cpp_type': member_cpp_type(), |
218 'null_setter_name': null_setter_name_for_dictionary_member(member), | 218 'null_setter_name': null_setter_name_for_dictionary_member(member), |
219 'rvalue_cpp_type': idl_type.cpp_type_args(used_as_rvalue_type=True), | 219 'rvalue_cpp_type': idl_type.cpp_type_args(used_as_rvalue_type=True), |
220 'setter_name': setter_name_for_dictionary_member(member), | 220 'setter_name': setter_name_for_dictionary_member(member), |
221 } | 221 } |
OLD | NEW |