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

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

Issue 1685393002: [Experimental Framework] Rename IDL attribute to OriginTrialEnabled (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 is_post_message = 'PostMessage' in extended_attributes 111 is_post_message = 'PostMessage' in extended_attributes
112 if is_post_message: 112 if is_post_message:
113 includes.add('bindings/core/v8/SerializedScriptValueFactory.h') 113 includes.add('bindings/core/v8/SerializedScriptValueFactory.h')
114 includes.add('core/dom/DOMArrayBuffer.h') 114 includes.add('core/dom/DOMArrayBuffer.h')
115 includes.add('core/dom/MessagePort.h') 115 includes.add('core/dom/MessagePort.h')
116 includes.add('core/frame/ImageBitmap.h') 116 includes.add('core/frame/ImageBitmap.h')
117 117
118 if 'LenientThis' in extended_attributes: 118 if 'LenientThis' in extended_attributes:
119 raise Exception('[LenientThis] is not supported for operations.') 119 raise Exception('[LenientThis] is not supported for operations.')
120 120
121 if 'APIExperimentEnabled' in extended_attributes: 121 if 'OriginTrialEnabled' in extended_attributes:
122 includes.add('core/inspector/ConsoleMessage.h') 122 includes.add('core/inspector/ConsoleMessage.h')
123 includes.add('core/origin_trials/OriginTrials.h') 123 includes.add('core/origin_trials/OriginTrials.h')
124 124
125 argument_contexts = [ 125 argument_contexts = [
126 argument_context(interface, method, argument, index, is_visible=is_visib le) 126 argument_context(interface, method, argument, index, is_visible=is_visib le)
127 for index, argument in enumerate(arguments)] 127 for index, argument in enumerate(arguments)]
128 128
129 return { 129 return {
130 'activity_logging_world_list': v8_utilities.activity_logging_world_list( method), # [ActivityLogging] 130 'activity_logging_world_list': v8_utilities.activity_logging_world_list( method), # [ActivityLogging]
131 'api_experiment_enabled': v8_utilities.api_experiment_enabled_function(m ethod), # [APIExperimentEnabled] 131 'origin_trial_enabled': v8_utilities.origin_trial_enabled_function(metho d), # [OriginTrialEnabled]
132 'api_experiment_enabled_per_interface': v8_utilities.api_experiment_enab led_function(interface), # [APIExperimentEnabled] 132 'origin_trial_enabled_per_interface': v8_utilities.origin_trial_enabled_ function(interface), # [OriginTrialEnabled]
133 'arguments': argument_contexts, 133 'arguments': argument_contexts,
134 'argument_declarations_for_private_script': 134 'argument_declarations_for_private_script':
135 argument_declarations_for_private_script(interface, method), 135 argument_declarations_for_private_script(interface, method),
136 'cpp_type': (v8_types.cpp_template_type('Nullable', idl_type.cpp_type) 136 'cpp_type': (v8_types.cpp_template_type('Nullable', idl_type.cpp_type)
137 if idl_type.is_explicit_nullable else idl_type.cpp_type), 137 if idl_type.is_explicit_nullable else idl_type.cpp_type),
138 'cpp_value': this_cpp_value, 138 'cpp_value': this_cpp_value,
139 'cpp_type_initializer': idl_type.cpp_type_initializer, 139 'cpp_type_initializer': idl_type.cpp_type_initializer,
140 'custom_registration_extended_attributes': 140 'custom_registration_extended_attributes':
141 CUSTOM_REGISTRATION_EXTENDED_ATTRIBUTES.intersection( 141 CUSTOM_REGISTRATION_EXTENDED_ATTRIBUTES.intersection(
142 extended_attributes.iterkeys()), 142 extended_attributes.iterkeys()),
143 'deprecate_as': v8_utilities.deprecate_as(method), # [DeprecateAs] 143 'deprecate_as': v8_utilities.deprecate_as(method), # [DeprecateAs]
144 'exposed_test': v8_utilities.exposed(method, interface), # [Exposed] 144 'exposed_test': v8_utilities.exposed(method, interface), # [Exposed]
145 # TODO(yukishiino): Retire has_custom_registration flag. Should be 145 # TODO(yukishiino): Retire has_custom_registration flag. Should be
146 # replaced with V8DOMConfiguration::PropertyLocationConfiguration. 146 # replaced with V8DOMConfiguration::PropertyLocationConfiguration.
147 'has_custom_registration': 147 'has_custom_registration':
148 v8_utilities.has_extended_attribute( 148 v8_utilities.has_extended_attribute(
149 method, CUSTOM_REGISTRATION_EXTENDED_ATTRIBUTES), 149 method, CUSTOM_REGISTRATION_EXTENDED_ATTRIBUTES),
150 'has_exception_state': 150 'has_exception_state':
151 is_raises_exception or 151 is_raises_exception or
152 is_check_security_for_receiver or 152 is_check_security_for_receiver or
153 any(argument for argument in arguments 153 any(argument for argument in arguments
154 if (argument.idl_type.name == 'SerializedScriptValue' or 154 if (argument.idl_type.name == 'SerializedScriptValue' or
155 argument_conversion_needs_exception_state(method, argument)) ), 155 argument_conversion_needs_exception_state(method, argument)) ),
156 'has_optional_argument_without_default_value': 156 'has_optional_argument_without_default_value':
157 any(True for argument_context in argument_contexts 157 any(True for argument_context in argument_contexts
158 if argument_context['is_optional_without_default_value']), 158 if argument_context['is_optional_without_default_value']),
159 'idl_type': idl_type.base_type, 159 'idl_type': idl_type.base_type,
160 'is_api_experiment_enabled': v8_utilities.api_experiment_enabled_functio n(method) or v8_utilities.api_experiment_enabled_function(interface), # [APIExp erimentEnabled] 160 'is_origin_trial_enabled': v8_utilities.origin_trial_enabled_function(me thod) or v8_utilities.origin_trial_enabled_function(interface), # [OriginTrialE nabled]
161 'is_call_with_execution_context': has_extended_attribute_value(method, ' CallWith', 'ExecutionContext'), 161 'is_call_with_execution_context': has_extended_attribute_value(method, ' CallWith', 'ExecutionContext'),
162 'is_call_with_script_arguments': is_call_with_script_arguments, 162 'is_call_with_script_arguments': is_call_with_script_arguments,
163 'is_call_with_script_state': is_call_with_script_state, 163 'is_call_with_script_state': is_call_with_script_state,
164 'is_call_with_this_value': is_call_with_this_value, 164 'is_call_with_this_value': is_call_with_this_value,
165 'is_check_security_for_receiver': is_check_security_for_receiver, 165 'is_check_security_for_receiver': is_check_security_for_receiver,
166 'is_check_security_for_return_value': is_check_security_for_return_value , 166 'is_check_security_for_return_value': is_check_security_for_return_value ,
167 'is_custom': 'Custom' in extended_attributes and 167 'is_custom': 'Custom' in extended_attributes and
168 not (is_custom_call_prologue or is_custom_call_epilogue), 168 not (is_custom_call_prologue or is_custom_call_epilogue),
169 'is_custom_call_prologue': is_custom_call_prologue, 169 'is_custom_call_prologue': is_custom_call_prologue,
170 'is_custom_call_epilogue': is_custom_call_epilogue, 170 'is_custom_call_epilogue': is_custom_call_epilogue,
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
479 return method.idl_type and method.idl_type.name == 'Promise' 479 return method.idl_type and method.idl_type.name == 'Promise'
480 480
481 IdlOperation.returns_promise = property(method_returns_promise) 481 IdlOperation.returns_promise = property(method_returns_promise)
482 482
483 483
484 def argument_conversion_needs_exception_state(method, argument): 484 def argument_conversion_needs_exception_state(method, argument):
485 idl_type = argument.idl_type 485 idl_type = argument.idl_type
486 return (idl_type.v8_conversion_needs_exception_state or 486 return (idl_type.v8_conversion_needs_exception_state or
487 argument.is_variadic or 487 argument.is_variadic or
488 (method.returns_promise and idl_type.is_string_type)) 488 (method.returns_promise and idl_type.is_string_type))
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698