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

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

Issue 1181113006: bindings: Introduces on_{instance,prototype,interface} in the code generator. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Addressed review comments. 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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 'is_partial_interface_member': 131 'is_partial_interface_member':
132 'PartialInterfaceImplementedAs' in extended_attributes, 132 'PartialInterfaceImplementedAs' in extended_attributes,
133 'is_per_world_bindings': 'PerWorldBindings' in extended_attributes, 133 'is_per_world_bindings': 'PerWorldBindings' in extended_attributes,
134 'is_put_forwards': 'PutForwards' in extended_attributes, 134 'is_put_forwards': 'PutForwards' in extended_attributes,
135 'is_read_only': attribute.is_read_only, 135 'is_read_only': attribute.is_read_only,
136 'is_reflect': is_reflect, 136 'is_reflect': is_reflect,
137 'is_replaceable': 'Replaceable' in attribute.extended_attributes, 137 'is_replaceable': 'Replaceable' in attribute.extended_attributes,
138 'is_static': attribute.is_static, 138 'is_static': attribute.is_static,
139 'is_url': 'URL' in extended_attributes, 139 'is_url': 'URL' in extended_attributes,
140 'is_unforgeable': is_unforgeable(interface, attribute), 140 'is_unforgeable': is_unforgeable(interface, attribute),
141 'on_instance': v8_utilities.on_instance(interface, attribute),
142 'on_interface': v8_utilities.on_interface(interface, attribute),
143 'on_prototype': v8_utilities.on_prototype(interface, attribute),
141 'use_output_parameter_for_result': idl_type.use_output_parameter_for_res ult, 144 'use_output_parameter_for_result': idl_type.use_output_parameter_for_res ult,
142 'measure_as': v8_utilities.measure_as(attribute, interface), # [Measure As] 145 'measure_as': v8_utilities.measure_as(attribute, interface), # [Measure As]
143 'name': attribute.name, 146 'name': attribute.name,
144 'only_exposed_to_private_script': is_only_exposed_to_private_script, 147 'only_exposed_to_private_script': is_only_exposed_to_private_script,
145 'private_script_v8_value_to_local_cpp_value': idl_type.v8_value_to_local _cpp_value( 148 'private_script_v8_value_to_local_cpp_value': idl_type.v8_value_to_local _cpp_value(
146 extended_attributes, 'v8Value', 'cppValue', bailout_return_value='fa lse', isolate='scriptState->isolate()'), 149 extended_attributes, 'v8Value', 'cppValue', bailout_return_value='fa lse', isolate='scriptState->isolate()'),
147 'property_attributes': property_attributes(interface, attribute), 150 'property_attributes': property_attributes(interface, attribute),
148 'reflect_empty': extended_attributes.get('ReflectEmpty'), 151 'reflect_empty': extended_attributes.get('ReflectEmpty'),
149 'reflect_invalid': extended_attributes.get('ReflectInvalid', ''), 152 'reflect_invalid': extended_attributes.get('ReflectInvalid', ''),
150 'reflect_missing': extended_attributes.get('ReflectMissing'), 153 'reflect_missing': extended_attributes.get('ReflectMissing'),
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
540 return attribute.idl_type.name.endswith('Constructor') 543 return attribute.idl_type.name.endswith('Constructor')
541 544
542 545
543 def update_constructor_attribute_context(interface, attribute, context): 546 def update_constructor_attribute_context(interface, attribute, context):
544 context['needs_constructor_getter_callback'] = context['measure_as'] or cont ext['deprecate_as'] 547 context['needs_constructor_getter_callback'] = context['measure_as'] or cont ext['deprecate_as']
545 # When the attribute name is the same as the interface name, do not generate 548 # When the attribute name is the same as the interface name, do not generate
546 # callback functions for each attribute and use 549 # callback functions for each attribute and use
547 # {{cpp_class}}ConstructorAttributeSetterCallback. Otherwise, generate 550 # {{cpp_class}}ConstructorAttributeSetterCallback. Otherwise, generate
548 # a callback function in order to hard-code the attribute name. 551 # a callback function in order to hard-code the attribute name.
549 context['needs_constructor_setter_callback'] = context['name'] != context['c onstructor_type'] 552 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