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

Unified Diff: third_party/WebKit/Source/core/events/RegisteredEventListener.h

Issue 1922093003: Add AddEventListenerOptions addEventListenerOptions interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 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: third_party/WebKit/Source/core/events/RegisteredEventListener.h
diff --git a/third_party/WebKit/Source/core/events/RegisteredEventListener.h b/third_party/WebKit/Source/core/events/RegisteredEventListener.h
index 0f68dc6306b848832568c3cf04dcb5d67940da7d..01eb8fe2070c6dadb67c474748402395a3041a84 100644
--- a/third_party/WebKit/Source/core/events/RegisteredEventListener.h
+++ b/third_party/WebKit/Source/core/events/RegisteredEventListener.h
@@ -24,6 +24,7 @@
#ifndef RegisteredEventListener_h
#define RegisteredEventListener_h
+#include "core/events/AddEventListenerOptions.h"
#include "core/events/EventListener.h"
#include "wtf/RefPtr.h"
@@ -38,7 +39,7 @@ public:
{
}
- RegisteredEventListener(EventListener* listener, const EventListenerOptions& options)
+ RegisteredEventListener(EventListener* listener, const AddEventListenerOptions& options)
: m_listener(listener)
, m_useCapture(options.capture())
, m_passive(options.passive())
@@ -50,9 +51,9 @@ public:
visitor->trace(m_listener);
}
- EventListenerOptions options() const
+ AddEventListenerOptions options() const
{
- EventListenerOptions result;
+ AddEventListenerOptions result;
result.setCapture(m_useCapture);
result.setPassive(m_passive);
return result;
@@ -80,14 +81,18 @@ public:
bool matches(const EventListener* listener, const EventListenerOptions& options) const
{
- return *m_listener == *listener && static_cast<bool>(m_useCapture) == options.capture() && static_cast<bool>(m_passive) == options.passive();
+ // Equality is soley based on the listener and useCapture flags.
+ ASSERT(m_listener);
+ ASSERT(listener);
+ return *m_listener == *listener && static_cast<bool>(m_useCapture) == options.capture();
}
bool operator==(const RegisteredEventListener& other) const
{
+ // Equality is soley based on the listener and useCapture flags.
ASSERT(m_listener);
ASSERT(other.m_listener);
- return *m_listener == *other.m_listener && m_useCapture == other.m_useCapture && m_passive == other.m_passive;
+ return *m_listener == *other.m_listener && m_useCapture == other.m_useCapture;
}
private:
« no previous file with comments | « third_party/WebKit/Source/core/events/EventTarget.idl ('k') | third_party/WebKit/Source/core/frame/EventHandlerRegistry.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698