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

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

Issue 724733002: Support for [Clamp] and [EnforceRange] to IDL dictionary. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 1 month 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
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 v8_globals import includes 10 from v8_globals import includes
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 'v8_value_to_local_cpp_value': idl_type.v8_value_to_local_cpp_value(
92 member.extended_attributes, member.name + 'Value',
93 member.name, isolate='isolate'),
91 } 94 }
92 95
93 96
94 # Context for implementation classes 97 # Context for implementation classes
95 98
96 def dictionary_impl_context(dictionary, interfaces_info): 99 def dictionary_impl_context(dictionary, interfaces_info):
97 includes.clear() 100 includes.clear()
98 header_includes = set(['platform/heap/Handle.h']) 101 header_includes = set(['platform/heap/Handle.h'])
99 return { 102 return {
100 'header_includes': header_includes, 103 'header_includes': header_includes,
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 'cpp_name': cpp_name, 142 'cpp_name': cpp_name,
140 'getter_expression': getter_expression(), 143 'getter_expression': getter_expression(),
141 'has_method_expression': has_method_expression(), 144 'has_method_expression': has_method_expression(),
142 'has_method_name': has_method_name_for_dictionary_member(member), 145 'has_method_name': has_method_name_for_dictionary_member(member),
143 'is_object': is_object, 146 'is_object': is_object,
144 'is_traceable': idl_type.is_traceable, 147 'is_traceable': idl_type.is_traceable,
145 'member_cpp_type': member_cpp_type(), 148 'member_cpp_type': member_cpp_type(),
146 'rvalue_cpp_type': idl_type.cpp_type_args(used_as_rvalue_type=True), 149 'rvalue_cpp_type': idl_type.cpp_type_args(used_as_rvalue_type=True),
147 'setter_name': setter_name_for_dictionary_member(member), 150 'setter_name': setter_name_for_dictionary_member(member),
148 } 151 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698