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

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

Issue 1161463009: bindings: Supports [LenientThis] extended attributes. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Added a layout test for [LenientThis]. Created 5 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/bindings/core/v8/V8DOMConfiguration.cpp ('k') | Source/bindings/scripts/v8_methods.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 (C) 2013 Google Inc. All rights reserved. 1 # Copyright (C) 2013 Google Inc. All rights reserved.
2 # 2 #
3 # Redistribution and use in source and binary forms, with or without 3 # Redistribution and use in source and binary forms, with or without
4 # modification, are permitted provided that the following conditions are 4 # modification, are permitted provided that the following conditions are
5 # met: 5 # met:
6 # 6 #
7 # * Redistributions of source code must retain the above copyright 7 # * Redistributions of source code must retain the above copyright
8 # notice, this list of conditions and the following disclaimer. 8 # notice, this list of conditions and the following disclaimer.
9 # * Redistributions in binary form must reproduce the above 9 # * Redistributions in binary form must reproduce the above
10 # copyright notice, this list of conditions and the following disclaimer 10 # copyright notice, this list of conditions and the following disclaimer
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 'is_check_security_for_frame': is_check_security_for_frame, 118 'is_check_security_for_frame': is_check_security_for_frame,
119 'is_check_security_for_node': is_check_security_for_node, 119 'is_check_security_for_node': is_check_security_for_node,
120 'is_check_security_for_window': is_check_security_for_window, 120 'is_check_security_for_window': is_check_security_for_window,
121 'is_custom_element_callbacks': is_custom_element_callbacks, 121 'is_custom_element_callbacks': is_custom_element_callbacks,
122 'is_expose_js_accessors': is_expose_js_accessors(interface, attribute), 122 'is_expose_js_accessors': is_expose_js_accessors(interface, attribute),
123 'is_getter_raises_exception': # [RaisesException] 123 'is_getter_raises_exception': # [RaisesException]
124 'RaisesException' in extended_attributes and 124 'RaisesException' in extended_attributes and
125 extended_attributes['RaisesException'] in (None, 'Getter'), 125 extended_attributes['RaisesException'] in (None, 'Getter'),
126 'is_implemented_in_private_script': is_implemented_in_private_script, 126 'is_implemented_in_private_script': is_implemented_in_private_script,
127 'is_keep_alive_for_gc': keep_alive_for_gc, 127 'is_keep_alive_for_gc': keep_alive_for_gc,
128 'is_lenient_this': 'LenientThis' in extended_attributes,
128 'is_nullable': idl_type.is_nullable, 129 'is_nullable': idl_type.is_nullable,
129 'is_explicit_nullable': idl_type.is_explicit_nullable, 130 'is_explicit_nullable': idl_type.is_explicit_nullable,
130 'is_partial_interface_member': 131 'is_partial_interface_member':
131 'PartialInterfaceImplementedAs' in extended_attributes, 132 'PartialInterfaceImplementedAs' in extended_attributes,
132 'is_per_world_bindings': 'PerWorldBindings' in extended_attributes, 133 'is_per_world_bindings': 'PerWorldBindings' in extended_attributes,
133 'is_put_forwards': 'PutForwards' in extended_attributes, 134 'is_put_forwards': 'PutForwards' in extended_attributes,
134 'is_read_only': attribute.is_read_only, 135 'is_read_only': attribute.is_read_only,
135 'is_reflect': is_reflect, 136 'is_reflect': is_reflect,
136 'is_replaceable': 'Replaceable' in attribute.extended_attributes, 137 'is_replaceable': 'Replaceable' in attribute.extended_attributes,
137 'is_static': attribute.is_static, 138 'is_static': attribute.is_static,
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 def v8_set_return_value_statement(for_main_world=False): 209 def v8_set_return_value_statement(for_main_world=False):
209 if context['is_keep_alive_for_gc'] or 'CachedAttribute' in extended_attr ibutes: 210 if context['is_keep_alive_for_gc'] or 'CachedAttribute' in extended_attr ibutes:
210 return 'v8SetReturnValue(info, v8Value)' 211 return 'v8SetReturnValue(info, v8Value)'
211 return idl_type.v8_set_return_value( 212 return idl_type.v8_set_return_value(
212 cpp_value, extended_attributes=extended_attributes, script_wrappable ='impl', 213 cpp_value, extended_attributes=extended_attributes, script_wrappable ='impl',
213 release=release, for_main_world=for_main_world, is_static=attribute. is_static) 214 release=release, for_main_world=for_main_world, is_static=attribute. is_static)
214 215
215 context.update({ 216 context.update({
216 'cpp_value': cpp_value, 217 'cpp_value': cpp_value,
217 'cpp_value_to_v8_value': idl_type.cpp_value_to_v8_value( 218 'cpp_value_to_v8_value': idl_type.cpp_value_to_v8_value(
218 cpp_value=cpp_value, creation_context='info.Holder()', 219 cpp_value=cpp_value, creation_context='holder',
219 extended_attributes=extended_attributes), 220 extended_attributes=extended_attributes),
220 'v8_set_return_value_for_main_world': v8_set_return_value_statement(for_ main_world=True), 221 'v8_set_return_value_for_main_world': v8_set_return_value_statement(for_ main_world=True),
221 'v8_set_return_value': v8_set_return_value_statement(), 222 'v8_set_return_value': v8_set_return_value_statement(),
222 }) 223 })
223 224
224 def getter_expression(interface, attribute, context): 225 def getter_expression(interface, attribute, context):
225 arguments = [] 226 arguments = []
226 this_getter_base_name = getter_base_name(interface, attribute, arguments) 227 this_getter_base_name = getter_base_name(interface, attribute, arguments)
227 getter_name = scoped_name(interface, attribute, this_getter_base_name) 228 getter_name = scoped_name(interface, attribute, this_getter_base_name)
228 229
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
539 return attribute.idl_type.name.endswith('Constructor') 540 return attribute.idl_type.name.endswith('Constructor')
540 541
541 542
542 def update_constructor_attribute_context(interface, attribute, context): 543 def update_constructor_attribute_context(interface, attribute, context):
543 context['needs_constructor_getter_callback'] = context['measure_as'] or cont ext['deprecate_as'] 544 context['needs_constructor_getter_callback'] = context['measure_as'] or cont ext['deprecate_as']
544 # When the attribute name is the same as the interface name, do not generate 545 # When the attribute name is the same as the interface name, do not generate
545 # callback functions for each attribute and use 546 # callback functions for each attribute and use
546 # {{cpp_class}}ConstructorAttributeSetterCallback. Otherwise, generate 547 # {{cpp_class}}ConstructorAttributeSetterCallback. Otherwise, generate
547 # a callback function in order to hard-code the attribute name. 548 # a callback function in order to hard-code the attribute name.
548 context['needs_constructor_setter_callback'] = context['name'] != context['c onstructor_type'] 549 context['needs_constructor_setter_callback'] = context['name'] != context['c onstructor_type']
OLDNEW
« no previous file with comments | « Source/bindings/core/v8/V8DOMConfiguration.cpp ('k') | Source/bindings/scripts/v8_methods.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698