From 03e12282df9aa1e1fb05a8b90f1cfc2e08764cec Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Thu, 9 Feb 2012 14:16:12 +0100 Subject: Imported WebKit commit e09a82039aa4273ab318b71122e92d8e5f233525 (http://svn.webkit.org/repository/webkit/trunk@107223) --- .../WebKit2/WebProcess/WebPage/EventDispatcher.cpp | 35 ++++++++-------------- 1 file changed, 12 insertions(+), 23 deletions(-) (limited to 'Source/WebKit2/WebProcess/WebPage/EventDispatcher.cpp') diff --git a/Source/WebKit2/WebProcess/WebPage/EventDispatcher.cpp b/Source/WebKit2/WebProcess/WebPage/EventDispatcher.cpp index 3c2e73eca..7f3c08198 100644 --- a/Source/WebKit2/WebProcess/WebPage/EventDispatcher.cpp +++ b/Source/WebKit2/WebProcess/WebPage/EventDispatcher.cpp @@ -37,6 +37,7 @@ #if ENABLE(THREADED_SCROLLING) #include +#include #endif using namespace WebCore; @@ -52,21 +53,21 @@ EventDispatcher::~EventDispatcher() } #if ENABLE(THREADED_SCROLLING) -void EventDispatcher::addScrollingCoordinatorForPage(WebPage* webPage) +void EventDispatcher::addScrollingTreeForPage(WebPage* webPage) { - MutexLocker locker(m_scrollingCoordinatorsMutex); + MutexLocker locker(m_scrollingTreesMutex); ASSERT(webPage->corePage()->scrollingCoordinator()); - ASSERT(!m_scrollingCoordinators.contains(webPage->pageID())); - m_scrollingCoordinators.set(webPage->pageID(), webPage->corePage()->scrollingCoordinator()); + ASSERT(!m_scrollingTrees.contains(webPage->pageID())); + m_scrollingTrees.set(webPage->pageID(), webPage->corePage()->scrollingCoordinator()->scrollingTree()); } -void EventDispatcher::removeScrollingCoordinatorForPage(WebPage* webPage) +void EventDispatcher::removeScrollingTreeForPage(WebPage* webPage) { - MutexLocker locker(m_scrollingCoordinatorsMutex); - ASSERT(m_scrollingCoordinators.contains(webPage->pageID())); + MutexLocker locker(m_scrollingTreesMutex); + ASSERT(m_scrollingTrees.contains(webPage->pageID())); - m_scrollingCoordinators.remove(webPage->pageID()); + m_scrollingTrees.remove(webPage->pageID()); } #endif @@ -81,11 +82,11 @@ void EventDispatcher::didReceiveMessageOnConnectionWorkQueue(CoreIPC::Connection void EventDispatcher::wheelEvent(CoreIPC::Connection*, uint64_t pageID, const WebWheelEvent& wheelEvent) { #if ENABLE(THREADED_SCROLLING) - MutexLocker locker(m_scrollingCoordinatorsMutex); - if (ScrollingCoordinator* scrollingCoordinator = m_scrollingCoordinators.get(pageID).get()) { + MutexLocker locker(m_scrollingTreesMutex); + if (ScrollingTree* scrollingTree = m_scrollingTrees.get(pageID).get()) { PlatformWheelEvent platformWheelEvent = platform(wheelEvent); - if (scrollingCoordinator->handleWheelEvent(platformWheelEvent)) { + if (scrollingTree->tryToHandleWheelEvent(platformWheelEvent)) { sendDidHandleEvent(pageID, wheelEvent); return; } @@ -98,18 +99,6 @@ void EventDispatcher::wheelEvent(CoreIPC::Connection*, uint64_t pageID, const We #if ENABLE(GESTURE_EVENTS) void EventDispatcher::gestureEvent(CoreIPC::Connection*, uint64_t pageID, const WebGestureEvent& gestureEvent) { -#if ENABLE(THREADED_SCROLLING) - MutexLocker locker(m_scrollingCoordinatorsMutex); - if (ScrollingCoordinator* scrollingCoordinator = m_scrollingCoordinators.get(pageID).get()) { - PlatformGestureEvent platformGestureEvent = platform(gestureEvent); - - if (scrollingCoordinator->handleGestureEvent(platformGestureEvent)) { - sendDidHandleEvent(pageID, gestureEvent); - return; - } - } -#endif - RunLoop::main()->dispatch(bind(&EventDispatcher::dispatchGestureEvent, this, pageID, gestureEvent)); } #endif -- cgit v1.2.1