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

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

Issue 2745313003: Move securityCheck out of V8WrapperInstantiationScope (Closed)
Patch Set: Stop unecessary includes of BindingSecurity.h Created 3 years, 9 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 # coding=utf-8 2 # coding=utf-8
3 # 3 #
4 # Redistribution and use in source and binary forms, with or without 4 # Redistribution and use in source and binary forms, with or without
5 # modification, are permitted provided that the following conditions are 5 # modification, are permitted provided that the following conditions are
6 # met: 6 # met:
7 # 7 #
8 # * Redistributions of source code must retain the above copyright 8 # * Redistributions of source code must retain the above copyright
9 # notice, this list of conditions and the following disclaimer. 9 # notice, this list of conditions and the following disclaimer.
10 # * Redistributions in binary form must reproduce the above 10 # * Redistributions in binary form must reproduce the above
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 else: 170 else:
171 parent_interface = interface.parent 171 parent_interface = interface.parent
172 if parent_interface: 172 if parent_interface:
173 header_includes.update(v8_types.includes_for_interface(parent_interf ace)) 173 header_includes.update(v8_types.includes_for_interface(parent_interf ace))
174 is_event_target = inherits_interface(interface.name, 'EventTarget') 174 is_event_target = inherits_interface(interface.name, 'EventTarget')
175 175
176 extended_attributes = interface.extended_attributes 176 extended_attributes = interface.extended_attributes
177 177
178 is_array_buffer_or_view = interface.idl_type.is_array_buffer_or_view 178 is_array_buffer_or_view = interface.idl_type.is_array_buffer_or_view
179 is_typed_array_type = interface.idl_type.is_typed_array 179 is_typed_array_type = interface.idl_type.is_typed_array
180
181 if not (is_array_buffer_or_view or interface.is_partial):
182 includes.add('bindings/core/v8/BindingSecurity.h')
183
180 if is_array_buffer_or_view: 184 if is_array_buffer_or_view:
181 includes.update(('bindings/core/v8/V8ArrayBuffer.h', 185 includes.update(('bindings/core/v8/V8ArrayBuffer.h',
182 'bindings/core/v8/V8SharedArrayBuffer.h')) 186 'bindings/core/v8/V8SharedArrayBuffer.h'))
183 if interface.name == 'ArrayBufferView': 187 if interface.name == 'ArrayBufferView':
184 includes.update(( 188 includes.update((
185 'bindings/core/v8/V8Int8Array.h', 189 'bindings/core/v8/V8Int8Array.h',
186 'bindings/core/v8/V8Int16Array.h', 190 'bindings/core/v8/V8Int16Array.h',
187 'bindings/core/v8/V8Int32Array.h', 191 'bindings/core/v8/V8Int32Array.h',
188 'bindings/core/v8/V8Uint8Array.h', 192 'bindings/core/v8/V8Uint8Array.h',
189 'bindings/core/v8/V8Uint8ClampedArray.h', 193 'bindings/core/v8/V8Uint8ClampedArray.h',
190 'bindings/core/v8/V8Uint16Array.h', 194 'bindings/core/v8/V8Uint16Array.h',
191 'bindings/core/v8/V8Uint32Array.h', 195 'bindings/core/v8/V8Uint32Array.h',
192 'bindings/core/v8/V8Float32Array.h', 196 'bindings/core/v8/V8Float32Array.h',
193 'bindings/core/v8/V8Float64Array.h', 197 'bindings/core/v8/V8Float64Array.h',
194 'bindings/core/v8/V8DataView.h')) 198 'bindings/core/v8/V8DataView.h'))
195 199
196 # [ActiveScriptWrappable] 200 # [ActiveScriptWrappable]
197 active_scriptwrappable = 'ActiveScriptWrappable' in extended_attributes 201 active_scriptwrappable = 'ActiveScriptWrappable' in extended_attributes
198 202
199 # [CheckSecurity] 203 # [CheckSecurity]
200 is_check_security = 'CheckSecurity' in extended_attributes 204 is_check_security = 'CheckSecurity' in extended_attributes
201 if is_check_security: 205 if is_check_security:
202 includes.add('bindings/core/v8/BindingSecurity.h')
203 includes.add('core/frame/LocalDOMWindow.h') 206 includes.add('core/frame/LocalDOMWindow.h')
204 207
205 # [DependentLifetime] 208 # [DependentLifetime]
206 is_dependent_lifetime = 'DependentLifetime' in extended_attributes 209 is_dependent_lifetime = 'DependentLifetime' in extended_attributes
207 210
208 # [PrimaryGlobal] and [Global] 211 # [PrimaryGlobal] and [Global]
209 is_global = ('PrimaryGlobal' in extended_attributes or 212 is_global = ('PrimaryGlobal' in extended_attributes or
210 'Global' in extended_attributes) 213 'Global' in extended_attributes)
211 214
212 # [ImmutablePrototype] 215 # [ImmutablePrototype]
(...skipping 1160 matching lines...) Expand 10 before | Expand all | Expand 10 after
1373 extended_attributes = deleter.extended_attributes 1376 extended_attributes = deleter.extended_attributes
1374 is_call_with_script_state = v8_utilities.has_extended_attribute_value(delete r, 'CallWith', 'ScriptState') 1377 is_call_with_script_state = v8_utilities.has_extended_attribute_value(delete r, 'CallWith', 'ScriptState')
1375 is_ce_reactions = 'CEReactions' in extended_attributes 1378 is_ce_reactions = 'CEReactions' in extended_attributes
1376 return { 1379 return {
1377 'is_call_with_script_state': is_call_with_script_state, 1380 'is_call_with_script_state': is_call_with_script_state,
1378 'is_ce_reactions': is_ce_reactions, 1381 'is_ce_reactions': is_ce_reactions,
1379 'is_custom': 'Custom' in extended_attributes, 1382 'is_custom': 'Custom' in extended_attributes,
1380 'is_raises_exception': 'RaisesException' in extended_attributes, 1383 'is_raises_exception': 'RaisesException' in extended_attributes,
1381 'name': cpp_name(deleter), 1384 'name': cpp_name(deleter),
1382 } 1385 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698