Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(24)

Side by Side Diff: Source/bindings/scripts/v8_dictionary.py

Issue 946973005: IDL: Drop value conversion (V8 -> C++) macros from generated code (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: address comments Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/bindings/scripts/v8_attributes.py ('k') | Source/bindings/scripts/v8_interface.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 'deprecate_as': v8_utilities.deprecate_as(member), 110 'deprecate_as': v8_utilities.deprecate_as(member),
111 'enum_validation_expression': unwrapped_idl_type.enum_validation_express ion, 111 'enum_validation_expression': unwrapped_idl_type.enum_validation_express ion,
112 'has_method_name': has_method_name_for_dictionary_member(member), 112 'has_method_name': has_method_name_for_dictionary_member(member),
113 'idl_type': idl_type.base_type, 113 'idl_type': idl_type.base_type,
114 'is_interface_type': idl_type.is_interface_type and not idl_type.is_dict ionary, 114 'is_interface_type': idl_type.is_interface_type and not idl_type.is_dict ionary,
115 'is_nullable': idl_type.is_nullable, 115 'is_nullable': idl_type.is_nullable,
116 'is_object': unwrapped_idl_type.name == 'Object', 116 'is_object': unwrapped_idl_type.name == 'Object',
117 'name': member.name, 117 'name': member.name,
118 'setter_name': setter_name_for_dictionary_member(member), 118 'setter_name': setter_name_for_dictionary_member(member),
119 'null_setter_name': null_setter_name_for_dictionary_member(member), 119 'null_setter_name': null_setter_name_for_dictionary_member(member),
120 'use_output_parameter_for_result': unwrapped_idl_type.use_output_paramet er_for_result,
121 'v8_default_value': v8_default_value, 120 'v8_default_value': v8_default_value,
122 'v8_value_to_local_cpp_value': unwrapped_idl_type.v8_value_to_local_cpp_ value( 121 'v8_value_to_local_cpp_value': unwrapped_idl_type.v8_value_to_local_cpp_ value(
123 member.extended_attributes, member.name + 'Value', 122 member.extended_attributes, member.name + 'Value',
124 member.name, isolate='isolate', restricted_float=restricted_float), 123 member.name, isolate='isolate', use_exception_state=True,
124 restricted_float=restricted_float),
125 } 125 }
126 126
127 127
128 # Context for implementation classes 128 # Context for implementation classes
129 129
130 def dictionary_impl_context(dictionary, interfaces_info): 130 def dictionary_impl_context(dictionary, interfaces_info):
131 def remove_duplicate_members(members): 131 def remove_duplicate_members(members):
132 # When [ImplementedAs] is used, cpp_name can conflict. For example, 132 # When [ImplementedAs] is used, cpp_name can conflict. For example,
133 # dictionary D { long foo; [ImplementedAs=foo, DeprecateAs=Foo] long old Foo; }; 133 # dictionary D { long foo; [ImplementedAs=foo, DeprecateAs=Foo] long old Foo; };
134 # This function removes such duplications, checking they have the same t ype. 134 # This function removes such duplications, checking they have the same t ype.
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 'getter_expression': getter_expression(), 196 'getter_expression': getter_expression(),
197 'has_method_expression': has_method_expression(), 197 'has_method_expression': has_method_expression(),
198 'has_method_name': has_method_name_for_dictionary_member(member), 198 'has_method_name': has_method_name_for_dictionary_member(member),
199 'is_object': is_object, 199 'is_object': is_object,
200 'is_traceable': idl_type.is_traceable, 200 'is_traceable': idl_type.is_traceable,
201 'member_cpp_type': member_cpp_type(), 201 'member_cpp_type': member_cpp_type(),
202 'null_setter_name': null_setter_name_for_dictionary_member(member), 202 'null_setter_name': null_setter_name_for_dictionary_member(member),
203 'rvalue_cpp_type': idl_type.cpp_type_args(used_as_rvalue_type=True), 203 'rvalue_cpp_type': idl_type.cpp_type_args(used_as_rvalue_type=True),
204 'setter_name': setter_name_for_dictionary_member(member), 204 'setter_name': setter_name_for_dictionary_member(member),
205 } 205 }
OLDNEW
« no previous file with comments | « Source/bindings/scripts/v8_attributes.py ('k') | Source/bindings/scripts/v8_interface.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698