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

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

Issue 469243002: IDL: Prefer to extend IdlTypeBase instead of IdlType (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: drop import of IdlType Created 6 years, 4 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 | « Source/bindings/scripts/v8_callback_interface.py ('k') | Source/bindings/scripts/v8_types.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 10 matching lines...) Expand all
21 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 22 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 28
29 """Generate template values for methods. 29 """Generate template values for methods.
30 30
31 Extends IdlType and IdlUnionType with property |union_arguments|. 31 Extends IdlArgument with property |default_cpp_value|.
32 Extends IdlTypeBase and IdlUnionType with property |union_arguments|.
32 33
33 Design doc: http://www.chromium.org/developers/design-documents/idl-compiler 34 Design doc: http://www.chromium.org/developers/design-documents/idl-compiler
34 """ 35 """
35 36
36 from idl_definitions import IdlArgument 37 from idl_definitions import IdlArgument
37 from idl_types import IdlType, IdlUnionType, inherits_interface 38 from idl_types import IdlTypeBase, IdlUnionType, inherits_interface
38 from v8_globals import includes 39 from v8_globals import includes
39 import v8_types 40 import v8_types
40 import v8_utilities 41 import v8_utilities
41 from v8_utilities import has_extended_attribute_value 42 from v8_utilities import has_extended_attribute_value
42 43
43 44
44 # Methods with any of these require custom method registration code in the 45 # Methods with any of these require custom method registration code in the
45 # interface's configure*Template() function. 46 # interface's configure*Template() function.
46 CUSTOM_REGISTRATION_EXTENDED_ATTRIBUTES = frozenset([ 47 CUSTOM_REGISTRATION_EXTENDED_ATTRIBUTES = frozenset([
47 'DoNotCheckSecurity', 48 'DoNotCheckSecurity',
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 return [arg 406 return [arg
406 for i in range(len(idl_type.member_types)) 407 for i in range(len(idl_type.member_types))
407 for arg in ['result%sEnabled' % i, 'result%s' % i]] 408 for arg in ['result%sEnabled' % i, 'result%s' % i]]
408 409
409 410
410 def argument_default_cpp_value(argument): 411 def argument_default_cpp_value(argument):
411 if not argument.default_value: 412 if not argument.default_value:
412 return None 413 return None
413 return argument.idl_type.literal_cpp_value(argument.default_value) 414 return argument.idl_type.literal_cpp_value(argument.default_value)
414 415
415 IdlType.union_arguments = property(lambda self: None) 416 IdlTypeBase.union_arguments = None
416 IdlUnionType.union_arguments = property(union_arguments) 417 IdlUnionType.union_arguments = property(union_arguments)
417 IdlArgument.default_cpp_value = property(argument_default_cpp_value) 418 IdlArgument.default_cpp_value = property(argument_default_cpp_value)
OLDNEW
« no previous file with comments | « Source/bindings/scripts/v8_callback_interface.py ('k') | Source/bindings/scripts/v8_types.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698