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

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

Issue 282263007: Fix bindings when using [CachedAttribute] on Array. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@language_change_tests
Patch Set: Created 6 years, 7 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 | « no previous file | Source/bindings/templates/attributes.cpp » ('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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 if base_idl_type != 'EventHandler' and idl_type.is_interface_type: 194 if base_idl_type != 'EventHandler' and idl_type.is_interface_type:
195 release = True 195 release = True
196 196
197 def v8_set_return_value_statement(for_main_world=False): 197 def v8_set_return_value_statement(for_main_world=False):
198 if contents['is_keep_alive_for_gc']: 198 if contents['is_keep_alive_for_gc']:
199 return 'v8SetReturnValue(info, wrapper)' 199 return 'v8SetReturnValue(info, wrapper)'
200 return idl_type.v8_set_return_value(cpp_value, extended_attributes=exten ded_attributes, script_wrappable='impl', release=release, for_main_world=for_mai n_world) 200 return idl_type.v8_set_return_value(cpp_value, extended_attributes=exten ded_attributes, script_wrappable='impl', release=release, for_main_world=for_mai n_world)
201 201
202 contents.update({ 202 contents.update({
203 'cpp_value': cpp_value, 203 'cpp_value': cpp_value,
204 # We need to override cpp_value_to_v8_value to make sure the cpp_value b eing used is in sync.
haraken 2014/05/16 11:06:22 I'd remove this comment.
205 'cpp_value_to_v8_value': idl_type.cpp_value_to_v8_value(cpp_value=cpp_va lue, creation_context='info.Holder()'),
204 'v8_set_return_value_for_main_world': v8_set_return_value_statement(for_ main_world=True), 206 'v8_set_return_value_for_main_world': v8_set_return_value_statement(for_ main_world=True),
205 'v8_set_return_value': v8_set_return_value_statement(), 207 'v8_set_return_value': v8_set_return_value_statement(),
206 }) 208 })
207 209
208 210
209 def getter_expression(interface, attribute, contents): 211 def getter_expression(interface, attribute, contents):
210 arguments = [] 212 arguments = []
211 this_getter_base_name = getter_base_name(interface, attribute, arguments) 213 this_getter_base_name = getter_base_name(interface, attribute, arguments)
212 getter_name = scoped_name(interface, attribute, this_getter_base_name) 214 getter_name = scoped_name(interface, attribute, this_getter_base_name)
213 215
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 lambda self: strip_suffix(self.base_type, 'Constructor')) 423 lambda self: strip_suffix(self.base_type, 'Constructor'))
422 424
423 425
424 def is_constructor_attribute(attribute): 426 def is_constructor_attribute(attribute):
425 # FIXME: replace this with [ConstructorAttribute] extended attribute 427 # FIXME: replace this with [ConstructorAttribute] extended attribute
426 return attribute.idl_type.base_type.endswith('Constructor') 428 return attribute.idl_type.base_type.endswith('Constructor')
427 429
428 430
429 def generate_constructor_getter(interface, attribute, contents): 431 def generate_constructor_getter(interface, attribute, contents):
430 contents['needs_constructor_getter_callback'] = contents['measure_as'] or co ntents['deprecate_as'] 432 contents['needs_constructor_getter_callback'] = contents['measure_as'] or co ntents['deprecate_as']
OLDNEW
« no previous file with comments | « no previous file | Source/bindings/templates/attributes.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698