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

Side by Side Diff: Source/bindings/scripts/v8_methods.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/scripts/v8_attributes.py ('k') | Source/bindings/scripts/v8_utilities.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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 'is_variadic': arguments and arguments[-1].is_variadic, 181 'is_variadic': arguments and arguments[-1].is_variadic,
182 'measure_as': v8_utilities.measure_as(method, interface), # [MeasureAs] 182 'measure_as': v8_utilities.measure_as(method, interface), # [MeasureAs]
183 'name': name, 183 'name': name,
184 'number_of_arguments': len(arguments), 184 'number_of_arguments': len(arguments),
185 'number_of_required_arguments': len([ 185 'number_of_required_arguments': len([
186 argument for argument in arguments 186 argument for argument in arguments
187 if not (argument.is_optional or argument.is_variadic)]), 187 if not (argument.is_optional or argument.is_variadic)]),
188 'number_of_required_or_variadic_arguments': len([ 188 'number_of_required_or_variadic_arguments': len([
189 argument for argument in arguments 189 argument for argument in arguments
190 if not argument.is_optional]), 190 if not argument.is_optional]),
191 'on_instance': v8_utilities.on_instance(interface, method),
192 'on_interface': v8_utilities.on_interface(interface, method),
193 'on_prototype': v8_utilities.on_prototype(interface, method),
191 'only_exposed_to_private_script': is_only_exposed_to_private_script, 194 'only_exposed_to_private_script': is_only_exposed_to_private_script,
192 'private_script_v8_value_to_local_cpp_value': idl_type.v8_value_to_local _cpp_value( 195 'private_script_v8_value_to_local_cpp_value': idl_type.v8_value_to_local _cpp_value(
193 extended_attributes, 'v8Value', 'cppValue', isolate='scriptState->is olate()', bailout_return_value='false'), 196 extended_attributes, 'v8Value', 'cppValue', isolate='scriptState->is olate()', bailout_return_value='false'),
194 'property_attributes': property_attributes(interface, method), 197 'property_attributes': property_attributes(interface, method),
195 'returns_promise': method.returns_promise, 198 'returns_promise': method.returns_promise,
196 'runtime_enabled_function': v8_utilities.runtime_enabled_function_name(m ethod), # [RuntimeEnabled] 199 'runtime_enabled_function': v8_utilities.runtime_enabled_function_name(m ethod), # [RuntimeEnabled]
197 'should_be_exposed_to_script': not (is_implemented_in_private_script and is_only_exposed_to_private_script), 200 'should_be_exposed_to_script': not (is_implemented_in_private_script and is_only_exposed_to_private_script),
198 'signature': 'v8::Local<v8::Signature>()' if is_static or 'DoNotCheckSig nature' in extended_attributes else 'defaultSignature', 201 'signature': 'v8::Local<v8::Signature>()' if is_static or 'DoNotCheckSig nature' in extended_attributes else 'defaultSignature',
199 'use_output_parameter_for_result': idl_type.use_output_parameter_for_res ult, 202 'use_output_parameter_for_result': idl_type.use_output_parameter_for_res ult,
200 'use_local_result': use_local_result(method), 203 'use_local_result': use_local_result(method),
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 return method.idl_type and method.idl_type.name == 'Promise' 471 return method.idl_type and method.idl_type.name == 'Promise'
469 472
470 IdlOperation.returns_promise = property(method_returns_promise) 473 IdlOperation.returns_promise = property(method_returns_promise)
471 474
472 475
473 def argument_conversion_needs_exception_state(method, argument): 476 def argument_conversion_needs_exception_state(method, argument):
474 idl_type = argument.idl_type 477 idl_type = argument.idl_type
475 return (idl_type.v8_conversion_needs_exception_state or 478 return (idl_type.v8_conversion_needs_exception_state or
476 argument.is_variadic or 479 argument.is_variadic or
477 (method.returns_promise and idl_type.is_string_type)) 480 (method.returns_promise and idl_type.is_string_type))
OLDNEW
« no previous file with comments | « Source/bindings/scripts/v8_attributes.py ('k') | Source/bindings/scripts/v8_utilities.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698