| OLD | NEW |
| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 import v8_attributes | 46 import v8_attributes |
| 47 import v8_interface | 47 import v8_interface |
| 48 | 48 |
| 49 | 49 |
| 50 INTERFACE_H_INCLUDES = frozenset([ | 50 INTERFACE_H_INCLUDES = frozenset([ |
| 51 'dart/runtime/include/dart_api.h', | 51 'dart/runtime/include/dart_api.h', |
| 52 ]) | 52 ]) |
| 53 | 53 |
| 54 | 54 |
| 55 INTERFACE_CPP_INCLUDES = frozenset([ | 55 INTERFACE_CPP_INCLUDES = frozenset([ |
| 56 'sky/engine/bindings2/exception_state.h', | 56 'sky/engine/bindings/exception_state.h', |
| 57 'sky/engine/core/script/dom_dart_state.h', | 57 'sky/engine/core/script/dom_dart_state.h', |
| 58 'sky/engine/tonic/dart_converter.h', | 58 'sky/engine/tonic/dart_converter.h', |
| 59 'sky/engine/tonic/dart_wrappable.h', | 59 'sky/engine/tonic/dart_wrappable.h', |
| 60 'sky/engine/wtf/GetPtr.h', | 60 'sky/engine/wtf/GetPtr.h', |
| 61 'sky/engine/wtf/RefPtr.h', | 61 'sky/engine/wtf/RefPtr.h', |
| 62 ]) | 62 ]) |
| 63 | 63 |
| 64 # TODO(terry): Rename genenerate_interface to interface_context. | 64 # TODO(terry): Rename genenerate_interface to interface_context. |
| 65 def interface_context(interface): | 65 def interface_context(interface): |
| 66 context = v8_interface.interface_context(interface) | 66 context = v8_interface.interface_context(interface) |
| 67 | 67 |
| 68 includes.clear() | 68 includes.clear() |
| 69 | 69 |
| 70 includes.update(INTERFACE_CPP_INCLUDES) | 70 includes.update(INTERFACE_CPP_INCLUDES) |
| 71 header_includes = set(INTERFACE_H_INCLUDES) | 71 header_includes = set(INTERFACE_H_INCLUDES) |
| 72 | 72 |
| 73 parent_interface = interface.parent | 73 parent_interface = interface.parent |
| 74 if parent_interface: | 74 if parent_interface: |
| 75 header_includes.update(dart_types.includes_for_interface(parent_interfac
e)) | 75 header_includes.update(dart_types.includes_for_interface(parent_interfac
e)) |
| 76 extended_attributes = interface.extended_attributes | 76 extended_attributes = interface.extended_attributes |
| 77 | 77 |
| 78 if inherits_interface(interface.name, 'EventTarget'): | 78 if inherits_interface(interface.name, 'EventTarget'): |
| 79 includes.update(['bindings2/dart_event_listener.h']) | 79 includes.update(['bindings/dart_event_listener.h']) |
| 80 | 80 |
| 81 # [SetWrapperReferenceTo] | 81 # [SetWrapperReferenceTo] |
| 82 set_wrapper_reference_to_list = [{ | 82 set_wrapper_reference_to_list = [{ |
| 83 'name': argument.name, | 83 'name': argument.name, |
| 84 # FIXME: properly should be: | 84 # FIXME: properly should be: |
| 85 # 'cpp_type': argument.idl_type.cpp_type_args(used_as_rvalue_type=True), | 85 # 'cpp_type': argument.idl_type.cpp_type_args(used_as_rvalue_type=True), |
| 86 # (if type is non-wrapper type like NodeFilter, normally RefPtr) | 86 # (if type is non-wrapper type like NodeFilter, normally RefPtr) |
| 87 # Raw pointers faster though, and NodeFilter hacky anyway. | 87 # Raw pointers faster though, and NodeFilter hacky anyway. |
| 88 'cpp_type': argument.idl_type.implemented_as + '*', | 88 'cpp_type': argument.idl_type.implemented_as + '*', |
| 89 'idl_type': argument.idl_type, | 89 'idl_type': argument.idl_type, |
| (...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 732 ] | 732 ] |
| 733 props = [(p1 + "_" + p2, name, arity) | 733 props = [(p1 + "_" + p2, name, arity) |
| 734 for (p1, (p2, name, arity)) in itertools.product(pre, post)] | 734 for (p1, (p2, name, arity)) in itertools.product(pre, post)] |
| 735 for t in props: | 735 for t in props: |
| 736 add(*t) | 736 add(*t) |
| 737 | 737 |
| 738 for (p, name, arity) in props: | 738 for (p, name, arity) in props: |
| 739 if context[p]: | 739 if context[p]: |
| 740 if context[p].get('is_custom_property_query'): | 740 if context[p].get('is_custom_property_query'): |
| 741 add(p, '__propertyQuery__', 1) | 741 add(p, '__propertyQuery__', 1) |
| OLD | NEW |