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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 if is_static: | 81 if is_static: |
82 return 'functionTemplate' | 82 return 'functionTemplate' |
83 if 'Unforgeable' in extended_attributes: | 83 if 'Unforgeable' in extended_attributes: |
84 return 'instanceTemplate' | 84 return 'instanceTemplate' |
85 return 'prototypeTemplate' | 85 return 'prototypeTemplate' |
86 | 86 |
87 is_call_with_script_arguments = has_extended_attribute_value(method, 'CallWi
th', 'ScriptArguments') | 87 is_call_with_script_arguments = has_extended_attribute_value(method, 'CallWi
th', 'ScriptArguments') |
88 if is_call_with_script_arguments: | 88 if is_call_with_script_arguments: |
89 includes.update(['bindings/v8/ScriptCallStackFactory.h', | 89 includes.update(['bindings/v8/ScriptCallStackFactory.h', |
90 'core/inspector/ScriptArguments.h']) | 90 'core/inspector/ScriptArguments.h']) |
91 is_call_with_script_state = has_extended_attribute_value(method, 'CallWith',
'ScriptState') | 91 is_call_with_script_state = has_extended_attribute_value( |
| 92 method, 'CallWith', 'ScriptState') |
92 if is_call_with_script_state: | 93 if is_call_with_script_state: |
93 includes.add('bindings/v8/ScriptState.h') | 94 includes.add('bindings/v8/ScriptState.h') |
94 is_check_security_for_node = 'CheckSecurity' in extended_attributes | 95 is_check_security_for_node = has_extended_attribute_value( |
| 96 method, 'CheckSecurity', 'Node') |
95 if is_check_security_for_node: | 97 if is_check_security_for_node: |
96 includes.add('bindings/v8/BindingSecurity.h') | 98 includes.add('bindings/v8/BindingSecurity.h') |
97 is_custom_element_callbacks = 'CustomElementCallbacks' in extended_attribute
s | 99 is_custom_element_callbacks = 'CustomElementCallbacks' in extended_attribute
s |
98 if is_custom_element_callbacks: | 100 if is_custom_element_callbacks: |
99 includes.add('core/dom/custom/CustomElementCallbackDispatcher.h') | 101 includes.add('core/dom/custom/CustomElementCallbackDispatcher.h') |
100 | 102 |
101 is_check_security_for_frame = ( | 103 is_check_security_for_frame = ( |
102 'CheckSecurity' in interface.extended_attributes and | 104 has_extended_attribute_value(interface, 'CheckSecurity', 'Frame') and |
103 'DoNotCheckSecurity' not in extended_attributes) | 105 'DoNotCheckSecurity' not in extended_attributes) |
104 is_raises_exception = 'RaisesException' in extended_attributes | 106 is_raises_exception = 'RaisesException' in extended_attributes |
105 | 107 |
106 arguments_need_try_catch = any(argument_needs_try_catch(argument) | 108 arguments_need_try_catch = any(argument_needs_try_catch(argument) |
107 for argument in arguments) | 109 for argument in arguments) |
108 | 110 |
109 return { | 111 return { |
110 'activity_logging_world_list': v8_utilities.activity_logging_world_list(
method), # [ActivityLogging] | 112 'activity_logging_world_list': v8_utilities.activity_logging_world_list(
method), # [ActivityLogging] |
111 'arguments': [argument_context(interface, method, argument, index) | 113 'arguments': [argument_context(interface, method, argument, index) |
112 for index, argument in enumerate(arguments)], | 114 for index, argument in enumerate(arguments)], |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 } | 210 } |
209 | 211 |
210 | 212 |
211 ################################################################################ | 213 ################################################################################ |
212 # Value handling | 214 # Value handling |
213 ################################################################################ | 215 ################################################################################ |
214 | 216 |
215 def cpp_value(interface, method, number_of_arguments): | 217 def cpp_value(interface, method, number_of_arguments): |
216 def cpp_argument(argument): | 218 def cpp_argument(argument): |
217 idl_type = argument.idl_type | 219 idl_type = argument.idl_type |
218 if idl_type.name == 'EventListener': | 220 if idl_type.name == 'EventListenerOrNull': |
219 if (interface.name == 'EventTarget' and | 221 if (interface.name == 'EventTarget' and |
220 method.name == 'removeEventListener'): | 222 method.name == 'removeEventListener'): |
221 # FIXME: remove this special case by moving get() into | 223 # FIXME: remove this special case by moving get() into |
222 # EventTarget::removeEventListener | 224 # EventTarget::removeEventListener |
223 return '%s.get()' % argument.name | 225 return '%s.get()' % argument.name |
224 return argument.name | 226 return argument.name |
225 if (idl_type.is_callback_interface or | 227 if (idl_type.is_callback_interface or |
226 idl_type.name in ['NodeFilter', 'XPathNSResolver']): | 228 idl_type.name in ['NodeFilter', 'XPathNSResolver']): |
227 # FIXME: remove this special case | 229 # FIXME: remove this special case |
228 return '%s.release()' % argument.name | 230 return '%s.release()' % argument.name |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 | 325 |
324 | 326 |
325 def union_arguments(idl_type): | 327 def union_arguments(idl_type): |
326 """Return list of ['result0Enabled', 'result0', 'result1Enabled', ...] for u
nion types, for use in setting return value""" | 328 """Return list of ['result0Enabled', 'result0', 'result1Enabled', ...] for u
nion types, for use in setting return value""" |
327 return [arg | 329 return [arg |
328 for i in range(len(idl_type.member_types)) | 330 for i in range(len(idl_type.member_types)) |
329 for arg in ['result%sEnabled' % i, 'result%s' % i]] | 331 for arg in ['result%sEnabled' % i, 'result%s' % i]] |
330 | 332 |
331 IdlType.union_arguments = property(lambda self: None) | 333 IdlType.union_arguments = property(lambda self: None) |
332 IdlUnionType.union_arguments = property(union_arguments) | 334 IdlUnionType.union_arguments = property(union_arguments) |
OLD | NEW |