| 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 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 if 'ImplementedInPrivateScript' in attribute.extended_attributes: | 226 if 'ImplementedInPrivateScript' in attribute.extended_attributes: |
| 227 arguments.append('toFrameIfNotDetached(info.GetIsolate()->GetCurrentCont
ext())') | 227 arguments.append('toFrameIfNotDetached(info.GetIsolate()->GetCurrentCont
ext())') |
| 228 arguments.append('impl') | 228 arguments.append('impl') |
| 229 arguments.append('&result') | 229 arguments.append('&result') |
| 230 arguments.extend(v8_utilities.call_with_arguments( | 230 arguments.extend(v8_utilities.call_with_arguments( |
| 231 attribute.extended_attributes.get('CallWith'))) | 231 attribute.extended_attributes.get('CallWith'))) |
| 232 # Members of IDL partial interface definitions are implemented in C++ as | 232 # Members of IDL partial interface definitions are implemented in C++ as |
| 233 # static member functions, which for instance members (non-static members) | 233 # static member functions, which for instance members (non-static members) |
| 234 # take *impl as their first argument | 234 # take *impl as their first argument |
| 235 if ('PartialInterfaceImplementedAs' in attribute.extended_attributes and | 235 if ('PartialInterfaceImplementedAs' in attribute.extended_attributes and |
| 236 not 'ImplementedInPrivateScript' in attribute.extended_attributes and |
| 236 not attribute.is_static): | 237 not attribute.is_static): |
| 237 arguments.append('*impl') | 238 arguments.append('*impl') |
| 238 if attribute.idl_type.is_explicit_nullable: | 239 if attribute.idl_type.is_explicit_nullable: |
| 239 arguments.append('isNull') | 240 arguments.append('isNull') |
| 240 if context['is_getter_raises_exception']: | 241 if context['is_getter_raises_exception']: |
| 241 arguments.append('exceptionState') | 242 arguments.append('exceptionState') |
| 242 return '%s(%s)' % (getter_name, ', '.join(arguments)) | 243 return '%s(%s)' % (getter_name, ', '.join(arguments)) |
| 243 | 244 |
| 244 | 245 |
| 245 CONTENT_ATTRIBUTE_GETTER_NAMES = { | 246 CONTENT_ATTRIBUTE_GETTER_NAMES = { |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 extended_attributes.get('SetterCallWith') or | 355 extended_attributes.get('SetterCallWith') or |
| 355 extended_attributes.get('CallWith')) | 356 extended_attributes.get('CallWith')) |
| 356 | 357 |
| 357 this_setter_base_name = setter_base_name(interface, attribute, arguments) | 358 this_setter_base_name = setter_base_name(interface, attribute, arguments) |
| 358 setter_name = scoped_name(interface, attribute, this_setter_base_name) | 359 setter_name = scoped_name(interface, attribute, this_setter_base_name) |
| 359 | 360 |
| 360 # Members of IDL partial interface definitions are implemented in C++ as | 361 # Members of IDL partial interface definitions are implemented in C++ as |
| 361 # static member functions, which for instance members (non-static members) | 362 # static member functions, which for instance members (non-static members) |
| 362 # take *impl as their first argument | 363 # take *impl as their first argument |
| 363 if ('PartialInterfaceImplementedAs' in extended_attributes and | 364 if ('PartialInterfaceImplementedAs' in extended_attributes and |
| 365 not 'ImplementedInPrivateScript' in extended_attributes and |
| 364 not attribute.is_static): | 366 not attribute.is_static): |
| 365 arguments.append('*impl') | 367 arguments.append('*impl') |
| 366 idl_type = attribute.idl_type | 368 idl_type = attribute.idl_type |
| 367 if 'ImplementedInPrivateScript' in extended_attributes: | 369 if 'ImplementedInPrivateScript' in extended_attributes: |
| 368 arguments.append('toFrameIfNotDetached(info.GetIsolate()->GetCurrentCont
ext())') | 370 arguments.append('toFrameIfNotDetached(info.GetIsolate()->GetCurrentCont
ext())') |
| 369 arguments.append('impl') | 371 arguments.append('impl') |
| 370 arguments.append('cppValue') | 372 arguments.append('cppValue') |
| 371 elif idl_type.base_type == 'EventHandler': | 373 elif idl_type.base_type == 'EventHandler': |
| 372 getter_name = scoped_name(interface, attribute, cpp_name(attribute)) | 374 getter_name = scoped_name(interface, attribute, cpp_name(attribute)) |
| 373 context['event_handler_getter_expression'] = '%s(%s)' % ( | 375 context['event_handler_getter_expression'] = '%s(%s)' % ( |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 482 lambda self: strip_suffix(self.base_type, 'Constructor')) | 484 lambda self: strip_suffix(self.base_type, 'Constructor')) |
| 483 | 485 |
| 484 | 486 |
| 485 def is_constructor_attribute(attribute): | 487 def is_constructor_attribute(attribute): |
| 486 # FIXME: replace this with [ConstructorAttribute] extended attribute | 488 # FIXME: replace this with [ConstructorAttribute] extended attribute |
| 487 return attribute.idl_type.base_type.endswith('Constructor') | 489 return attribute.idl_type.base_type.endswith('Constructor') |
| 488 | 490 |
| 489 | 491 |
| 490 def constructor_getter_context(interface, attribute, context): | 492 def constructor_getter_context(interface, attribute, context): |
| 491 context['needs_constructor_getter_callback'] = context['measure_as'] or cont
ext['deprecate_as'] | 493 context['needs_constructor_getter_callback'] = context['measure_as'] or cont
ext['deprecate_as'] |
| OLD | NEW |