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

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

Issue 240343002: Track event handlers on windows (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed assertions not to go through the document. Created 6 years, 7 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/frame/EventHandlerRegistry.h
diff --git a/Source/core/frame/EventHandlerRegistry.h b/Source/core/frame/EventHandlerRegistry.h
index c462780348207352d934e05ea2154608acaecc5d..e3e9b5ee73566c43041cc3cddd587b7fc901a03a 100644
--- a/Source/core/frame/EventHandlerRegistry.h
+++ b/Source/core/frame/EventHandlerRegistry.h
@@ -6,8 +6,10 @@
#define EventHandlerRegistry_h
#include "core/events/Event.h"
+#include "core/frame/DOMWindowLifecycleObserver.h"
#include "core/frame/FrameHost.h"
#include "wtf/HashCountedSet.h"
+#include "wtf/HashMap.h"
namespace WebCore {
@@ -87,8 +89,24 @@ private:
void checkConsistency() const;
+ class WindowObserver: public DOMWindowLifecycleObserver {
+ public:
+ WindowObserver(EventHandlerRegistry&, DOMWindow&);
+ virtual ~WindowObserver();
+
+ // Inherited from DOMWindowLifecycleObserver
+ virtual void didAddEventListener(DOMWindow*, const AtomicString&) OVERRIDE;
+ virtual void didRemoveEventListener(DOMWindow*, const AtomicString&) OVERRIDE;
+ virtual void didRemoveAllEventListeners(DOMWindow*) OVERRIDE;
+
+ private:
+ EventHandlerRegistry& m_registry;
+ };
+
FrameHost& m_frameHost;
EventTargetSet m_targets[EventHandlerClassCount];
+
+ HashMap<DOMWindow*, OwnPtr<WindowObserver> > m_windowObservers;
};
} // namespace WebCore

Powered by Google App Engine
This is Rietveld 408576698