| 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 |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 return cpp_default_value, v8_default_value | 72 return cpp_default_value, v8_default_value |
| 73 | 73 |
| 74 cpp_default_value, v8_default_value = default_values() | 74 cpp_default_value, v8_default_value = default_values() |
| 75 cpp_name = v8_utilities.cpp_name(member) | 75 cpp_name = v8_utilities.cpp_name(member) |
| 76 | 76 |
| 77 return { | 77 return { |
| 78 'cpp_default_value': cpp_default_value, | 78 'cpp_default_value': cpp_default_value, |
| 79 'cpp_name': cpp_name, | 79 'cpp_name': cpp_name, |
| 80 'cpp_type': idl_type.cpp_type, | 80 'cpp_type': idl_type.cpp_type, |
| 81 'cpp_value_to_v8_value': idl_type.cpp_value_to_v8_value( | 81 'cpp_value_to_v8_value': idl_type.cpp_value_to_v8_value( |
| 82 cpp_value='impl->%s()' % cpp_name, isolate='isolate', | 82 cpp_value='impl.%s()' % cpp_name, isolate='isolate', |
| 83 creation_context='creationContext', | 83 creation_context='creationContext', |
| 84 extended_attributes=member.extended_attributes), | 84 extended_attributes=member.extended_attributes), |
| 85 'enum_validation_expression': idl_type.enum_validation_expression, | 85 'enum_validation_expression': idl_type.enum_validation_expression, |
| 86 'has_method_name': has_method_name_for_dictionary_member(member), | 86 'has_method_name': has_method_name_for_dictionary_member(member), |
| 87 'is_object': idl_type.name == 'Object', | 87 'is_object': idl_type.name == 'Object', |
| 88 'name': member.name, | 88 'name': member.name, |
| 89 'setter_name': setter_name_for_dictionary_member(member), | 89 'setter_name': setter_name_for_dictionary_member(member), |
| 90 'v8_default_value': v8_default_value, | 90 'v8_default_value': v8_default_value, |
| 91 } | 91 } |
| 92 | 92 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 'getter_expression': getter_expression(), | 140 'getter_expression': getter_expression(), |
| 141 'has_method_expression': has_method_expression(), | 141 'has_method_expression': has_method_expression(), |
| 142 'has_method_name': has_method_name_for_dictionary_member(member), | 142 'has_method_name': has_method_name_for_dictionary_member(member), |
| 143 'is_object': is_object, | 143 'is_object': is_object, |
| 144 'is_traceable': (idl_type.is_garbage_collected or | 144 'is_traceable': (idl_type.is_garbage_collected or |
| 145 idl_type.is_will_be_garbage_collected), | 145 idl_type.is_will_be_garbage_collected), |
| 146 'member_cpp_type': member_cpp_type(), | 146 'member_cpp_type': member_cpp_type(), |
| 147 'rvalue_cpp_type': idl_type.cpp_type_args(used_as_rvalue_type=True), | 147 'rvalue_cpp_type': idl_type.cpp_type_args(used_as_rvalue_type=True), |
| 148 'setter_name': setter_name_for_dictionary_member(member), | 148 'setter_name': setter_name_for_dictionary_member(member), |
| 149 } | 149 } |
| OLD | NEW |