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

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

Issue 1192753003: Merge 196373 "binding: Supports static operations/attrs returnin..." (Closed) Base URL: svn://svn.chromium.org/blink/branches/chromium/2357/
Patch Set: 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/V8Binding.h ('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 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 cpp_value = 'cppValue' 206 cpp_value = 'cppValue'
207 # EventHandler has special handling 207 # EventHandler has special handling
208 if base_idl_type != 'EventHandler': 208 if base_idl_type != 'EventHandler':
209 release = idl_type.release 209 release = idl_type.release
210 210
211 def v8_set_return_value_statement(for_main_world=False): 211 def v8_set_return_value_statement(for_main_world=False):
212 if context['is_keep_alive_for_gc'] or 'CachedAttribute' in extended_attr ibutes: 212 if context['is_keep_alive_for_gc'] or 'CachedAttribute' in extended_attr ibutes:
213 return 'v8SetReturnValue(info, v8Value)' 213 return 'v8SetReturnValue(info, v8Value)'
214 return idl_type.v8_set_return_value( 214 return idl_type.v8_set_return_value(
215 cpp_value, extended_attributes=extended_attributes, script_wrappable ='impl', 215 cpp_value, extended_attributes=extended_attributes, script_wrappable ='impl',
216 release=release, for_main_world=for_main_world) 216 release=release, for_main_world=for_main_world, is_static=attribute. is_static)
217 217
218 context.update({ 218 context.update({
219 'cpp_value': cpp_value, 219 'cpp_value': cpp_value,
220 'cpp_value_to_v8_value': idl_type.cpp_value_to_v8_value( 220 'cpp_value_to_v8_value': idl_type.cpp_value_to_v8_value(
221 cpp_value=cpp_value, creation_context='info.Holder()', 221 cpp_value=cpp_value, creation_context='info.Holder()',
222 extended_attributes=extended_attributes), 222 extended_attributes=extended_attributes),
223 'v8_set_return_value_for_main_world': v8_set_return_value_statement(for_ main_world=True), 223 'v8_set_return_value_for_main_world': v8_set_return_value_statement(for_ main_world=True),
224 'v8_set_return_value': v8_set_return_value_statement(), 224 'v8_set_return_value': v8_set_return_value_statement(),
225 }) 225 })
226 226
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
554 return attribute.idl_type.name.endswith('Constructor') 554 return attribute.idl_type.name.endswith('Constructor')
555 555
556 556
557 def update_constructor_attribute_context(interface, attribute, context): 557 def update_constructor_attribute_context(interface, attribute, context):
558 context['needs_constructor_getter_callback'] = context['measure_as'] or cont ext['deprecate_as'] 558 context['needs_constructor_getter_callback'] = context['measure_as'] or cont ext['deprecate_as']
559 # When the attribute name is the same as the interface name, do not generate 559 # When the attribute name is the same as the interface name, do not generate
560 # callback functions for each attribute and use 560 # callback functions for each attribute and use
561 # {{cpp_class}}ConstructorAttributeSetterCallback. Otherwise, generate 561 # {{cpp_class}}ConstructorAttributeSetterCallback. Otherwise, generate
562 # a callback function in order to hard-code the attribute name. 562 # a callback function in order to hard-code the attribute name.
563 context['needs_constructor_setter_callback'] = context['name'] != context['c onstructor_type'] 563 context['needs_constructor_setter_callback'] = context['name'] != context['c onstructor_type']
OLDNEW
« no previous file with comments | « Source/bindings/core/v8/V8Binding.h ('k') | Source/bindings/scripts/v8_methods.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698