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 copy | 9 import copy |
10 import operator | 10 import operator |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 'cpp_default_value': cpp_default_value, | 76 'cpp_default_value': cpp_default_value, |
77 'cpp_type': idl_type.cpp_type, | 77 'cpp_type': idl_type.cpp_type, |
78 'cpp_value_to_v8_value': idl_type.cpp_value_to_v8_value( | 78 'cpp_value_to_v8_value': idl_type.cpp_value_to_v8_value( |
79 cpp_value='impl->%s()' % member.name, isolate='isolate', | 79 cpp_value='impl->%s()' % member.name, isolate='isolate', |
80 creation_context='creationContext', | 80 creation_context='creationContext', |
81 extended_attributes=member.extended_attributes), | 81 extended_attributes=member.extended_attributes), |
82 'has_method_name': has_method_name_for_dictionary_member(member), | 82 'has_method_name': has_method_name_for_dictionary_member(member), |
83 'name': member.name, | 83 'name': member.name, |
84 'setter_name': setter_name_for_dictionary_member(member), | 84 'setter_name': setter_name_for_dictionary_member(member), |
85 'v8_default_value': v8_default_value, | 85 'v8_default_value': v8_default_value, |
86 'v8_type': v8_types.v8_type(idl_type.base_type), | |
87 } | 86 } |
88 | 87 |
89 | 88 |
90 # Context for implementation classes | 89 # Context for implementation classes |
91 | 90 |
92 def dictionary_impl_context(dictionary, interfaces_info): | 91 def dictionary_impl_context(dictionary, interfaces_info): |
93 includes.clear() | 92 includes.clear() |
94 header_includes = set(['platform/heap/Handle.h']) | 93 header_includes = set(['platform/heap/Handle.h']) |
95 return { | 94 return { |
96 'header_includes': header_includes, | 95 'header_includes': header_includes, |
(...skipping 30 matching lines...) Expand all Loading... |
127 'getter_expression': getter_expression(), | 126 'getter_expression': getter_expression(), |
128 'has_method_expression': has_method_expression(), | 127 'has_method_expression': has_method_expression(), |
129 'has_method_name': has_method_name_for_dictionary_member(member), | 128 'has_method_name': has_method_name_for_dictionary_member(member), |
130 'is_traceable': (idl_type.is_garbage_collected or | 129 'is_traceable': (idl_type.is_garbage_collected or |
131 idl_type.is_will_be_garbage_collected), | 130 idl_type.is_will_be_garbage_collected), |
132 'member_cpp_type': member_cpp_type(), | 131 'member_cpp_type': member_cpp_type(), |
133 'name': member.name, | 132 'name': member.name, |
134 'rvalue_cpp_type': idl_type.cpp_type_args(used_as_rvalue_type=True), | 133 'rvalue_cpp_type': idl_type.cpp_type_args(used_as_rvalue_type=True), |
135 'setter_name': setter_name_for_dictionary_member(member), | 134 'setter_name': setter_name_for_dictionary_member(member), |
136 } | 135 } |
OLD | NEW |