From 3b0b4fc69be6520f4b55ce7fc60275871b637b8a Mon Sep 17 00:00:00 2001 From: Alexey Proskuryakov Date: Mon, 5 Jan 2015 09:04:14 +0000 Subject: [PATCH] Merge r166810 - Improve error checking in WebPageProxy::didReceiveEvent https://bugs.webkit.org/show_bug.cgi?id=131243 Reviewed by Anders Carlsson. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didReceiveEvent): --- Source/WebKit2/ChangeLog | 10 ++++++++++ Source/WebKit2/UIProcess/WebPageProxy.cpp | 13 +++++++------ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog index 13399de26ee4..44e56af83121 100644 --- a/Source/WebKit2/ChangeLog +++ b/Source/WebKit2/ChangeLog @@ -1,3 +1,13 @@ +2014-04-04 Alexey Proskuryakov + + Improve error checking in WebPageProxy::didReceiveEvent + https://bugs.webkit.org/show_bug.cgi?id=131243 + + + Reviewed by Anders Carlsson. + + * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didReceiveEvent): + 2014-10-21 Michael Catanzaro [SOUP] Disable SSLv3 diff --git a/Source/WebKit2/UIProcess/WebPageProxy.cpp b/Source/WebKit2/UIProcess/WebPageProxy.cpp index 5bfee5c0e454..f7d8c6252adb 100644 --- a/Source/WebKit2/UIProcess/WebPageProxy.cpp +++ b/Source/WebKit2/UIProcess/WebPageProxy.cpp @@ -3515,7 +3515,7 @@ void WebPageProxy::didReceiveEvent(uint32_t opaqueType, bool handled) break; case WebEvent::Wheel: { - ASSERT(!m_currentlyProcessedWheelEvents.isEmpty()); + MESSAGE_CHECK(!m_currentlyProcessedWheelEvents.isEmpty()); OwnPtr> oldestCoalescedEvent = m_currentlyProcessedWheelEvents.takeFirst(); @@ -3539,10 +3539,10 @@ void WebPageProxy::didReceiveEvent(uint32_t opaqueType, bool handled) case WebEvent::Char: { LOG(KeyHandling, "WebPageProxy::didReceiveEvent: %s", webKeyboardEventTypeString(type)); - NativeWebKeyboardEvent event = m_keyEventQueue.first(); - MESSAGE_CHECK(type == event.type()); + MESSAGE_CHECK(!m_keyEventQueue.isEmpty()); + NativeWebKeyboardEvent event = m_keyEventQueue.takeFirst(); - m_keyEventQueue.removeFirst(); + MESSAGE_CHECK(type == event.type()); if (!m_keyEventQueue.isEmpty()) m_process->send(Messages::WebPage::KeyEvent(m_keyEventQueue.first()), m_pageID); @@ -3560,9 +3560,10 @@ void WebPageProxy::didReceiveEvent(uint32_t opaqueType, bool handled) case WebEvent::TouchMove: case WebEvent::TouchEnd: case WebEvent::TouchCancel: { - QueuedTouchEvents queuedEvents = m_touchEventQueue.first(); + MESSAGE_CHECK(!m_touchEventQueue.isEmpty()); + QueuedTouchEvents queuedEvents = m_touchEventQueue.takeFirst(); + MESSAGE_CHECK(type == queuedEvents.forwardedEvent.type()); - m_touchEventQueue.removeFirst(); m_pageClient.doneWithTouchEvent(queuedEvents.forwardedEvent, handled); for (size_t i = 0; i < queuedEvents.deferredTouchEvents.size(); ++i) {