OLD | NEW |
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 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 # Value handling | 287 # Value handling |
288 ################################################################################ | 288 ################################################################################ |
289 | 289 |
290 def cpp_value(interface, method, number_of_arguments): | 290 def cpp_value(interface, method, number_of_arguments): |
291 def cpp_argument(argument): | 291 def cpp_argument(argument): |
292 idl_type = argument.idl_type | 292 idl_type = argument.idl_type |
293 if idl_type.name == 'EventListener': | 293 if idl_type.name == 'EventListener': |
294 return argument.name | 294 return argument.name |
295 if idl_type.is_dictionary: | 295 if idl_type.is_dictionary: |
296 return '*%s' % argument.name | 296 return '*%s' % argument.name |
297 if (idl_type.is_callback_interface or | 297 if (idl_type.name in ['NodeFilter', 'NodeFilterOrNull', |
298 idl_type.name in ['NodeFilter', 'NodeFilterOrNull', | |
299 'XPathNSResolver', 'XPathNSResolverOrNull']): | 298 'XPathNSResolver', 'XPathNSResolverOrNull']): |
300 # FIXME: remove this special case | 299 # FIXME: remove this special case |
301 return '%s.release()' % argument.name | 300 return '%s.release()' % argument.name |
302 return argument.name | 301 return argument.name |
303 | 302 |
304 # Truncate omitted optional arguments | 303 # Truncate omitted optional arguments |
305 arguments = method.arguments[:number_of_arguments] | 304 arguments = method.arguments[:number_of_arguments] |
306 cpp_arguments = [] | 305 cpp_arguments = [] |
307 if 'ImplementedInPrivateScript' in method.extended_attributes: | 306 if 'ImplementedInPrivateScript' in method.extended_attributes: |
308 cpp_arguments.append('toFrameIfNotDetached(info.GetIsolate()->GetCurrent
Context())') | 307 cpp_arguments.append('toFrameIfNotDetached(info.GetIsolate()->GetCurrent
Context())') |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
461 if argument.idl_type.is_dictionary: | 460 if argument.idl_type.is_dictionary: |
462 # We always create impl objects for IDL dictionaries. | 461 # We always create impl objects for IDL dictionaries. |
463 return '%s::create()' % argument.idl_type.base_type | 462 return '%s::create()' % argument.idl_type.base_type |
464 if not argument.default_value: | 463 if not argument.default_value: |
465 return None | 464 return None |
466 return argument.idl_type.literal_cpp_value(argument.default_value) | 465 return argument.idl_type.literal_cpp_value(argument.default_value) |
467 | 466 |
468 IdlTypeBase.union_arguments = None | 467 IdlTypeBase.union_arguments = None |
469 IdlUnionType.union_arguments = property(union_arguments) | 468 IdlUnionType.union_arguments = property(union_arguments) |
470 IdlArgument.default_cpp_value = property(argument_default_cpp_value) | 469 IdlArgument.default_cpp_value = property(argument_default_cpp_value) |
OLD | NEW |