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

Unified Diff: Source/core/page/EventHandlerRegistry.h

Issue 237963014: Track scroll event handlers in nested documents (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Removed unneeded function definition. Created 6 years, 8 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
Index: Source/core/page/EventHandlerRegistry.h
diff --git a/Source/core/dom/EventHandlerRegistry.h b/Source/core/page/EventHandlerRegistry.h
similarity index 74%
rename from Source/core/dom/EventHandlerRegistry.h
rename to Source/core/page/EventHandlerRegistry.h
index dde20641c428ccdc74705796c5dd65ab488f28c9..c159c029612eddf634b89521e607cfcbd65a1f5d 100644
--- a/Source/core/dom/EventHandlerRegistry.h
+++ b/Source/core/page/EventHandlerRegistry.h
@@ -5,18 +5,16 @@
#ifndef EventHandlerRegistry_h
#define EventHandlerRegistry_h
-#include "core/dom/DocumentSupplementable.h"
#include "core/events/Event.h"
+#include "core/page/Page.h"
#include "wtf/HashCountedSet.h"
namespace WebCore {
typedef HashCountedSet<EventTarget*> EventTargetSet;
-// Registry for keeping track of event handlers. Handlers can either be
-// associated with an EventTarget or be "external" handlers which live outside
-// the DOM (e.g., WebViewImpl).
-class EventHandlerRegistry FINAL : public DocumentSupplement {
+// Registry for keeping track of event handlers.
+class EventHandlerRegistry FINAL : public Supplement<Page> {
public:
virtual ~EventHandlerRegistry();
@@ -28,16 +26,12 @@ public:
};
static const char* supplementName();
- static EventHandlerRegistry* from(Document&);
+ static EventHandlerRegistry* from(Page&);
- // Returns true if the host Document or any child documents have any
- // registered event handlers of the class.
+ // Returns true if the page has event handlers of the specified class.
bool hasEventHandlers(EventHandlerClass) const;
- // Returns a set of EventTargets which have registered handlers of the
- // given class. Only contains targets directly in this document; all
- // handlers in a child Document are collapsed to a single respective
- // Document instance in the set.
+ // Returns a set of EventTargets which have registered handlers of the given class.
const EventTargetSet* eventHandlerTargets(EventHandlerClass) const;
// Registration and management of event handlers attached to EventTargets.
@@ -51,7 +45,7 @@ public:
virtual void trace(Visitor*) OVERRIDE { }
private:
- explicit EventHandlerRegistry(Document&);
+ explicit EventHandlerRegistry(Page&);
enum ChangeOperation {
Add, // Add a new event handler.
@@ -78,15 +72,8 @@ private:
void updateEventHandlerInternal(ChangeOperation, EventHandlerClass, EventTarget*);
- struct HandlerState {
- HandlerState();
- ~HandlerState();
-
- OwnPtr<EventTargetSet> targets;
- };
-
- Document& m_document;
- HandlerState m_eventHandlers[EventHandlerClassCount];
+ Page& m_page;
+ EventTargetSet m_targets[EventHandlerClassCount];
};
} // namespace WebCore

Powered by Google App Engine
This is Rietveld 408576698