| 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 20 matching lines...) Expand all Loading... |
| 31 | 31 |
| 32 #ifndef EventTarget_h | 32 #ifndef EventTarget_h |
| 33 #define EventTarget_h | 33 #define EventTarget_h |
| 34 | 34 |
| 35 #include "core/events/EventListenerMap.h" | 35 #include "core/events/EventListenerMap.h" |
| 36 #include "core/events/ThreadLocalEventNames.h" | 36 #include "core/events/ThreadLocalEventNames.h" |
| 37 #include "platform/heap/Handle.h" | 37 #include "platform/heap/Handle.h" |
| 38 | 38 |
| 39 namespace WebCore { | 39 namespace WebCore { |
| 40 | 40 |
| 41 class DOMWindow; | 41 class LocalDOMWindow; |
| 42 class Event; | 42 class Event; |
| 43 class ExceptionState; | 43 class ExceptionState; |
| 44 class MessagePort; | 44 class MessagePort; |
| 45 class Node; | 45 class Node; |
| 46 class TextTrack; | 46 class TextTrack; |
| 47 class TextTrackCue; | 47 class TextTrackCue; |
| 48 class XMLHttpRequest; | 48 class XMLHttpRequest; |
| 49 class XMLHttpRequestUpload; | 49 class XMLHttpRequestUpload; |
| 50 | 50 |
| 51 struct FiringEventIterator { | 51 struct FiringEventIterator { |
| (...skipping 24 matching lines...) Expand all Loading... |
| 76 public: | 76 public: |
| 77 #if !ENABLE(OILPAN) | 77 #if !ENABLE(OILPAN) |
| 78 void ref() { refEventTarget(); } | 78 void ref() { refEventTarget(); } |
| 79 void deref() { derefEventTarget(); } | 79 void deref() { derefEventTarget(); } |
| 80 #endif | 80 #endif |
| 81 | 81 |
| 82 virtual const AtomicString& interfaceName() const = 0; | 82 virtual const AtomicString& interfaceName() const = 0; |
| 83 virtual ExecutionContext* executionContext() const = 0; | 83 virtual ExecutionContext* executionContext() const = 0; |
| 84 | 84 |
| 85 virtual Node* toNode(); | 85 virtual Node* toNode(); |
| 86 virtual DOMWindow* toDOMWindow(); | 86 virtual LocalDOMWindow* toDOMWindow(); |
| 87 virtual MessagePort* toMessagePort(); | 87 virtual MessagePort* toMessagePort(); |
| 88 | 88 |
| 89 // FIXME: first 2 args to addEventListener and removeEventListener should | 89 // FIXME: first 2 args to addEventListener and removeEventListener should |
| 90 // be required (per spec), but throwing TypeError breaks legacy content. | 90 // be required (per spec), but throwing TypeError breaks legacy content. |
| 91 // http://crbug.com/353484 | 91 // http://crbug.com/353484 |
| 92 bool addEventListener() { return false; } | 92 bool addEventListener() { return false; } |
| 93 bool addEventListener(const AtomicString& eventType) { return false; } | 93 bool addEventListener(const AtomicString& eventType) { return false; } |
| 94 virtual bool addEventListener(const AtomicString& eventType, PassRefPtr<Even
tListener>, bool useCapture = false); | 94 virtual bool addEventListener(const AtomicString& eventType, PassRefPtr<Even
tListener>, bool useCapture = false); |
| 95 bool removeEventListener() { return false; } | 95 bool removeEventListener() { return false; } |
| 96 bool removeEventListener(const AtomicString& eventType) { return false; } | 96 bool removeEventListener(const AtomicString& eventType) { return false; } |
| (...skipping 24 matching lines...) Expand all Loading... |
| 121 virtual EventTargetData* eventTargetData() = 0; | 121 virtual EventTargetData* eventTargetData() = 0; |
| 122 virtual EventTargetData& ensureEventTargetData() = 0; | 122 virtual EventTargetData& ensureEventTargetData() = 0; |
| 123 | 123 |
| 124 private: | 124 private: |
| 125 #if !ENABLE(OILPAN) | 125 #if !ENABLE(OILPAN) |
| 126 // Subclasses should likely not override these themselves; instead, they sho
uld use the REFCOUNTED_EVENT_TARGET() macro. | 126 // Subclasses should likely not override these themselves; instead, they sho
uld use the REFCOUNTED_EVENT_TARGET() macro. |
| 127 virtual void refEventTarget() = 0; | 127 virtual void refEventTarget() = 0; |
| 128 virtual void derefEventTarget() = 0; | 128 virtual void derefEventTarget() = 0; |
| 129 #endif | 129 #endif |
| 130 | 130 |
| 131 DOMWindow* executingWindow(); | 131 LocalDOMWindow* executingWindow(); |
| 132 void fireEventListeners(Event*, EventTargetData*, EventListenerVector&); | 132 void fireEventListeners(Event*, EventTargetData*, EventListenerVector&); |
| 133 void countLegacyEvents(const AtomicString& legacyTypeName, EventListenerVect
or*, EventListenerVector*); | 133 void countLegacyEvents(const AtomicString& legacyTypeName, EventListenerVect
or*, EventListenerVector*); |
| 134 | 134 |
| 135 bool clearAttributeEventListener(const AtomicString& eventType); | 135 bool clearAttributeEventListener(const AtomicString& eventType); |
| 136 | 136 |
| 137 friend class EventListenerIterator; | 137 friend class EventListenerIterator; |
| 138 }; | 138 }; |
| 139 | 139 |
| 140 class EventTargetWithInlineData : public EventTarget { | 140 class EventTargetWithInlineData : public EventTarget { |
| 141 protected: | 141 protected: |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 typedef int thisIsHereToForceASemiColonAfterThisEventTargetMacro | 236 typedef int thisIsHereToForceASemiColonAfterThisEventTargetMacro |
| 237 #define DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(baseClass) DEFINE_EVENT_
TARGET_REFCOUNTING(baseClass) | 237 #define DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(baseClass) DEFINE_EVENT_
TARGET_REFCOUNTING(baseClass) |
| 238 #endif | 238 #endif |
| 239 | 239 |
| 240 // Use this macro if your EventTarget subclass is also a subclass of WTF::RefCou
nted. | 240 // Use this macro if your EventTarget subclass is also a subclass of WTF::RefCou
nted. |
| 241 // A ref-counted class that uses a different method of refcounting should use DE
FINE_EVENT_TARGET_REFCOUNTING directly. | 241 // A ref-counted class that uses a different method of refcounting should use DE
FINE_EVENT_TARGET_REFCOUNTING directly. |
| 242 // Both of these macros are meant to be placed just before the "public:" section
of the class declaration. | 242 // Both of these macros are meant to be placed just before the "public:" section
of the class declaration. |
| 243 #define REFCOUNTED_EVENT_TARGET(className) DEFINE_EVENT_TARGET_REFCOUNTING(RefCo
untedWillBeRefCountedGarbageCollected<className>) | 243 #define REFCOUNTED_EVENT_TARGET(className) DEFINE_EVENT_TARGET_REFCOUNTING(RefCo
untedWillBeRefCountedGarbageCollected<className>) |
| 244 | 244 |
| 245 #endif // EventTarget_h | 245 #endif // EventTarget_h |
| OLD | NEW |