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

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

Issue 145773004: IDL compiler: [ReflectOnly] (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 10 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 | « 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 is_setter_raises_exception or has_strict_type_checking or 115 is_setter_raises_exception or has_strict_type_checking or
116 v8_types.is_integer_type(idl_type)), 116 v8_types.is_integer_type(idl_type)),
117 'is_static': attribute.is_static, 117 'is_static': attribute.is_static,
118 'is_url': 'URL' in extended_attributes, 118 'is_url': 'URL' in extended_attributes,
119 'is_unforgeable': 'Unforgeable' in extended_attributes, 119 'is_unforgeable': 'Unforgeable' in extended_attributes,
120 'measure_as': v8_utilities.measure_as(attribute), # [MeasureAs] 120 'measure_as': v8_utilities.measure_as(attribute), # [MeasureAs]
121 'name': attribute.name, 121 'name': attribute.name,
122 'per_context_enabled_function': v8_utilities.per_context_enabled_functio n_name(attribute), # [PerContextEnabled] 122 'per_context_enabled_function': v8_utilities.per_context_enabled_functio n_name(attribute), # [PerContextEnabled]
123 'property_attributes': property_attributes(attribute), 123 'property_attributes': property_attributes(attribute),
124 'put_forwards': 'PutForwards' in extended_attributes, 124 'put_forwards': 'PutForwards' in extended_attributes,
125 'reflect_only': extended_attributes['ReflectOnly'].split('|')
126 if 'ReflectOnly' in extended_attributes else None, # [ReflectOnly]
125 'setter_callback': setter_callback_name(interface, attribute), 127 'setter_callback': setter_callback_name(interface, attribute),
126 'v8_type': v8_types.v8_type(idl_type), 128 'v8_type': v8_types.v8_type(idl_type),
127 'runtime_enabled_function': v8_utilities.runtime_enabled_function_name(a ttribute), # [RuntimeEnabled] 129 'runtime_enabled_function': v8_utilities.runtime_enabled_function_name(a ttribute), # [RuntimeEnabled]
128 'world_suffixes': ['', 'ForMainWorld'] 130 'world_suffixes': ['', 'ForMainWorld']
129 if 'PerWorldBindings' in extended_attributes 131 if 'PerWorldBindings' in extended_attributes
130 else [''], # [PerWorldBindings] 132 else [''], # [PerWorldBindings]
131 } 133 }
132 134
133 if is_constructor_attribute(attribute): 135 if is_constructor_attribute(attribute):
134 return contents 136 return contents
(...skipping 25 matching lines...) Expand all
160 if (attribute.is_nullable or 162 if (attribute.is_nullable or
161 idl_type == 'EventHandler' or 163 idl_type == 'EventHandler' or
162 'CachedAttribute' in extended_attributes or 164 'CachedAttribute' in extended_attributes or
163 contents['is_getter_raises_exception']): 165 contents['is_getter_raises_exception']):
164 contents['cpp_value_original'] = cpp_value 166 contents['cpp_value_original'] = cpp_value
165 cpp_value = 'jsValue' 167 cpp_value = 'jsValue'
166 # EventHandler has special handling 168 # EventHandler has special handling
167 if idl_type != 'EventHandler' and v8_types.is_interface_type(idl_type): 169 if idl_type != 'EventHandler' and v8_types.is_interface_type(idl_type):
168 release = True 170 release = True
169 171
172 if 'ReflectOnly' in extended_attributes:
173 contents['cpp_value_original'] = cpp_value
174 # FIXME: rename to jsValue
175 cpp_value = 'resultValue'
Nils Barth (inactive) 2014/02/05 06:11:42 The local variable is called 'resultValue', which
176
170 def v8_set_return_value_statement(for_main_world=False): 177 def v8_set_return_value_statement(for_main_world=False):
171 if contents['is_keep_alive_for_gc']: 178 if contents['is_keep_alive_for_gc']:
172 return 'v8SetReturnValue(info, wrapper)' 179 return 'v8SetReturnValue(info, wrapper)'
173 return v8_types.v8_set_return_value(idl_type, cpp_value, extended_attrib utes=extended_attributes, script_wrappable='imp', release=release, for_main_worl d=for_main_world) 180 return v8_types.v8_set_return_value(idl_type, cpp_value, extended_attrib utes=extended_attributes, script_wrappable='imp', release=release, for_main_worl d=for_main_world)
174 181
175 contents.update({ 182 contents.update({
176 'cpp_value': cpp_value, 183 'cpp_value': cpp_value,
177 'v8_set_return_value_for_main_world': v8_set_return_value_statement(for_ main_world=True), 184 'v8_set_return_value_for_main_world': v8_set_return_value_statement(for_ main_world=True),
178 'v8_set_return_value': v8_set_return_value_statement(), 185 'v8_set_return_value': v8_set_return_value_statement(),
179 }) 186 })
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 property_attributes_list.append('v8::DontDelete') 383 property_attributes_list.append('v8::DontDelete')
377 return property_attributes_list or ['v8::None'] 384 return property_attributes_list or ['v8::None']
378 385
379 386
380 ################################################################################ 387 ################################################################################
381 # Constructors 388 # Constructors
382 ################################################################################ 389 ################################################################################
383 390
384 def is_constructor_attribute(attribute): 391 def is_constructor_attribute(attribute):
385 return attribute.idl_type.endswith('Constructor') 392 return attribute.idl_type.endswith('Constructor')
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