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

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

Issue 59853010: IDL compiler: [PerContextEnabled] methods (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased Created 7 years, 1 month 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/unstable/v8_interface.py ('k') | Source/bindings/templates/interface.h » ('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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 'is_static': is_static, 94 'is_static': is_static,
95 'measure_as': v8_utilities.measure_as(method), # [MeasureAs] 95 'measure_as': v8_utilities.measure_as(method), # [MeasureAs]
96 'name': name, 96 'name': name,
97 'number_of_arguments': len(arguments), 97 'number_of_arguments': len(arguments),
98 'number_of_required_arguments': len([ 98 'number_of_required_arguments': len([
99 argument for argument in arguments 99 argument for argument in arguments
100 if not (argument.is_optional or argument.is_variadic)]), 100 if not (argument.is_optional or argument.is_variadic)]),
101 'number_of_required_or_variadic_arguments': len([ 101 'number_of_required_or_variadic_arguments': len([
102 argument for argument in arguments 102 argument for argument in arguments
103 if not argument.is_optional]), 103 if not argument.is_optional]),
104 'per_context_enabled_function_name': v8_utilities.per_context_enabled_fu nction_name(method), # [PerContextEnabled]
104 'property_attributes': property_attributes(method), 105 'property_attributes': property_attributes(method),
105 'signature': signature, 106 'signature': signature,
106 'v8_set_return_value': v8_set_return_value(method, this_cpp_value), 107 'v8_set_return_value': v8_set_return_value(method, this_cpp_value),
107 } 108 }
108 return contents 109 return contents
109 110
110 111
111 def generate_argument(interface, method, argument, index): 112 def generate_argument(interface, method, argument, index):
112 extended_attributes = argument.extended_attributes 113 extended_attributes = argument.extended_attributes
113 idl_type = argument.idl_type 114 idl_type = argument.idl_type
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 return 'V8TRYCATCH_VOID(Vector<{cpp_type}>, {name}, toNativeArguments<{c pp_type}>(info, {index}))'.format( 194 return 'V8TRYCATCH_VOID(Vector<{cpp_type}>, {name}, toNativeArguments<{c pp_type}>(info, {index}))'.format(
194 cpp_type=v8_types.cpp_type(idl_type), name=name, index=index) 195 cpp_type=v8_types.cpp_type(idl_type), name=name, index=index)
195 # [Default=NullString] 196 # [Default=NullString]
196 if (argument.is_optional and idl_type == 'DOMString' and 197 if (argument.is_optional and idl_type == 'DOMString' and
197 extended_attributes.get('Default') == 'NullString'): 198 extended_attributes.get('Default') == 'NullString'):
198 v8_value = 'argumentOrNull(info, %s)' % index 199 v8_value = 'argumentOrNull(info, %s)' % index
199 else: 200 else:
200 v8_value = 'info[%s]' % index 201 v8_value = 'info[%s]' % index
201 return v8_types.v8_value_to_local_cpp_value( 202 return v8_types.v8_value_to_local_cpp_value(
202 idl_type, argument.extended_attributes, v8_value, name, index=index) 203 idl_type, argument.extended_attributes, v8_value, name, index=index)
OLDNEW
« no previous file with comments | « Source/bindings/scripts/unstable/v8_interface.py ('k') | Source/bindings/templates/interface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698