OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
5 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
6 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 6 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
7 * (C) 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> | 7 * (C) 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> |
8 * | 8 * |
9 * Redistribution and use in source and binary forms, with or without | 9 * Redistribution and use in source and binary forms, with or without |
10 * modification, are permitted provided that the following conditions | 10 * modification, are permitted provided that the following conditions |
(...skipping 19 matching lines...) Expand all Loading... |
30 */ | 30 */ |
31 | 31 |
32 #ifndef SKY_ENGINE_CORE_EVENTS_EVENTTARGET_H_ | 32 #ifndef SKY_ENGINE_CORE_EVENTS_EVENTTARGET_H_ |
33 #define SKY_ENGINE_CORE_EVENTS_EVENTTARGET_H_ | 33 #define SKY_ENGINE_CORE_EVENTS_EVENTTARGET_H_ |
34 | 34 |
35 #include "gen/sky/core/EventInterfaces.h" | 35 #include "gen/sky/core/EventInterfaces.h" |
36 #include "gen/sky/core/EventNames.h" | 36 #include "gen/sky/core/EventNames.h" |
37 #include "gen/sky/core/EventTargetInterfaces.h" | 37 #include "gen/sky/core/EventTargetInterfaces.h" |
38 #include "gen/sky/core/EventTargetNames.h" | 38 #include "gen/sky/core/EventTargetNames.h" |
39 #include "gen/sky/core/EventTypeNames.h" | 39 #include "gen/sky/core/EventTypeNames.h" |
40 #include "sky/engine/bindings/core/v8/ScriptWrappable.h" | 40 #include "sky/engine/tonic/dart_wrappable.h" |
41 #include "sky/engine/core/events/EventListenerMap.h" | 41 #include "sky/engine/core/events/EventListenerMap.h" |
42 #include "sky/engine/platform/heap/Handle.h" | 42 #include "sky/engine/platform/heap/Handle.h" |
43 #include "sky/engine/wtf/text/AtomicString.h" | 43 #include "sky/engine/wtf/text/AtomicString.h" |
44 | 44 |
45 namespace blink { | 45 namespace blink { |
46 | 46 |
47 class LocalDOMWindow; | 47 class LocalDOMWindow; |
48 class Event; | 48 class Event; |
49 class ExceptionState; | 49 class ExceptionState; |
50 class Node; | 50 class Node; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 // - In your class declaration, you will typically use | 82 // - In your class declaration, you will typically use |
83 // REFCOUNTED_EVENT_TARGET(YourClassName). | 83 // REFCOUNTED_EVENT_TARGET(YourClassName). |
84 // - Override EventTarget::interfaceName() and executionContext(). The former | 84 // - Override EventTarget::interfaceName() and executionContext(). The former |
85 // will typically return EventTargetNames::YourClassName. The latter will | 85 // will typically return EventTargetNames::YourClassName. The latter will |
86 // return ActiveDOMObject::executionContext (if you are an ActiveDOMObject) | 86 // return ActiveDOMObject::executionContext (if you are an ActiveDOMObject) |
87 // or the document you're in. | 87 // or the document you're in. |
88 // - Your trace() method will need to call EventTargetWithInlineData::trace. | 88 // - Your trace() method will need to call EventTargetWithInlineData::trace. |
89 // | 89 // |
90 // Optionally, add a FooEvent.idl class, but that's outside the scope of this | 90 // Optionally, add a FooEvent.idl class, but that's outside the scope of this |
91 // comment (and much more straightforward). | 91 // comment (and much more straightforward). |
92 class EventTarget : public ScriptWrappable { | 92 class EventTarget : public DartWrappable { |
93 DEFINE_WRAPPERTYPEINFO(); | 93 DEFINE_WRAPPERTYPEINFO(); |
94 public: | 94 public: |
95 #if !ENABLE(OILPAN) | 95 #if !ENABLE(OILPAN) |
96 void ref() { refEventTarget(); } | 96 void ref() { refEventTarget(); } |
97 void deref() { derefEventTarget(); } | 97 void deref() { derefEventTarget(); } |
98 #endif | 98 #endif |
99 | 99 |
| 100 void AcceptDartGCVisitor(DartGCVisitor& visitor) const override; |
| 101 |
100 virtual const AtomicString& interfaceName() const = 0; | 102 virtual const AtomicString& interfaceName() const = 0; |
101 virtual ExecutionContext* executionContext() const = 0; | 103 virtual ExecutionContext* executionContext() const = 0; |
102 | 104 |
103 virtual Node* toNode(); | 105 virtual Node* toNode(); |
104 virtual LocalDOMWindow* toDOMWindow(); | 106 virtual LocalDOMWindow* toDOMWindow(); |
105 | 107 |
106 // FIXME: first 2 args to addEventListener and removeEventListener should | 108 // FIXME: first 2 args to addEventListener and removeEventListener should |
107 // be required (per spec), but throwing TypeError breaks legacy content. | 109 // be required (per spec), but throwing TypeError breaks legacy content. |
108 // http://crbug.com/353484 | 110 // http://crbug.com/353484 |
109 bool addEventListener() { return false; } | 111 bool addEventListener() { return false; } |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 typedef int thisIsHereToForceASemiColonAfterThisEventTargetMacro | 202 typedef int thisIsHereToForceASemiColonAfterThisEventTargetMacro |
201 #define DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(baseClass) DEFINE_EVENT_
TARGET_REFCOUNTING(baseClass) | 203 #define DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(baseClass) DEFINE_EVENT_
TARGET_REFCOUNTING(baseClass) |
202 #endif | 204 #endif |
203 | 205 |
204 // Use this macro if your EventTarget subclass is also a subclass of WTF::RefCou
nted. | 206 // Use this macro if your EventTarget subclass is also a subclass of WTF::RefCou
nted. |
205 // A ref-counted class that uses a different method of refcounting should use DE
FINE_EVENT_TARGET_REFCOUNTING directly. | 207 // A ref-counted class that uses a different method of refcounting should use DE
FINE_EVENT_TARGET_REFCOUNTING directly. |
206 // Both of these macros are meant to be placed just before the "public:" section
of the class declaration. | 208 // Both of these macros are meant to be placed just before the "public:" section
of the class declaration. |
207 #define REFCOUNTED_EVENT_TARGET(className) DEFINE_EVENT_TARGET_REFCOUNTING_WILL_
BE_REMOVED(RefCounted<className>) | 209 #define REFCOUNTED_EVENT_TARGET(className) DEFINE_EVENT_TARGET_REFCOUNTING_WILL_
BE_REMOVED(RefCounted<className>) |
208 | 210 |
209 #endif // SKY_ENGINE_CORE_EVENTS_EVENTTARGET_H_ | 211 #endif // SKY_ENGINE_CORE_EVENTS_EVENTTARGET_H_ |
OLD | NEW |