| 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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 getter_name = v8_utilities.scoped_name(interface, attribute, this_getter_bas
e_name) | 195 getter_name = v8_utilities.scoped_name(interface, attribute, this_getter_bas
e_name) |
| 196 | 196 |
| 197 arguments.extend(v8_utilities.call_with_arguments(attribute)) | 197 arguments.extend(v8_utilities.call_with_arguments(attribute)) |
| 198 if ('ImplementedBy' in attribute.extended_attributes and | 198 if ('ImplementedBy' in attribute.extended_attributes and |
| 199 not attribute.is_static): | 199 not attribute.is_static): |
| 200 arguments.append('imp') | 200 arguments.append('imp') |
| 201 if attribute.is_nullable: | 201 if attribute.is_nullable: |
| 202 arguments.append('isNull') | 202 arguments.append('isNull') |
| 203 if contents['is_getter_raises_exception']: | 203 if contents['is_getter_raises_exception']: |
| 204 arguments.append('exceptionState') | 204 arguments.append('exceptionState') |
| 205 if attribute.idl_type == 'EventHandler': | |
| 206 arguments.append('isolatedWorldForIsolate(info.GetIsolate())') | |
| 207 return '%s(%s)' % (getter_name, ', '.join(arguments)) | 205 return '%s(%s)' % (getter_name, ', '.join(arguments)) |
| 208 | 206 |
| 209 | 207 |
| 210 CONTENT_ATTRIBUTE_GETTER_NAMES = { | 208 CONTENT_ATTRIBUTE_GETTER_NAMES = { |
| 211 'boolean': 'fastHasAttribute', | 209 'boolean': 'fastHasAttribute', |
| 212 'long': 'getIntegralAttribute', | 210 'long': 'getIntegralAttribute', |
| 213 'unsigned long': 'getUnsignedIntegralAttribute', | 211 'unsigned long': 'getUnsignedIntegralAttribute', |
| 214 } | 212 } |
| 215 | 213 |
| 216 | 214 |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 arguments = v8_utilities.call_with_arguments(attribute, extended_attributes.
get('SetterCallWith')) | 289 arguments = v8_utilities.call_with_arguments(attribute, extended_attributes.
get('SetterCallWith')) |
| 292 | 290 |
| 293 this_setter_base_name = setter_base_name(attribute, arguments) | 291 this_setter_base_name = setter_base_name(attribute, arguments) |
| 294 setter_name = v8_utilities.scoped_name(interface, attribute, this_setter_bas
e_name) | 292 setter_name = v8_utilities.scoped_name(interface, attribute, this_setter_bas
e_name) |
| 295 | 293 |
| 296 if ('ImplementedBy' in extended_attributes and | 294 if ('ImplementedBy' in extended_attributes and |
| 297 not attribute.is_static): | 295 not attribute.is_static): |
| 298 arguments.append('imp') | 296 arguments.append('imp') |
| 299 idl_type = attribute.idl_type | 297 idl_type = attribute.idl_type |
| 300 if idl_type == 'EventHandler': | 298 if idl_type == 'EventHandler': |
| 301 # FIXME: pass the isolate instead of the isolated world | |
| 302 isolated_world = 'isolatedWorldForIsolate(info.GetIsolate())' | |
| 303 getter_name = v8_utilities.scoped_name(interface, attribute, cpp_name(at
tribute)) | 299 getter_name = v8_utilities.scoped_name(interface, attribute, cpp_name(at
tribute)) |
| 304 getter_arguments = arguments + [isolated_world] | |
| 305 contents['event_handler_getter_expression'] = '%s(%s)' % ( | 300 contents['event_handler_getter_expression'] = '%s(%s)' % ( |
| 306 getter_name, ', '.join(getter_arguments)) | 301 getter_name, ', '.join(arguments)) |
| 307 if (interface.name in ['Window', 'WorkerGlobalScope'] and | 302 if (interface.name in ['Window', 'WorkerGlobalScope'] and |
| 308 attribute.name == 'onerror'): | 303 attribute.name == 'onerror'): |
| 309 includes.add('bindings/v8/V8ErrorHandler.h') | 304 includes.add('bindings/v8/V8ErrorHandler.h') |
| 310 arguments.append('V8EventListenerList::findOrCreateWrapper<V8ErrorHa
ndler>(jsValue, true, info.GetIsolate())') | 305 arguments.append('V8EventListenerList::findOrCreateWrapper<V8ErrorHa
ndler>(jsValue, true, info.GetIsolate())') |
| 311 else: | 306 else: |
| 312 arguments.append('V8EventListenerList::getEventListener(jsValue, tru
e, ListenerFindOrCreate)') | 307 arguments.append('V8EventListenerList::getEventListener(jsValue, tru
e, ListenerFindOrCreate)') |
| 313 arguments.append(isolated_world) | |
| 314 elif v8_types.is_interface_type(idl_type) and not v8_types.array_type(idl_ty
pe): | 308 elif v8_types.is_interface_type(idl_type) and not v8_types.array_type(idl_ty
pe): |
| 315 # FIXME: should be able to eliminate WTF::getPtr in most or all cases | 309 # FIXME: should be able to eliminate WTF::getPtr in most or all cases |
| 316 arguments.append('WTF::getPtr(cppValue)') | 310 arguments.append('WTF::getPtr(cppValue)') |
| 317 else: | 311 else: |
| 318 arguments.append('cppValue') | 312 arguments.append('cppValue') |
| 319 if contents['is_setter_raises_exception']: | 313 if contents['is_setter_raises_exception']: |
| 320 arguments.append('exceptionState') | 314 arguments.append('exceptionState') |
| 321 | 315 |
| 322 return '%s(%s)' % (setter_name, ', '.join(arguments)) | 316 return '%s(%s)' % (setter_name, ', '.join(arguments)) |
| 323 | 317 |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 394 property_attributes_list.append('v8::DontDelete') | 388 property_attributes_list.append('v8::DontDelete') |
| 395 return property_attributes_list or ['v8::None'] | 389 return property_attributes_list or ['v8::None'] |
| 396 | 390 |
| 397 | 391 |
| 398 ################################################################################ | 392 ################################################################################ |
| 399 # Constructors | 393 # Constructors |
| 400 ################################################################################ | 394 ################################################################################ |
| 401 | 395 |
| 402 def is_constructor_attribute(attribute): | 396 def is_constructor_attribute(attribute): |
| 403 return attribute.idl_type.endswith('Constructor') | 397 return attribute.idl_type.endswith('Constructor') |
| OLD | NEW |