<!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  &lt;sam@webkit.org&gt;
+
+        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  &lt;antti@apple.com&gt;
</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(&amp;ThreadedScrollingTree::handleWheelEvent, this, wheelEvent));
</del><ins>+    RefPtr&lt;ThreadedScrollingTree&gt; threadedScrollingTree(this);
+    ScrollingThread::dispatch([threadedScrollingTree, wheelEvent] {
+        threadedScrollingTree-&gt;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-&gt;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-&gt;deref();
+    });
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void ThreadedScrollingTree::commitNewTreeState(std::unique_ptr&lt;ScrollingStateTree&gt; scrollingStateTree)
</span><span class="lines">@@ -103,7 +103,12 @@
</span><span class="cx">     if (nodeID == rootNode()-&gt;scrollingNodeID())
</span><span class="cx">         setMainFrameScrollPosition(scrollPosition);
</span><span class="cx"> 
</span><del>-    RunLoop::main().dispatch(bind(&amp;AsyncScrollingCoordinator::scheduleUpdateScrollPositionAfterAsyncScroll, m_scrollingCoordinator.get(), nodeID, scrollPosition, isHandlingProgrammaticScroll(), scrollingLayerPositionAction));
</del><ins>+    RefPtr&lt;AsyncScrollingCoordinator&gt; scrollingCoordinator = m_scrollingCoordinator;
+    bool localIsHandlingProgrammaticScroll = isHandlingProgrammaticScroll();
+    
+    RunLoop::main().dispatch([scrollingCoordinator, nodeID, scrollPosition, localIsHandlingProgrammaticScroll, scrollingLayerPositionAction] {
+        scrollingCoordinator-&gt;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(&amp;ScrollingCoordinator::handleWheelEventPhase, m_scrollingCoordinator.get(), phase));
</del><ins>+    RefPtr&lt;AsyncScrollingCoordinator&gt; scrollingCoordinator = m_scrollingCoordinator;
+    RunLoop::main().dispatch([scrollingCoordinator, phase] {
+        scrollingCoordinator-&gt;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-&gt;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-&gt;deref();
+    });
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void ScrollingTreeIOS::commitNewTreeState(std::unique_ptr&lt;ScrollingStateTree&gt; scrollingStateTree)
</span><span class="lines">@@ -90,7 +86,12 @@
</span><span class="cx">     if (nodeID == rootNode()-&gt;scrollingNodeID())
</span><span class="cx">         setMainFrameScrollPosition(scrollPosition);
</span><span class="cx"> 
</span><del>-    callOnMainThread(bind(&amp;AsyncScrollingCoordinator::scheduleUpdateScrollPositionAfterAsyncScroll, m_scrollingCoordinator.get(), nodeID, scrollPosition, isHandlingProgrammaticScroll(), scrollingLayerPositionAction));
</del><ins>+    RefPtr&lt;AsyncScrollingCoordinator&gt; scrollingCoordinator = m_scrollingCoordinator;
+    bool localIsHandlingProgrammaticScroll = isHandlingProgrammaticScroll();
+
+    callOnMainThread([scrollingCoordinator, nodeID, scrollPosition, localIsHandlingProgrammaticScroll, scrollingLayerPositionAction] {
+        scrollingCoordinator-&gt;scheduleUpdateScrollPositionAfterAsyncScroll(nodeID, scrollPosition, isHandlingProgrammaticScroll, scrollingLayerPositionAction);
+    });
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> PassRefPtr&lt;ScrollingTreeNode&gt; 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&lt;ThreadedScrollingTree&gt; scrollingTree = static_pointer_cast&lt;ThreadedScrollingTree&gt;(releaseScrollingTree());
</span><del>-    ScrollingThread::dispatch(bind(&amp;ThreadedScrollingTree::invalidate, scrollingTree));
</del><ins>+    ScrollingThread::dispatch([scrollingTree] {
+        scrollingTree-&gt;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()-&gt;willWheelEventStartSwipeGesture(wheelEvent))
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    ScrollingThread::dispatch(bind(&amp;ThreadedScrollingTree::handleWheelEvent, downcast&lt;ThreadedScrollingTree&gt;(scrollingTree()), wheelEvent));
</del><ins>+    RefPtr&lt;ThreadedScrollingTree&gt; threadedScrollingTree = downcast&lt;ThreadedScrollingTree&gt;(scrollingTree());
+    ScrollingThread::dispatch([threadedScrollingTree, wheelEvent] {
+        threadedScrollingTree-&gt;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) &amp;&amp; !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&lt;std::mutex&gt; lock(threadSetMutex());
</span><span class="cx"> 
</span><del>-    for (auto* workerThread : workerThreads())
</del><ins>+    for (auto* workerThread : workerThreads()) {
</ins><span class="cx">         workerThread-&gt;runLoop().postTask([] (ScriptExecutionContext&amp;) {
</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  &lt;sam@webkit.org&gt;
+
+        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  &lt;darin@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         We often misspell identifier as &quot;identifer&quot;
</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&lt;ThreadedScrollingTree&gt; 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(&amp;ThreadedScrollingTree::setCanRubberBandState, scrollingTree, canRubberBandAtLeft, canRubberBandAtRight, canRubberBandAtTop, canRubberBandAtBottom));
</del><ins>+        if (platformWheelEvent.phase() == PlatformWheelEventPhaseBegan) {
+            ScrollingThread::dispatch([scrollingTree, canRubberBandAtLeft, canRubberBandAtRight, canRubberBandAtTop, canRubberBandAtBottom] {
+                scrollingTree-&gt;setCanRubberBandState(canRubberBandAtLeft, canRubberBandAtRight, canRubberBandAtTop, canRubberBandAtBottom);
+            });
+        }
</ins><span class="cx"> 
</span><span class="cx">         ScrollingTree::EventResult result = scrollingTree-&gt;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(&amp;EventDispatcher::dispatchWheelEvent, this, pageID, wheelEvent));
</del><ins>+    RefPtr&lt;EventDispatcher&gt; eventDispatcher(this);
+    RunLoop::main().dispatch([eventDispatcher, pageID, wheelEvent] {
+        eventDispatcher-&gt;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(&amp;EventDispatcher::dispatchTouchEvents, this));
</del><ins>+    if (updateListWasEmpty) {
+        RefPtr&lt;EventDispatcher&gt; eventDispatcher(this);
+        RunLoop::main().dispatch([eventDispatcher] {
+            eventDispatcher-&gt;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&lt;AsyncScrollingCoordinator&gt;(m_webPage.corePage()-&gt;scrollingCoordinator())) {
</span><span class="cx">         bool scrollingPerformanceLoggingEnabled = m_webPage.scrollingPerformanceLoggingEnabled();
</span><del>-        ScrollingThread::dispatch(bind(&amp;ScrollingTree::setScrollingPerformanceLoggingEnabled, scrollingCoordinator-&gt;scrollingTree(), scrollingPerformanceLoggingEnabled));
</del><ins>+        
+        RefPtr&lt;ScrollingTree&gt; scrollingTree = scrollingCoordinator-&gt;scrollingTree();
+        ScrollingThread::dispatch([scrollingTree, scrollingPerformanceLoggingEnabled] {
+            scrollingTree-&gt;setScrollingPerformanceLoggingEnabled(scrollingPerformanceLoggingEnabled);
+        });
</ins><span class="cx">     }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>