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

Side by Side Diff: third_party/WebKit/Source/core/events/EventTarget.h

Issue 2536403002: blink_gc_plugin should require tracing for classes that have a trace method
Patch Set: Created 4 years 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 unified diff | Download patch
« no previous file with comments | « no previous file | tools/clang/blink_gc_plugin/RecordInfo.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 212
213 bool clearAttributeEventListener(const AtomicString& eventType); 213 bool clearAttributeEventListener(const AtomicString& eventType);
214 214
215 friend class EventListenerIterator; 215 friend class EventListenerIterator;
216 }; 216 };
217 217
218 // EventTargetData is a GCed object, so it should not be used as a part of 218 // EventTargetData is a GCed object, so it should not be used as a part of
219 // object. However, we intentionally use it as a part of object for performance, 219 // object. However, we intentionally use it as a part of object for performance,
220 // assuming that no one extracts a pointer of 220 // assuming that no one extracts a pointer of
221 // EventTargetWithInlineData::m_eventTargetData and store it to a Member etc. 221 // EventTargetWithInlineData::m_eventTargetData and store it to a Member etc.
222 class GC_PLUGIN_IGNORE("513199") CORE_EXPORT EventTargetWithInlineData 222 class CORE_EXPORT EventTargetWithInlineData : public EventTarget {
223 : public EventTarget {
224 public: 223 public:
225 ~EventTargetWithInlineData() override {} 224 ~EventTargetWithInlineData() override {}
226 225
227 DEFINE_INLINE_VIRTUAL_TRACE() { 226 DEFINE_INLINE_VIRTUAL_TRACE() {
228 visitor->trace(m_eventTargetData); 227 visitor->trace(m_eventTargetData);
229 EventTarget::trace(visitor); 228 EventTarget::trace(visitor);
230 } 229 }
231 230
232 protected: 231 protected:
233 EventTargetData* eventTargetData() final { return &m_eventTargetData; } 232 EventTargetData* eventTargetData() final { return &m_eventTargetData; }
234 EventTargetData& ensureEventTargetData() final { return m_eventTargetData; } 233 EventTargetData& ensureEventTargetData() final { return m_eventTargetData; }
235 234
236 private: 235 private:
236 GC_PLUGIN_IGNORE("513199")
237 EventTargetData m_eventTargetData; 237 EventTargetData m_eventTargetData;
238 }; 238 };
239 239
240 // FIXME: These macros should be split into separate DEFINE and DECLARE 240 // FIXME: These macros should be split into separate DEFINE and DECLARE
241 // macros to avoid causing so many header includes. 241 // macros to avoid causing so many header includes.
242 #define DEFINE_ATTRIBUTE_EVENT_LISTENER(attribute) \ 242 #define DEFINE_ATTRIBUTE_EVENT_LISTENER(attribute) \
243 EventListener* on##attribute() { \ 243 EventListener* on##attribute() { \
244 return this->getAttributeEventListener(EventTypeNames::attribute); \ 244 return this->getAttributeEventListener(EventTypeNames::attribute); \
245 } \ 245 } \
246 void setOn##attribute(EventListener* listener) { \ 246 void setOn##attribute(EventListener* listener) { \
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 const AtomicString& eventType) { 318 const AtomicString& eventType) {
319 EventTargetData* d = eventTargetData(); 319 EventTargetData* d = eventTargetData();
320 if (!d) 320 if (!d)
321 return false; 321 return false;
322 return d->eventListenerMap.containsCapturing(eventType); 322 return d->eventListenerMap.containsCapturing(eventType);
323 } 323 }
324 324
325 } // namespace blink 325 } // namespace blink
326 326
327 #endif // EventTarget_h 327 #endif // EventTarget_h
OLDNEW
« no previous file with comments | « no previous file | tools/clang/blink_gc_plugin/RecordInfo.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698