| 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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 | 148 |
| 149 def getter_expression(interface, attribute, contents): | 149 def getter_expression(interface, attribute, contents): |
| 150 arguments = [] | 150 arguments = [] |
| 151 this_getter_base_name = getter_base_name(attribute, arguments) | 151 this_getter_base_name = getter_base_name(attribute, arguments) |
| 152 getter_name = v8_utilities.scoped_name(interface, attribute, this_getter_bas
e_name) | 152 getter_name = v8_utilities.scoped_name(interface, attribute, this_getter_bas
e_name) |
| 153 | 153 |
| 154 arguments.extend(v8_utilities.call_with_arguments(attribute)) | 154 arguments.extend(v8_utilities.call_with_arguments(attribute)) |
| 155 if attribute.is_nullable: | 155 if attribute.is_nullable: |
| 156 arguments.append('isNull') | 156 arguments.append('isNull') |
| 157 if contents['is_getter_raises_exception']: | 157 if contents['is_getter_raises_exception']: |
| 158 arguments.append('es') | 158 arguments.append('exceptionState') |
| 159 if attribute.idl_type == 'EventHandler': | 159 if attribute.idl_type == 'EventHandler': |
| 160 arguments.append('isolatedWorldForIsolate(info.GetIsolate())') | 160 arguments.append('isolatedWorldForIsolate(info.GetIsolate())') |
| 161 return '%s(%s)' % (getter_name, ', '.join(arguments)) | 161 return '%s(%s)' % (getter_name, ', '.join(arguments)) |
| 162 | 162 |
| 163 | 163 |
| 164 CONTENT_ATTRIBUTE_GETTER_NAMES = { | 164 CONTENT_ATTRIBUTE_GETTER_NAMES = { |
| 165 'boolean': 'fastHasAttribute', | 165 'boolean': 'fastHasAttribute', |
| 166 'long': 'getIntegralAttribute', | 166 'long': 'getIntegralAttribute', |
| 167 'unsigned long': 'getUnsignedIntegralAttribute', | 167 'unsigned long': 'getUnsignedIntegralAttribute', |
| 168 } | 168 } |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 # FIXME: pass the isolate instead of the isolated world | 243 # FIXME: pass the isolate instead of the isolated world |
| 244 isolated_world = 'isolatedWorldForIsolate(info.GetIsolate())' | 244 isolated_world = 'isolatedWorldForIsolate(info.GetIsolate())' |
| 245 arguments.extend(['V8EventListenerList::getEventListener(jsValue, true,
ListenerFindOrCreate)', isolated_world]) | 245 arguments.extend(['V8EventListenerList::getEventListener(jsValue, true,
ListenerFindOrCreate)', isolated_world]) |
| 246 contents['event_handler_getter_expression'] = 'imp->%s(%s)' % (cpp_name(
attribute), isolated_world) | 246 contents['event_handler_getter_expression'] = 'imp->%s(%s)' % (cpp_name(
attribute), isolated_world) |
| 247 elif v8_types.is_interface_type(idl_type) and not v8_types.array_type(idl_ty
pe): | 247 elif v8_types.is_interface_type(idl_type) and not v8_types.array_type(idl_ty
pe): |
| 248 # FIXME: should be able to eliminate WTF::getPtr in most or all cases | 248 # FIXME: should be able to eliminate WTF::getPtr in most or all cases |
| 249 arguments.append('WTF::getPtr(cppValue)') | 249 arguments.append('WTF::getPtr(cppValue)') |
| 250 else: | 250 else: |
| 251 arguments.append('cppValue') | 251 arguments.append('cppValue') |
| 252 if contents['is_setter_raises_exception']: | 252 if contents['is_setter_raises_exception']: |
| 253 arguments.append('es') | 253 arguments.append('exceptionState') |
| 254 | 254 |
| 255 return '%s(%s)' % (setter_name, ', '.join(arguments)) | 255 return '%s(%s)' % (setter_name, ', '.join(arguments)) |
| 256 | 256 |
| 257 | 257 |
| 258 CONTENT_ATTRIBUTE_SETTER_NAMES = { | 258 CONTENT_ATTRIBUTE_SETTER_NAMES = { |
| 259 'boolean': 'setBooleanAttribute', | 259 'boolean': 'setBooleanAttribute', |
| 260 'long': 'setIntegralAttribute', | 260 'long': 'setIntegralAttribute', |
| 261 'unsigned long': 'setUnsignedIntegralAttribute', | 261 'unsigned long': 'setUnsignedIntegralAttribute', |
| 262 } | 262 } |
| 263 | 263 |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 353 if ('NotEnumerable' in extended_attributes or | 353 if ('NotEnumerable' in extended_attributes or |
| 354 is_constructor_attribute(attribute)): | 354 is_constructor_attribute(attribute)): |
| 355 property_attributes_list.append('v8::DontEnum') | 355 property_attributes_list.append('v8::DontEnum') |
| 356 if 'Unforgeable' in extended_attributes: | 356 if 'Unforgeable' in extended_attributes: |
| 357 property_attributes_list.append('v8::DontDelete') | 357 property_attributes_list.append('v8::DontDelete') |
| 358 return property_attributes_list or ['v8::None'] | 358 return property_attributes_list or ['v8::None'] |
| 359 | 359 |
| 360 | 360 |
| 361 def is_constructor_attribute(attribute): | 361 def is_constructor_attribute(attribute): |
| 362 return attribute.idl_type.endswith('Constructor') | 362 return attribute.idl_type.endswith('Constructor') |
| OLD | NEW |