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

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

Issue 142593004: Revert of IDL compiler: sync Python to r165262 (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 11 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
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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 'v8_set_return_value': v8_set_return_value(interface.name, method, this_ cpp_value), 127 'v8_set_return_value': v8_set_return_value(interface.name, method, this_ cpp_value),
128 'world_suffixes': ['', 'ForMainWorld'] if 'PerWorldBindings' in extended _attributes else [''], # [PerWorldBindings] 128 'world_suffixes': ['', 'ForMainWorld'] if 'PerWorldBindings' in extended _attributes else [''], # [PerWorldBindings]
129 } 129 }
130 return contents 130 return contents
131 131
132 132
133 def generate_argument(interface, method, argument, index): 133 def generate_argument(interface, method, argument, index):
134 extended_attributes = argument.extended_attributes 134 extended_attributes = argument.extended_attributes
135 idl_type = argument.idl_type 135 idl_type = argument.idl_type
136 this_cpp_value = cpp_value(interface, method, index) 136 this_cpp_value = cpp_value(interface, method, index)
137 if idl_type == 'Node':
138 includes.update(['core/frame/UseCounter.h', 'V8Attr.h'])
139 return { 137 return {
140 'cpp_type': v8_types.cpp_type(idl_type), 138 'cpp_type': v8_types.cpp_type(idl_type),
141 'cpp_value': this_cpp_value, 139 'cpp_value': this_cpp_value,
142 'enum_validation_expression': v8_utilities.enum_validation_expression(id l_type), 140 'enum_validation_expression': v8_utilities.enum_validation_expression(id l_type),
143 'has_default': 'Default' in extended_attributes, 141 'has_default': 'Default' in extended_attributes,
144 'idl_type': idl_type, 142 'idl_type': idl_type,
145 'index': index, 143 'index': index,
146 'is_clamp': 'Clamp' in extended_attributes, 144 'is_clamp': 'Clamp' in extended_attributes,
147 'is_callback_interface': v8_types.is_callback_interface(idl_type), 145 'is_callback_interface': v8_types.is_callback_interface(idl_type),
148 'is_nullable': argument.is_nullable, 146 'is_nullable': argument.is_nullable,
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 return 'V8TRYCATCH_VOID(Vector<{cpp_type}>, {name}, toNativeArguments<{c pp_type}>(info, {index}))'.format( 208 return 'V8TRYCATCH_VOID(Vector<{cpp_type}>, {name}, toNativeArguments<{c pp_type}>(info, {index}))'.format(
211 cpp_type=v8_types.cpp_type(idl_type), name=name, index=index) 209 cpp_type=v8_types.cpp_type(idl_type), name=name, index=index)
212 # [Default=NullString] 210 # [Default=NullString]
213 if (argument.is_optional and idl_type == 'DOMString' and 211 if (argument.is_optional and idl_type == 'DOMString' and
214 extended_attributes.get('Default') == 'NullString'): 212 extended_attributes.get('Default') == 'NullString'):
215 v8_value = 'argumentOrNull(info, %s)' % index 213 v8_value = 'argumentOrNull(info, %s)' % index
216 else: 214 else:
217 v8_value = 'info[%s]' % index 215 v8_value = 'info[%s]' % index
218 return v8_types.v8_value_to_local_cpp_value( 216 return v8_types.v8_value_to_local_cpp_value(
219 idl_type, argument.extended_attributes, v8_value, name, index=index) 217 idl_type, argument.extended_attributes, v8_value, name, index=index)
OLDNEW
« no previous file with comments | « Source/bindings/scripts/unstable/v8_attributes.py ('k') | Source/bindings/templates/attributes.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698