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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 return { | 95 return { |
96 'cpp_default_value': cpp_default_value, | 96 'cpp_default_value': cpp_default_value, |
97 'cpp_name': cpp_name, | 97 'cpp_name': cpp_name, |
98 'cpp_type': unwrapped_idl_type.cpp_type, | 98 'cpp_type': unwrapped_idl_type.cpp_type, |
99 'cpp_value_to_v8_value': unwrapped_idl_type.cpp_value_to_v8_value( | 99 'cpp_value_to_v8_value': unwrapped_idl_type.cpp_value_to_v8_value( |
100 cpp_value='impl.%s()' % cpp_name, isolate='isolate', | 100 cpp_value='impl.%s()' % cpp_name, isolate='isolate', |
101 creation_context='creationContext', | 101 creation_context='creationContext', |
102 extended_attributes=member.extended_attributes), | 102 extended_attributes=member.extended_attributes), |
103 'enum_validation_expression': unwrapped_idl_type.enum_validation_express
ion, | 103 'enum_validation_expression': unwrapped_idl_type.enum_validation_express
ion, |
104 'has_method_name': has_method_name_for_dictionary_member(member), | 104 'has_method_name': has_method_name_for_dictionary_member(member), |
| 105 'idl_type': idl_type.base_type, |
| 106 'is_interface_type': idl_type.is_interface_type and not idl_type.is_dict
ionary, |
105 'is_nullable': idl_type.is_nullable, | 107 'is_nullable': idl_type.is_nullable, |
106 'is_object': unwrapped_idl_type.name == 'Object', | 108 'is_object': unwrapped_idl_type.name == 'Object', |
107 'name': member.name, | 109 'name': member.name, |
108 'setter_name': setter_name_for_dictionary_member(member), | 110 'setter_name': setter_name_for_dictionary_member(member), |
109 'null_setter_name': null_setter_name_for_dictionary_member(member), | 111 'null_setter_name': null_setter_name_for_dictionary_member(member), |
110 'use_output_parameter_for_result': unwrapped_idl_type.use_output_paramet
er_for_result, | 112 'use_output_parameter_for_result': unwrapped_idl_type.use_output_paramet
er_for_result, |
111 'v8_default_value': v8_default_value, | 113 'v8_default_value': v8_default_value, |
112 'v8_value_to_local_cpp_value': unwrapped_idl_type.v8_value_to_local_cpp_
value( | 114 'v8_value_to_local_cpp_value': unwrapped_idl_type.v8_value_to_local_cpp_
value( |
113 member.extended_attributes, member.name + 'Value', | 115 member.extended_attributes, member.name + 'Value', |
114 member.name, isolate='isolate'), | 116 member.name, isolate='isolate'), |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 'getter_expression': getter_expression(), | 174 'getter_expression': getter_expression(), |
173 'has_method_expression': has_method_expression(), | 175 'has_method_expression': has_method_expression(), |
174 'has_method_name': has_method_name_for_dictionary_member(member), | 176 'has_method_name': has_method_name_for_dictionary_member(member), |
175 'is_object': is_object, | 177 'is_object': is_object, |
176 'is_traceable': idl_type.is_traceable, | 178 'is_traceable': idl_type.is_traceable, |
177 'member_cpp_type': member_cpp_type(), | 179 'member_cpp_type': member_cpp_type(), |
178 'null_setter_name': null_setter_name_for_dictionary_member(member), | 180 'null_setter_name': null_setter_name_for_dictionary_member(member), |
179 'rvalue_cpp_type': idl_type.cpp_type_args(used_as_rvalue_type=True), | 181 'rvalue_cpp_type': idl_type.cpp_type_args(used_as_rvalue_type=True), |
180 'setter_name': setter_name_for_dictionary_member(member), | 182 'setter_name': setter_name_for_dictionary_member(member), |
181 } | 183 } |
OLD | NEW |