| 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 | 97 |
| 98 return { | 98 return { |
| 99 'cpp_default_value': cpp_default_value, | 99 'cpp_default_value': cpp_default_value, |
| 100 'cpp_name': cpp_name, | 100 'cpp_name': cpp_name, |
| 101 'cpp_type': unwrapped_idl_type.cpp_type, | 101 'cpp_type': unwrapped_idl_type.cpp_type, |
| 102 'cpp_value_to_v8_value': unwrapped_idl_type.cpp_value_to_v8_value( | 102 'cpp_value_to_v8_value': unwrapped_idl_type.cpp_value_to_v8_value( |
| 103 cpp_value='impl.%s()' % cpp_name, isolate='isolate', | 103 cpp_value='impl.%s()' % cpp_name, isolate='isolate', |
| 104 creation_context='creationContext', | 104 creation_context='creationContext', |
| 105 extended_attributes=member.extended_attributes), | 105 extended_attributes=member.extended_attributes), |
| 106 'deprecate_as': v8_utilities.deprecate_as(member), | 106 'deprecate_as': v8_utilities.deprecate_as(member), |
| 107 'enum_validation_expression': unwrapped_idl_type.enum_validation_express
ion, | 107 'enum_values': unwrapped_idl_type.enum_values, |
| 108 'has_method_name': has_method_name_for_dictionary_member(member), | 108 'has_method_name': has_method_name_for_dictionary_member(member), |
| 109 'idl_type': idl_type.base_type, | 109 'idl_type': idl_type.base_type, |
| 110 'is_interface_type': idl_type.is_interface_type and not idl_type.is_dict
ionary, | 110 'is_interface_type': idl_type.is_interface_type and not idl_type.is_dict
ionary, |
| 111 'is_nullable': idl_type.is_nullable, | 111 'is_nullable': idl_type.is_nullable, |
| 112 'is_object': unwrapped_idl_type.name == 'Object', | 112 'is_object': unwrapped_idl_type.name == 'Object', |
| 113 'name': member.name, | 113 'name': member.name, |
| 114 'setter_name': setter_name_for_dictionary_member(member), | 114 'setter_name': setter_name_for_dictionary_member(member), |
| 115 'null_setter_name': null_setter_name_for_dictionary_member(member), | 115 'null_setter_name': null_setter_name_for_dictionary_member(member), |
| 116 'v8_default_value': v8_default_value, | 116 'v8_default_value': v8_default_value, |
| 117 'v8_value_to_local_cpp_value': unwrapped_idl_type.v8_value_to_local_cpp_
value( | 117 'v8_value_to_local_cpp_value': unwrapped_idl_type.v8_value_to_local_cpp_
value( |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 'getter_expression': getter_expression(), | 191 'getter_expression': getter_expression(), |
| 192 'has_method_expression': has_method_expression(), | 192 'has_method_expression': has_method_expression(), |
| 193 'has_method_name': has_method_name_for_dictionary_member(member), | 193 'has_method_name': has_method_name_for_dictionary_member(member), |
| 194 'is_object': is_object, | 194 'is_object': is_object, |
| 195 'is_traceable': idl_type.is_traceable, | 195 'is_traceable': idl_type.is_traceable, |
| 196 'member_cpp_type': member_cpp_type(), | 196 'member_cpp_type': member_cpp_type(), |
| 197 'null_setter_name': null_setter_name_for_dictionary_member(member), | 197 'null_setter_name': null_setter_name_for_dictionary_member(member), |
| 198 'rvalue_cpp_type': idl_type.cpp_type_args(used_as_rvalue_type=True), | 198 'rvalue_cpp_type': idl_type.cpp_type_args(used_as_rvalue_type=True), |
| 199 'setter_name': setter_name_for_dictionary_member(member), | 199 'setter_name': setter_name_for_dictionary_member(member), |
| 200 } | 200 } |
| OLD | NEW |