<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[177848] trunk/Source</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/177848">177848</a></dd>
<dt>Author</dt> <dd>weinig@apple.com</dd>
<dt>Date</dt> <dd>2015-01-01 13:20:21 -0800 (Thu, 01 Jan 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>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):</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorepagescrollingThreadedScrollingTreecpp">trunk/Source/WebCore/page/scrolling/ThreadedScrollingTree.cpp</a></li>
<li><a href="#trunkSourceWebCorepagescrollingiosScrollingTreeIOScpp">trunk/Source/WebCore/page/scrolling/ios/ScrollingTreeIOS.cpp</a></li>
<li><a href="#trunkSourceWebCorepagescrollingmacScrollingCoordinatorMacmm">trunk/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformMemoryPressureHandlercpp">trunk/Source/WebCore/platform/MemoryPressureHandler.cpp</a></li>
<li><a href="#trunkSourceWebCoreworkersWorkerThreadcpp">trunk/Source/WebCore/workers/WorkerThread.cpp</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageEventDispatchercpp">trunk/Source/WebKit2/WebProcess/WebPage/EventDispatcher.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPagemacTiledCoreAnimationDrawingAreamm">trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (177847 => 177848)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-01-01 20:49:32 UTC (rev 177847)
+++ trunk/Source/WebCore/ChangeLog        2015-01-01 21:20:21 UTC (rev 177848)
</span><span class="lines">@@ -1,3 +1,28 @@
</span><ins>+2014-12-31 Sam Weinig <sam@webkit.org>
+
+ Move scrolling code off of WTF::bind
+ https://bugs.webkit.org/show_bug.cgi?id=140019
+
+ Reviewed by Darin Adler.
+
+ * 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):
+
</ins><span class="cx"> 2015-01-01 Antti Koivisto <antti@apple.com>
</span><span class="cx">
</span><span class="cx"> Remove FontData::containsCharacters
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingThreadedScrollingTreecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/ThreadedScrollingTree.cpp (177847 => 177848)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/ThreadedScrollingTree.cpp        2015-01-01 20:49:32 UTC (rev 177847)
+++ trunk/Source/WebCore/page/scrolling/ThreadedScrollingTree.cpp        2015-01-01 21:20:21 UTC (rev 177848)
</span><span class="lines">@@ -59,7 +59,11 @@
</span><span class="cx"> if (willWheelEventStartSwipeGesture(wheelEvent))
</span><span class="cx"> return DidNotHandleEvent;
</span><span class="cx">
</span><del>- ScrollingThread::dispatch(bind(&ThreadedScrollingTree::handleWheelEvent, this, wheelEvent));
</del><ins>+ RefPtr<ThreadedScrollingTree> threadedScrollingTree(this);
+ ScrollingThread::dispatch([threadedScrollingTree, wheelEvent] {
+ threadedScrollingTree->handleWheelEvent(wheelEvent);
+ });
+
</ins><span class="cx"> return DidHandleEvent;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -69,13 +73,6 @@
</span><span class="cx"> ScrollingTree::handleWheelEvent(wheelEvent);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static void derefScrollingCoordinator(ScrollingCoordinator* scrollingCoordinator)
-{
- ASSERT(isMainThread());
-
- scrollingCoordinator->deref();
-}
-
</del><span class="cx"> void ThreadedScrollingTree::invalidate()
</span><span class="cx"> {
</span><span class="cx"> // Invalidate is dispatched by the ScrollingCoordinator class on the ScrollingThread
</span><span class="lines">@@ -86,7 +83,10 @@
</span><span class="cx"> // Since this can potentially be the last reference to the scrolling coordinator,
</span><span class="cx"> // we need to release it on the main thread since it has member variables (such as timers)
</span><span class="cx"> // that expect to be destroyed from the main thread.
</span><del>- RunLoop::main().dispatch(bind(derefScrollingCoordinator, m_scrollingCoordinator.release().leakRef()));
</del><ins>+ ScrollingCoordinator* scrollingCoordinator = m_scrollingCoordinator.release().leakRef();
+ RunLoop::main().dispatch([scrollingCoordinator] {
+ scrollingCoordinator->deref();
+ });
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void ThreadedScrollingTree::commitNewTreeState(std::unique_ptr<ScrollingStateTree> scrollingStateTree)
</span><span class="lines">@@ -103,7 +103,12 @@
</span><span class="cx"> if (nodeID == rootNode()->scrollingNodeID())
</span><span class="cx"> setMainFrameScrollPosition(scrollPosition);
</span><span class="cx">
</span><del>- RunLoop::main().dispatch(bind(&AsyncScrollingCoordinator::scheduleUpdateScrollPositionAfterAsyncScroll, m_scrollingCoordinator.get(), nodeID, scrollPosition, isHandlingProgrammaticScroll(), scrollingLayerPositionAction));
</del><ins>+ RefPtr<AsyncScrollingCoordinator> scrollingCoordinator = m_scrollingCoordinator;
+ bool localIsHandlingProgrammaticScroll = isHandlingProgrammaticScroll();
+
+ RunLoop::main().dispatch([scrollingCoordinator, nodeID, scrollPosition, localIsHandlingProgrammaticScroll, scrollingLayerPositionAction] {
+ scrollingCoordinator->scheduleUpdateScrollPositionAfterAsyncScroll(nodeID, scrollPosition, localIsHandlingProgrammaticScroll, scrollingLayerPositionAction);
+ });
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if PLATFORM(MAC)
</span><span class="lines">@@ -112,7 +117,10 @@
</span><span class="cx"> if (!m_scrollingCoordinator)
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- RunLoop::main().dispatch(bind(&ScrollingCoordinator::handleWheelEventPhase, m_scrollingCoordinator.get(), phase));
</del><ins>+ RefPtr<AsyncScrollingCoordinator> scrollingCoordinator = m_scrollingCoordinator;
+ RunLoop::main().dispatch([scrollingCoordinator, phase] {
+ scrollingCoordinator->handleWheelEventPhase(phase);
+ });
</ins><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingiosScrollingTreeIOScpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/ios/ScrollingTreeIOS.cpp (177847 => 177848)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/ios/ScrollingTreeIOS.cpp        2015-01-01 20:49:32 UTC (rev 177847)
+++ trunk/Source/WebCore/page/scrolling/ios/ScrollingTreeIOS.cpp        2015-01-01 21:20:21 UTC (rev 177848)
</span><span class="lines">@@ -57,13 +57,6 @@
</span><span class="cx"> ASSERT(!m_scrollingCoordinator);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static void derefScrollingCoordinator(ScrollingCoordinator* scrollingCoordinator)
-{
- ASSERT(isMainThread());
-
- scrollingCoordinator->deref();
-}
-
</del><span class="cx"> void ScrollingTreeIOS::invalidate()
</span><span class="cx"> {
</span><span class="cx"> // Invalidate is dispatched by the ScrollingCoordinator class on the ScrollingThread
</span><span class="lines">@@ -74,7 +67,10 @@
</span><span class="cx"> // Since this can potentially be the last reference to the scrolling coordinator,
</span><span class="cx"> // we need to release it on the main thread since it has member variables (such as timers)
</span><span class="cx"> // that expect to be destroyed from the main thread.
</span><del>- callOnMainThread(bind(derefScrollingCoordinator, m_scrollingCoordinator.release().leakRef()));
</del><ins>+ ScrollingCoordinator* scrollingCoordinator = m_scrollingCoordinator.release().leakRef();
+ callOnMainThread([scrollingCoordinator] {
+ scrollingCoordinator->deref();
+ });
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void ScrollingTreeIOS::commitNewTreeState(std::unique_ptr<ScrollingStateTree> scrollingStateTree)
</span><span class="lines">@@ -90,7 +86,12 @@
</span><span class="cx"> if (nodeID == rootNode()->scrollingNodeID())
</span><span class="cx"> setMainFrameScrollPosition(scrollPosition);
</span><span class="cx">
</span><del>- callOnMainThread(bind(&AsyncScrollingCoordinator::scheduleUpdateScrollPositionAfterAsyncScroll, m_scrollingCoordinator.get(), nodeID, scrollPosition, isHandlingProgrammaticScroll(), scrollingLayerPositionAction));
</del><ins>+ RefPtr<AsyncScrollingCoordinator> scrollingCoordinator = m_scrollingCoordinator;
+ bool localIsHandlingProgrammaticScroll = isHandlingProgrammaticScroll();
+
+ callOnMainThread([scrollingCoordinator, nodeID, scrollPosition, localIsHandlingProgrammaticScroll, scrollingLayerPositionAction] {
+ scrollingCoordinator->scheduleUpdateScrollPositionAfterAsyncScroll(nodeID, scrollPosition, isHandlingProgrammaticScroll, scrollingLayerPositionAction);
+ });
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> PassRefPtr<ScrollingTreeNode> ScrollingTreeIOS::createScrollingTreeNode(ScrollingNodeType nodeType, ScrollingNodeID nodeID)
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingmacScrollingCoordinatorMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.mm (177847 => 177848)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.mm        2015-01-01 20:49:32 UTC (rev 177847)
+++ trunk/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.mm        2015-01-01 21:20:21 UTC (rev 177848)
</span><span class="lines">@@ -72,7 +72,9 @@
</span><span class="cx">
</span><span class="cx"> // Invalidating the scrolling tree will break the reference cycle between the ScrollingCoordinator and ScrollingTree objects.
</span><span class="cx"> RefPtr<ThreadedScrollingTree> scrollingTree = static_pointer_cast<ThreadedScrollingTree>(releaseScrollingTree());
</span><del>- ScrollingThread::dispatch(bind(&ThreadedScrollingTree::invalidate, scrollingTree));
</del><ins>+ ScrollingThread::dispatch([scrollingTree] {
+ scrollingTree->invalidate();
+ });
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void ScrollingCoordinatorMac::commitTreeStateIfNeeded()
</span><span class="lines">@@ -92,7 +94,10 @@
</span><span class="cx"> if (scrollingTree()->willWheelEventStartSwipeGesture(wheelEvent))
</span><span class="cx"> return false;
</span><span class="cx">
</span><del>- ScrollingThread::dispatch(bind(&ThreadedScrollingTree::handleWheelEvent, downcast<ThreadedScrollingTree>(scrollingTree()), wheelEvent));
</del><ins>+ RefPtr<ThreadedScrollingTree> threadedScrollingTree = downcast<ThreadedScrollingTree>(scrollingTree());
+ ScrollingThread::dispatch([threadedScrollingTree, wheelEvent] {
+ threadedScrollingTree->handleWheelEvent(wheelEvent);
+ });
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformMemoryPressureHandlercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/MemoryPressureHandler.cpp (177847 => 177848)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/MemoryPressureHandler.cpp        2015-01-01 20:49:32 UTC (rev 177847)
+++ trunk/Source/WebCore/platform/MemoryPressureHandler.cpp        2015-01-01 21:20:21 UTC (rev 177848)
</span><span class="lines">@@ -141,7 +141,7 @@
</span><span class="cx"> // FastMalloc has lock-free thread specific caches that can only be cleared from the thread itself.
</span><span class="cx"> WorkerThread::releaseFastMallocFreeMemoryInAllThreads();
</span><span class="cx"> #if ENABLE(ASYNC_SCROLLING) && !PLATFORM(IOS)
</span><del>- ScrollingThread::dispatch(bind(WTF::releaseFastMallocFreeMemory));
</del><ins>+ ScrollingThread::dispatch(WTF::releaseFastMallocFreeMemory);
</ins><span class="cx"> #endif
</span><span class="cx"> WTF::releaseFastMallocFreeMemory();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreworkersWorkerThreadcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/workers/WorkerThread.cpp (177847 => 177848)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/workers/WorkerThread.cpp        2015-01-01 20:49:32 UTC (rev 177847)
+++ trunk/Source/WebCore/workers/WorkerThread.cpp        2015-01-01 21:20:21 UTC (rev 177848)
</span><span class="lines">@@ -254,10 +254,11 @@
</span><span class="cx"> {
</span><span class="cx"> std::lock_guard<std::mutex> lock(threadSetMutex());
</span><span class="cx">
</span><del>- for (auto* workerThread : workerThreads())
</del><ins>+ for (auto* workerThread : workerThreads()) {
</ins><span class="cx"> workerThread->runLoop().postTask([] (ScriptExecutionContext&) {
</span><span class="cx"> WTF::releaseFastMallocFreeMemory();
</span><span class="cx"> });
</span><ins>+ }
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (177847 => 177848)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2015-01-01 20:49:32 UTC (rev 177847)
+++ trunk/Source/WebKit2/ChangeLog        2015-01-01 21:20:21 UTC (rev 177848)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2014-12-31 Sam Weinig <sam@webkit.org>
+
+ Move scrolling code off of WTF::bind
+ https://bugs.webkit.org/show_bug.cgi?id=140019
+
+ Reviewed by Darin Adler.
+
+ * WebProcess/WebPage/EventDispatcher.cpp:
+ (WebKit::EventDispatcher::wheelEvent):
+ (WebKit::EventDispatcher::touchEvent):
+ * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
+ (WebKit::TiledCoreAnimationDrawingArea::updatePreferences):
+
</ins><span class="cx"> 2015-01-01 Darin Adler <darin@apple.com>
</span><span class="cx">
</span><span class="cx"> We often misspell identifier as "identifer"
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageEventDispatchercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/EventDispatcher.cpp (177847 => 177848)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/EventDispatcher.cpp        2015-01-01 20:49:32 UTC (rev 177847)
+++ trunk/Source/WebKit2/WebProcess/WebPage/EventDispatcher.cpp        2015-01-01 21:20:21 UTC (rev 177848)
</span><span class="lines">@@ -122,13 +122,16 @@
</span><span class="cx">
</span><span class="cx"> #if ENABLE(ASYNC_SCROLLING)
</span><span class="cx"> MutexLocker locker(m_scrollingTreesMutex);
</span><del>- if (ThreadedScrollingTree* scrollingTree = m_scrollingTrees.get(pageID)) {
</del><ins>+ if (RefPtr<ThreadedScrollingTree> scrollingTree = m_scrollingTrees.get(pageID)) {
</ins><span class="cx"> // FIXME: It's pretty horrible that we're updating the back/forward state here.
</span><span class="cx"> // WebCore should always know the current state and know when it changes so the
</span><span class="cx"> // scrolling tree can be notified.
</span><span class="cx"> // We only need to do this at the beginning of the gesture.
</span><del>- if (platformWheelEvent.phase() == PlatformWheelEventPhaseBegan)
- ScrollingThread::dispatch(bind(&ThreadedScrollingTree::setCanRubberBandState, scrollingTree, canRubberBandAtLeft, canRubberBandAtRight, canRubberBandAtTop, canRubberBandAtBottom));
</del><ins>+ if (platformWheelEvent.phase() == PlatformWheelEventPhaseBegan) {
+ ScrollingThread::dispatch([scrollingTree, canRubberBandAtLeft, canRubberBandAtRight, canRubberBandAtTop, canRubberBandAtBottom] {
+ scrollingTree->setCanRubberBandState(canRubberBandAtLeft, canRubberBandAtRight, canRubberBandAtTop, canRubberBandAtBottom);
+ });
+ }
</ins><span class="cx">
</span><span class="cx"> ScrollingTree::EventResult result = scrollingTree->tryToHandleWheelEvent(platformWheelEvent);
</span><span class="cx"> if (result == ScrollingTree::DidHandleEvent || result == ScrollingTree::DidNotHandleEvent) {
</span><span class="lines">@@ -143,7 +146,10 @@
</span><span class="cx"> UNUSED_PARAM(canRubberBandAtBottom);
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>- RunLoop::main().dispatch(bind(&EventDispatcher::dispatchWheelEvent, this, pageID, wheelEvent));
</del><ins>+ RefPtr<EventDispatcher> eventDispatcher(this);
+ RunLoop::main().dispatch([eventDispatcher, pageID, wheelEvent] {
+ eventDispatcher->dispatchWheelEvent(pageID, wheelEvent);
+ });
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if ENABLE(IOS_TOUCH_EVENTS)
</span><span class="lines">@@ -182,8 +188,12 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if (updateListWasEmpty)
- RunLoop::main().dispatch(bind(&EventDispatcher::dispatchTouchEvents, this));
</del><ins>+ if (updateListWasEmpty) {
+ RefPtr<EventDispatcher> eventDispatcher(this);
+ RunLoop::main().dispatch([eventDispatcher] {
+ eventDispatcher->dispatchTouchEvents();
+ });
+ }
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void EventDispatcher::dispatchTouchEvents()
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPagemacTiledCoreAnimationDrawingAreamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm (177847 => 177848)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm        2015-01-01 20:49:32 UTC (rev 177847)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm        2015-01-01 21:20:21 UTC (rev 177848)
</span><span class="lines">@@ -191,7 +191,11 @@
</span><span class="cx"> #if ENABLE(ASYNC_SCROLLING)
</span><span class="cx"> if (AsyncScrollingCoordinator* scrollingCoordinator = downcast<AsyncScrollingCoordinator>(m_webPage.corePage()->scrollingCoordinator())) {
</span><span class="cx"> bool scrollingPerformanceLoggingEnabled = m_webPage.scrollingPerformanceLoggingEnabled();
</span><del>- ScrollingThread::dispatch(bind(&ScrollingTree::setScrollingPerformanceLoggingEnabled, scrollingCoordinator->scrollingTree(), scrollingPerformanceLoggingEnabled));
</del><ins>+
+ RefPtr<ScrollingTree> scrollingTree = scrollingCoordinator->scrollingTree();
+ ScrollingThread::dispatch([scrollingTree, scrollingPerformanceLoggingEnabled] {
+ scrollingTree->setScrollingPerformanceLoggingEnabled(scrollingPerformanceLoggingEnabled);
+ });
</ins><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>