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

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

Issue 148083004: IDL compiler: anonymous indexed property getters (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased Created 6 years, 10 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 includes.add('bindings/v8/BindingSecurity.h') 69 includes.add('bindings/v8/BindingSecurity.h')
70 is_custom_element_callbacks = 'CustomElementCallbacks' in extended_attribute s 70 is_custom_element_callbacks = 'CustomElementCallbacks' in extended_attribute s
71 if is_custom_element_callbacks: 71 if is_custom_element_callbacks:
72 includes.add('core/dom/custom/CustomElementCallbackDispatcher.h') 72 includes.add('core/dom/custom/CustomElementCallbackDispatcher.h')
73 73
74 is_check_security_for_frame = ( 74 is_check_security_for_frame = (
75 'CheckSecurity' in interface.extended_attributes and 75 'CheckSecurity' in interface.extended_attributes and
76 'DoNotCheckSecurity' not in extended_attributes) 76 'DoNotCheckSecurity' not in extended_attributes)
77 is_raises_exception = 'RaisesException' in extended_attributes 77 is_raises_exception = 'RaisesException' in extended_attributes
78 78
79 contents = { 79 return {
80 'activity_logging_world_list': v8_utilities.activity_logging_world_list( method), # [ActivityLogging] 80 'activity_logging_world_list': v8_utilities.activity_logging_world_list( method), # [ActivityLogging]
81 'arguments': [generate_argument(interface, method, argument, index) 81 'arguments': [generate_argument(interface, method, argument, index)
82 for index, argument in enumerate(arguments)], 82 for index, argument in enumerate(arguments)],
83 'conditional_string': v8_utilities.conditional_string(method), 83 'conditional_string': v8_utilities.conditional_string(method),
84 'cpp_type': v8_types.cpp_type(idl_type), 84 'cpp_type': v8_types.cpp_type(idl_type),
85 'cpp_value': this_cpp_value, 85 'cpp_value': this_cpp_value,
86 'deprecate_as': v8_utilities.deprecate_as(method), # [DeprecateAs] 86 'deprecate_as': v8_utilities.deprecate_as(method), # [DeprecateAs]
87 'do_not_check_signature': not(is_static or 87 'do_not_check_signature': not(is_static or
88 v8_utilities.has_extended_attribute(method, 88 v8_utilities.has_extended_attribute(method,
89 ['DoNotCheckSecurity', 'DoNotCheckSignature', 'NotEnumerable', 89 ['DoNotCheckSecurity', 'DoNotCheckSignature', 'NotEnumerable',
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 'number_of_required_or_variadic_arguments': len([ 122 'number_of_required_or_variadic_arguments': len([
123 argument for argument in arguments 123 argument for argument in arguments
124 if not argument.is_optional]), 124 if not argument.is_optional]),
125 'per_context_enabled_function': v8_utilities.per_context_enabled_functio n_name(method), # [PerContextEnabled] 125 'per_context_enabled_function': v8_utilities.per_context_enabled_functio n_name(method), # [PerContextEnabled]
126 'property_attributes': property_attributes(method), 126 'property_attributes': property_attributes(method),
127 'runtime_enabled_function': v8_utilities.runtime_enabled_function_name(m ethod), # [RuntimeEnabled] 127 'runtime_enabled_function': v8_utilities.runtime_enabled_function_name(m ethod), # [RuntimeEnabled]
128 'signature': 'v8::Local<v8::Signature>()' if is_static or 'DoNotCheckSig nature' in extended_attributes else 'defaultSignature', 128 'signature': 'v8::Local<v8::Signature>()' if is_static or 'DoNotCheckSig nature' in extended_attributes else 'defaultSignature',
129 'v8_set_return_value': v8_set_return_value(interface.name, method, this_ cpp_value), 129 'v8_set_return_value': v8_set_return_value(interface.name, method, this_ cpp_value),
130 'world_suffixes': ['', 'ForMainWorld'] if 'PerWorldBindings' in extended _attributes else [''], # [PerWorldBindings] 130 'world_suffixes': ['', 'ForMainWorld'] if 'PerWorldBindings' in extended _attributes else [''], # [PerWorldBindings]
131 } 131 }
132 return contents
133 132
134 133
135 def generate_argument(interface, method, argument, index): 134 def generate_argument(interface, method, argument, index):
136 extended_attributes = argument.extended_attributes 135 extended_attributes = argument.extended_attributes
137 idl_type = argument.idl_type 136 idl_type = argument.idl_type
138 this_cpp_value = cpp_value(interface, method, index) 137 this_cpp_value = cpp_value(interface, method, index)
139 return { 138 return {
140 'cpp_type': v8_types.cpp_type(idl_type), 139 'cpp_type': v8_types.cpp_type(idl_type),
141 'cpp_value': this_cpp_value, 140 'cpp_value': this_cpp_value,
142 'enum_validation_expression': v8_utilities.enum_validation_expression(id l_type), 141 'enum_validation_expression': v8_utilities.enum_validation_expression(id l_type),
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 return 'V8TRYCATCH_VOID(Vector<{cpp_type}>, {name}, toNativeArguments<{c pp_type}>(info, {index}))'.format( 216 return 'V8TRYCATCH_VOID(Vector<{cpp_type}>, {name}, toNativeArguments<{c pp_type}>(info, {index}))'.format(
218 cpp_type=v8_types.cpp_type(idl_type), name=name, index=index) 217 cpp_type=v8_types.cpp_type(idl_type), name=name, index=index)
219 # [Default=NullString] 218 # [Default=NullString]
220 if (argument.is_optional and idl_type == 'DOMString' and 219 if (argument.is_optional and idl_type == 'DOMString' and
221 extended_attributes.get('Default') == 'NullString'): 220 extended_attributes.get('Default') == 'NullString'):
222 v8_value = 'argumentOrNull(info, %s)' % index 221 v8_value = 'argumentOrNull(info, %s)' % index
223 else: 222 else:
224 v8_value = 'info[%s]' % index 223 v8_value = 'info[%s]' % index
225 return v8_types.v8_value_to_local_cpp_value( 224 return v8_types.v8_value_to_local_cpp_value(
226 idl_type, argument.extended_attributes, v8_value, name, index=index) 225 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.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698