Fix double hash lookup in DocumentEventQueue::cancelEvent().
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 30 May 2013 17:09:07 +0000 (17:09 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 30 May 2013 17:09:07 +0000 (17:09 +0000)
<http://webkit.org/b/117031>

Reviewed by Anders Carlsson.

* dom/DocumentEventQueue.cpp:
(WebCore::DocumentEventQueue::cancelEvent):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@150969 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/dom/DocumentEventQueue.cpp

index de1809d..205185d 100644 (file)
@@ -1,5 +1,15 @@
 2013-05-30  Andreas Kling  <akling@apple.com>
 
+        Fix double hash lookup in DocumentEventQueue::cancelEvent().
+        <http://webkit.org/b/117031>
+
+        Reviewed by Anders Carlsson.
+
+        * dom/DocumentEventQueue.cpp:
+        (WebCore::DocumentEventQueue::cancelEvent):
+
+2013-05-30  Andreas Kling  <akling@apple.com>
+
         Fix double hash lookup in DocumentLoader::removeSubresourceLoader().
         <http://webkit.org/b/117030>
 
index 5f40e33..b15e359 100644 (file)
@@ -98,8 +98,10 @@ void DocumentEventQueue::enqueueOrDispatchScrollEvent(PassRefPtr<Node> target, S
 
 bool DocumentEventQueue::cancelEvent(Event* event)
 {
-    bool found = m_queuedEvents.contains(event);
-    m_queuedEvents.remove(event);
+    ListHashSet<RefPtr<Event>, 16>::iterator it = m_queuedEvents.find(event);
+    bool found = it != m_queuedEvents.end();
+    if (found)
+        m_queuedEvents.remove(it);
     if (m_queuedEvents.isEmpty())
         m_pendingEventTimer->stop();
     return found;