Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(843)

Unified Diff: Source/core/events/EventTarget.h

Issue 316443004: Oilpan: Remove ref counting from EventTarget and all uses of Pass/RefPtr<EventTarget>. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/events/Event.cpp ('k') | Source/core/events/EventTarget.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/events/EventTarget.h
diff --git a/Source/core/events/EventTarget.h b/Source/core/events/EventTarget.h
index 44b4ead1add6e245554d4bb8fe5c63e8fa45e722..75fc4d20f138609f87464dc3e7f870af27098287 100644
--- a/Source/core/events/EventTarget.h
+++ b/Source/core/events/EventTarget.h
@@ -74,8 +74,10 @@ public:
class EventTarget : public WillBeGarbageCollectedMixin {
public:
+#if !ENABLE(OILPAN)
void ref() { refEventTarget(); }
void deref() { derefEventTarget(); }
+#endif
virtual const AtomicString& interfaceName() const = 0;
virtual ExecutionContext* executionContext() const = 0;
@@ -120,9 +122,11 @@ protected:
virtual EventTargetData& ensureEventTargetData() = 0;
private:
+#if !ENABLE(OILPAN)
// Subclasses should likely not override these themselves; instead, they should use the REFCOUNTED_EVENT_TARGET() macro.
virtual void refEventTarget() = 0;
virtual void derefEventTarget() = 0;
+#endif
DOMWindow* executingWindow();
void fireEventListeners(Event*, EventTargetData*, EventListenerVector&);
@@ -213,6 +217,15 @@ inline bool EventTarget::hasCapturingEventListeners(const AtomicString& eventTyp
} // namespace WebCore
+#if ENABLE(OILPAN)
+#define DEFINE_EVENT_TARGET_REFCOUNTING(baseClass) \
+public: \
+ using baseClass::ref; \
+ using baseClass::deref; \
+private: \
+ typedef int thisIsHereToForceASemiColonAfterThisEventTargetMacro
+#define DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(baseClass)
+#else
#define DEFINE_EVENT_TARGET_REFCOUNTING(baseClass) \
public: \
using baseClass::ref; \
@@ -221,6 +234,8 @@ private: \
virtual void refEventTarget() OVERRIDE FINAL { ref(); } \
virtual void derefEventTarget() OVERRIDE FINAL { deref(); } \
typedef int thisIsHereToForceASemiColonAfterThisEventTargetMacro
+#define DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(baseClass) DEFINE_EVENT_TARGET_REFCOUNTING(baseClass)
+#endif
// Use this macro if your EventTarget subclass is also a subclass of WTF::RefCounted.
// A ref-counted class that uses a different method of refcounting should use DEFINE_EVENT_TARGET_REFCOUNTING directly.
« no previous file with comments | « Source/core/events/Event.cpp ('k') | Source/core/events/EventTarget.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698