Ignore:
Timestamp:
Jan 1, 2015, 1:20:21 PM (11 years ago)
Author:
[email protected]
Message:

Move scrolling code off of WTF::bind
https://bugs.webkit.org/show_bug.cgi?id=140019

Reviewed by Darin Adler.

Source/WebCore:

  • page/scrolling/ThreadedScrollingTree.cpp:

(WebCore::ThreadedScrollingTree::tryToHandleWheelEvent):
(WebCore::ThreadedScrollingTree::invalidate):
(WebCore::ThreadedScrollingTree::scrollingTreeNodeDidScroll):
(WebCore::ThreadedScrollingTree::handleWheelEventPhase):
(WebCore::derefScrollingCoordinator): Deleted.

  • page/scrolling/ios/ScrollingTreeIOS.cpp:

(WebCore::ScrollingTreeIOS::invalidate):
(WebCore::ScrollingTreeIOS::scrollingTreeNodeDidScroll):
(WebCore::derefScrollingCoordinator): Deleted.

  • page/scrolling/mac/ScrollingCoordinatorMac.mm:

(WebCore::ScrollingCoordinatorMac::pageDestroyed):
(WebCore::ScrollingCoordinatorMac::handleWheelEvent):

  • platform/MemoryPressureHandler.cpp:

(WebCore::MemoryPressureHandler::releaseMemory):

  • workers/WorkerThread.cpp:

(WebCore::WorkerThread::releaseFastMallocFreeMemoryInAllThreads):

Source/WebKit2:

  • WebProcess/WebPage/EventDispatcher.cpp:

(WebKit::EventDispatcher::wheelEvent):
(WebKit::EventDispatcher::touchEvent):

  • WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:

(WebKit::TiledCoreAnimationDrawingArea::updatePreferences):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/WebProcess/WebPage/EventDispatcher.cpp

    r174351 r177848  
    123123#if ENABLE(ASYNC_SCROLLING)
    124124    MutexLocker locker(m_scrollingTreesMutex);
    125     if (ThreadedScrollingTree* scrollingTree = m_scrollingTrees.get(pageID)) {
     125    if (RefPtr<ThreadedScrollingTree> scrollingTree = m_scrollingTrees.get(pageID)) {
    126126        // FIXME: It's pretty horrible that we're updating the back/forward state here.
    127127        // WebCore should always know the current state and know when it changes so the
    128128        // scrolling tree can be notified.
    129129        // We only need to do this at the beginning of the gesture.
    130         if (platformWheelEvent.phase() == PlatformWheelEventPhaseBegan)
    131             ScrollingThread::dispatch(bind(&ThreadedScrollingTree::setCanRubberBandState, scrollingTree, canRubberBandAtLeft, canRubberBandAtRight, canRubberBandAtTop, canRubberBandAtBottom));
     130        if (platformWheelEvent.phase() == PlatformWheelEventPhaseBegan) {
     131            ScrollingThread::dispatch([scrollingTree, canRubberBandAtLeft, canRubberBandAtRight, canRubberBandAtTop, canRubberBandAtBottom] {
     132                scrollingTree->setCanRubberBandState(canRubberBandAtLeft, canRubberBandAtRight, canRubberBandAtTop, canRubberBandAtBottom);
     133            });
     134        }
    132135
    133136        ScrollingTree::EventResult result = scrollingTree->tryToHandleWheelEvent(platformWheelEvent);
     
    144147#endif
    145148
    146     RunLoop::main().dispatch(bind(&EventDispatcher::dispatchWheelEvent, this, pageID, wheelEvent));
     149    RefPtr<EventDispatcher> eventDispatcher(this);
     150    RunLoop::main().dispatch([eventDispatcher, pageID, wheelEvent] {
     151        eventDispatcher->dispatchWheelEvent(pageID, wheelEvent);
     152    });
    147153}
    148154
     
    183189    }
    184190
    185     if (updateListWasEmpty)
    186         RunLoop::main().dispatch(bind(&EventDispatcher::dispatchTouchEvents, this));
     191    if (updateListWasEmpty) {
     192        RefPtr<EventDispatcher> eventDispatcher(this);
     193        RunLoop::main().dispatch([eventDispatcher] {
     194            eventDispatcher->dispatchTouchEvents();
     195        });
     196    }
    187197}
    188198
Note: See TracChangeset for help on using the changeset viewer.