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

Unified Diff: Source/WebKit/chromium/src/WebNode.cpp

Issue 12463035: Moar RELEASE_ASSERTs (Closed) Base URL: https://chromium.googlesource.com/external/WebKit_trimmed.git@master
Patch Set: Created 7 years, 9 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/WebKit/chromium/public/WebNode.h ('k') | Source/WebKit/chromium/tests/EventListenerTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebKit/chromium/src/WebNode.cpp
diff --git a/Source/WebKit/chromium/src/WebNode.cpp b/Source/WebKit/chromium/src/WebNode.cpp
index 9872df31c6f48a9a3e6a13a1c2cce5e3498552a0..3f7a7eb355ffe4efad9ba89c4071759830330725 100644
--- a/Source/WebKit/chromium/src/WebNode.cpp
+++ b/Source/WebKit/chromium/src/WebNode.cpp
@@ -180,27 +180,28 @@ bool WebNode::isElementNode() const
bool WebNode::hasEventListeners(const WebString& eventType) const
{
+ // FIXME: "permissionrequest" seems like an implementation detail of the
+ // the browser plug-in. Perhaps the browser plug-in should have
+ // a more special-purpose mechanism?
+ // See http://code.google.com/p/chromium/issues/detail?id=189561
+
+ // Please do not add more eventTypes to this list without an API review.
+ RELEASE_ASSERT(eventType == "permissionrequest");
return m_private->hasEventListeners(eventType);
}
void WebNode::addEventListener(const WebString& eventType, WebDOMEventListener* listener, bool useCapture)
{
- EventListenerWrapper* listenerWrapper =
- listener->createEventListenerWrapper(eventType, useCapture, m_private.get());
+ // Please do not add more eventTypes to this list without an API review.
+ RELEASE_ASSERT(eventType == "mousedown");
+
+ EventListenerWrapper* listenerWrapper = listener->createEventListenerWrapper(eventType, useCapture, m_private.get());
// The listenerWrapper is only referenced by the actual Node. Once it goes
// away, the wrapper notifies the WebEventListener so it can clear its
// pointer to it.
m_private->addEventListener(eventType, adoptRef(listenerWrapper), useCapture);
}
-void WebNode::removeEventListener(const WebString& eventType, WebDOMEventListener* listener, bool useCapture)
-{
- EventListenerWrapper* listenerWrapper =
- listener->getEventListenerWrapper(eventType, useCapture, m_private.get());
- m_private->removeEventListener(eventType, listenerWrapper, useCapture);
- // listenerWrapper is now deleted.
-}
-
bool WebNode::dispatchEvent(const WebDOMEvent& event)
{
if (!event.isNull())
« no previous file with comments | « Source/WebKit/chromium/public/WebNode.h ('k') | Source/WebKit/chromium/tests/EventListenerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698