<!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>[161198] 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/161198">161198</a></dd>
<dt>Author</dt> <dd>simon.fraser@apple.com</dd>
<dt>Date</dt> <dd>2014-01-01 15:20:25 -0800 (Wed, 01 Jan 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Create a ThreadedScrollingTree subclass of ScrollingTree, and push all knowledge of the scrolling thread into it
https://bugs.webkit.org/show_bug.cgi?id=126362

Reviewed by Sam Weinig.

Eventually we'll have a ScrollingTree in situations where there is no scrolling
thread, so make the ScrollingTree base class thread-agnostic (but threadsafe),
and subclass it in ThreadedScrollingTree for scrolling-thread-specific functionality.

The ScrollingTree base class also no longer needs to know about the
ScrollingCoordinator.

ScrollingCoordinatorMac creates a ThreadedScrollingTree.

Source/WebCore:

* WebCore.exp.in:
* WebCore.xcodeproj/project.pbxproj: Add ThreadedScrollingTree.*
Make some headers Private that we'll need in WebKit2 soon.
* page/scrolling/ScrollingStateTree.h: Drive-by cleanup: clone() was unimplemented.
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::ScrollingTree):
(WebCore::ScrollingTree::~ScrollingTree):
(WebCore::ScrollingTree::shouldHandleWheelEventSynchronously): Wrap up some logic that
involves taking the mutex, so ThreadedScrollingTree can conveniently call it.
(WebCore::ScrollingTree::handleWheelEvent):
(WebCore::ScrollingTree::commitNewTreeState):
(WebCore::ScrollingTree::setMainFrameScrollPosition):
(WebCore::ScrollingTree::isHandlingProgrammaticScroll):
* page/scrolling/ScrollingTree.h:
(WebCore::ScrollingTree::isThreadedScrollingTree):
(WebCore::ScrollingTree::invalidate):
* page/scrolling/ThreadedScrollingTree.cpp: Added.
(WebCore::ThreadedScrollingTree::create):
(WebCore::ThreadedScrollingTree::ThreadedScrollingTree):
(WebCore::ThreadedScrollingTree::~ThreadedScrollingTree):
(WebCore::ThreadedScrollingTree::tryToHandleWheelEvent):
(WebCore::ThreadedScrollingTree::handleWheelEvent):
(WebCore::derefScrollingCoordinator):
(WebCore::ThreadedScrollingTree::invalidate):
(WebCore::ThreadedScrollingTree::commitNewTreeState):
(WebCore::ThreadedScrollingTree::updateMainFrameScrollPosition):
(WebCore::ThreadedScrollingTree::handleWheelEventPhase):
* page/scrolling/ThreadedScrollingTree.h: Added.
(WebCore::ThreadedScrollingTree::isThreadedScrollingTree):
* page/scrolling/mac/ScrollingCoordinatorMac.h:
* page/scrolling/mac/ScrollingCoordinatorMac.mm:
(WebCore::ScrollingCoordinatorMac::ScrollingCoordinatorMac):
(WebCore::ScrollingCoordinatorMac::handleWheelEvent):

Source/WebKit2:

* WebProcess/WebPage/EventDispatcher.cpp:
(WebKit::EventDispatcher::addScrollingTreeForPage):
(WebKit::EventDispatcher::wheelEvent):
* WebProcess/WebPage/EventDispatcher.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCoreexpin">trunk/Source/WebCore/WebCore.exp.in</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorepagescrollingScrollingStateTreeh">trunk/Source/WebCore/page/scrolling/ScrollingStateTree.h</a></li>
<li><a href="#trunkSourceWebCorepagescrollingScrollingTreecpp">trunk/Source/WebCore/page/scrolling/ScrollingTree.cpp</a></li>
<li><a href="#trunkSourceWebCorepagescrollingScrollingTreeh">trunk/Source/WebCore/page/scrolling/ScrollingTree.h</a></li>
<li><a href="#trunkSourceWebCorepagescrollingmacScrollingCoordinatorMach">trunk/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.h</a></li>
<li><a href="#trunkSourceWebCorepagescrollingmacScrollingCoordinatorMacmm">trunk/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.mm</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="#trunkSourceWebKit2WebProcessWebPageEventDispatcherh">trunk/Source/WebKit2/WebProcess/WebPage/EventDispatcher.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCorepagescrollingThreadedScrollingTreecpp">trunk/Source/WebCore/page/scrolling/ThreadedScrollingTree.cpp</a></li>
<li><a href="#trunkSourceWebCorepagescrollingThreadedScrollingTreeh">trunk/Source/WebCore/page/scrolling/ThreadedScrollingTree.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (161197 => 161198)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-01-01 23:18:46 UTC (rev 161197)
+++ trunk/Source/WebCore/ChangeLog        2014-01-01 23:20:25 UTC (rev 161198)
</span><span class="lines">@@ -1,3 +1,53 @@
</span><ins>+2014-01-01  Simon Fraser  &lt;simon.fraser@apple.com&gt;
+
+        Create a ThreadedScrollingTree subclass of ScrollingTree, and push all knowledge of the scrolling thread into it
+        https://bugs.webkit.org/show_bug.cgi?id=126362
+
+        Reviewed by Sam Weinig.
+
+        Eventually we'll have a ScrollingTree in situations where there is no scrolling
+        thread, so make the ScrollingTree base class thread-agnostic (but threadsafe),
+        and subclass it in ThreadedScrollingTree for scrolling-thread-specific functionality.
+        
+        The ScrollingTree base class also no longer needs to know about the
+        ScrollingCoordinator.
+
+        ScrollingCoordinatorMac creates a ThreadedScrollingTree.
+
+        * WebCore.exp.in:
+        * WebCore.xcodeproj/project.pbxproj: Add ThreadedScrollingTree.*
+        Make some headers Private that we'll need in WebKit2 soon.
+        * page/scrolling/ScrollingStateTree.h: Drive-by cleanup: clone() was unimplemented.
+        * page/scrolling/ScrollingTree.cpp:
+        (WebCore::ScrollingTree::ScrollingTree):
+        (WebCore::ScrollingTree::~ScrollingTree):
+        (WebCore::ScrollingTree::shouldHandleWheelEventSynchronously): Wrap up some logic that
+        involves taking the mutex, so ThreadedScrollingTree can conveniently call it.
+        (WebCore::ScrollingTree::handleWheelEvent):
+        (WebCore::ScrollingTree::commitNewTreeState):
+        (WebCore::ScrollingTree::setMainFrameScrollPosition):
+        (WebCore::ScrollingTree::isHandlingProgrammaticScroll):
+        * page/scrolling/ScrollingTree.h:
+        (WebCore::ScrollingTree::isThreadedScrollingTree):
+        (WebCore::ScrollingTree::invalidate):
+        * page/scrolling/ThreadedScrollingTree.cpp: Added.
+        (WebCore::ThreadedScrollingTree::create):
+        (WebCore::ThreadedScrollingTree::ThreadedScrollingTree):
+        (WebCore::ThreadedScrollingTree::~ThreadedScrollingTree):
+        (WebCore::ThreadedScrollingTree::tryToHandleWheelEvent):
+        (WebCore::ThreadedScrollingTree::handleWheelEvent):
+        (WebCore::derefScrollingCoordinator):
+        (WebCore::ThreadedScrollingTree::invalidate):
+        (WebCore::ThreadedScrollingTree::commitNewTreeState):
+        (WebCore::ThreadedScrollingTree::updateMainFrameScrollPosition):
+        (WebCore::ThreadedScrollingTree::handleWheelEventPhase):
+        * page/scrolling/ThreadedScrollingTree.h: Added.
+        (WebCore::ThreadedScrollingTree::isThreadedScrollingTree):
+        * page/scrolling/mac/ScrollingCoordinatorMac.h:
+        * page/scrolling/mac/ScrollingCoordinatorMac.mm:
+        (WebCore::ScrollingCoordinatorMac::ScrollingCoordinatorMac):
+        (WebCore::ScrollingCoordinatorMac::handleWheelEvent):
+
</ins><span class="cx"> 2014-01-01  Andreas Kling  &lt;akling@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         FrameView: Store scroll corner renderer in a RenderPtr.
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCoreexpin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.exp.in (161197 => 161198)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.exp.in        2014-01-01 23:18:46 UTC (rev 161197)
+++ trunk/Source/WebCore/WebCore.exp.in        2014-01-01 23:20:25 UTC (rev 161198)
</span><span class="lines">@@ -2863,7 +2863,6 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(ASYNC_SCROLLING)
</span><span class="cx"> __ZN7WebCore13ScrollingTree21setCanRubberBandStateEbbbb
</span><del>-__ZN7WebCore13ScrollingTree21tryToHandleWheelEventERKNS_18PlatformWheelEventE
</del><span class="cx"> __ZN7WebCore13ScrollingTree37setScrollingPerformanceLoggingEnabledEb
</span><span class="cx"> __ZN7WebCore13ScrollingTreeD1Ev
</span><span class="cx"> __ZN7WebCore15ScrollingThread15dispatchBarrierERKN3WTF8FunctionIFvvEEE
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (161197 => 161198)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-01-01 23:18:46 UTC (rev 161197)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-01-01 23:20:25 UTC (rev 161198)
</span><span class="lines">@@ -470,7 +470,9 @@
</span><span class="cx">                 0F5B7A5410F65D7A00376302 /* RenderEmbeddedObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F5B7A5210F65D7A00376302 /* RenderEmbeddedObject.cpp */; };
</span><span class="cx">                 0F5B7A5510F65D7A00376302 /* RenderEmbeddedObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F5B7A5310F65D7A00376302 /* RenderEmbeddedObject.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 0F605AEC15F94848004DF0C0 /* ScrollingConstraints.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F605AEA15F94848004DF0C0 /* ScrollingConstraints.cpp */; };
</span><del>-                0F605AED15F94848004DF0C0 /* ScrollingConstraints.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F605AEB15F94848004DF0C0 /* ScrollingConstraints.h */; };
</del><ins>+                0F605AED15F94848004DF0C0 /* ScrollingConstraints.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F605AEB15F94848004DF0C0 /* ScrollingConstraints.h */; settings = {ATTRIBUTES = (Private, ); }; };
+                0F6383DD18615B29003E5DB5 /* ThreadedScrollingTree.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F6383DB18615B29003E5DB5 /* ThreadedScrollingTree.cpp */; };
+                0F6383DE18615B29003E5DB5 /* ThreadedScrollingTree.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F6383DC18615B29003E5DB5 /* ThreadedScrollingTree.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 0FA24D79162DF91900A3F4C0 /* GraphicsLayerUpdater.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FA24D77162DF91900A3F4C0 /* GraphicsLayerUpdater.cpp */; };
</span><span class="cx">                 0FA24D7A162DF91900A3F4C0 /* GraphicsLayerUpdater.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FA24D78162DF91900A3F4C0 /* GraphicsLayerUpdater.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 0FA88EBD16A8D1BD00F99984 /* ScrollingStateScrollingNodeMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0FA88EBC16A8D1BD00F99984 /* ScrollingStateScrollingNodeMac.mm */; };
</span><span class="lines">@@ -2940,7 +2942,7 @@
</span><span class="cx">                 931CBD0E161A44E900E4C874 /* ScrollingStateScrollingNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 931CBD08161A44E900E4C874 /* ScrollingStateScrollingNode.cpp */; };
</span><span class="cx">                 931CBD0F161A44E900E4C874 /* ScrollingStateScrollingNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 931CBD09161A44E900E4C874 /* ScrollingStateScrollingNode.h */; };
</span><span class="cx">                 931CBD10161A44E900E4C874 /* ScrollingStateTree.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 931CBD0A161A44E900E4C874 /* ScrollingStateTree.cpp */; };
</span><del>-                931CBD11161A44E900E4C874 /* ScrollingStateTree.h in Headers */ = {isa = PBXBuildFile; fileRef = 931CBD0B161A44E900E4C874 /* ScrollingStateTree.h */; };
</del><ins>+                931CBD11161A44E900E4C874 /* ScrollingStateTree.h in Headers */ = {isa = PBXBuildFile; fileRef = 931CBD0B161A44E900E4C874 /* ScrollingStateTree.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 931CBD13161A44F800E4C874 /* ScrollingStateNodeMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 931CBD12161A44F800E4C874 /* ScrollingStateNodeMac.mm */; };
</span><span class="cx">                 931D72F615FE695300C4C07E /* LayoutMilestones.h in Headers */ = {isa = PBXBuildFile; fileRef = 931D72F515FE695300C4C07E /* LayoutMilestones.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 9326DC0C09DAD5D600AFC847 /* CharsetData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 656581AC09D14EE6000E61D7 /* CharsetData.cpp */; };
</span><span class="lines">@@ -5467,8 +5469,6 @@
</span><span class="cx">                 CE057FA61220731100A476D5 /* DocumentMarkerController.h in Headers */ = {isa = PBXBuildFile; fileRef = CE057FA41220731100A476D5 /* DocumentMarkerController.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 CE08C3D1152B599A0021B8C2 /* AlternativeTextController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CE08C3CF152B599A0021B8C2 /* AlternativeTextController.cpp */; };
</span><span class="cx">                 CE08C3D2152B599A0021B8C2 /* AlternativeTextController.h in Headers */ = {isa = PBXBuildFile; fileRef = CE08C3D0152B599A0021B8C2 /* AlternativeTextController.h */; settings = {ATTRIBUTES = (); }; };
</span><del>-                FE6938B61045D67E008EABB6 /* EventHandlerIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = FE6938B51045D67E008EABB6 /* EventHandlerIOS.mm */; };
-                FED13D3D0CEA936A00D89466 /* FrameIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = FED13D3B0CEA936A00D89466 /* FrameIOS.mm */; };
</del><span class="cx">                 CE7B2DB31586ABAD0098B3FA /* AlternativeTextUIController.h in Headers */ = {isa = PBXBuildFile; fileRef = CE7B2DAF1586ABAD0098B3FA /* AlternativeTextUIController.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 CE7B2DB41586ABAD0098B3FA /* AlternativeTextUIController.mm in Sources */ = {isa = PBXBuildFile; fileRef = CE7B2DB01586ABAD0098B3FA /* AlternativeTextUIController.mm */; };
</span><span class="cx">                 CE7B2DB51586ABAD0098B3FA /* TextAlternativeWithRange.h in Headers */ = {isa = PBXBuildFile; fileRef = CE7B2DB11586ABAD0098B3FA /* TextAlternativeWithRange.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -6330,6 +6330,7 @@
</span><span class="cx">                 FE456F191677D74E005EDDF9 /* DatabaseManager.h in Headers */ = {isa = PBXBuildFile; fileRef = FE456F171677D74E005EDDF9 /* DatabaseManager.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 FE4AADEE16D2C37400026FFC /* AbstractSQLStatement.h in Headers */ = {isa = PBXBuildFile; fileRef = FE4AADEC16D2C37400026FFC /* AbstractSQLStatement.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 FE4AADEF16D2C37400026FFC /* AbstractSQLStatementBackend.h in Headers */ = {isa = PBXBuildFile; fileRef = FE4AADED16D2C37400026FFC /* AbstractSQLStatementBackend.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+                FE6938B61045D67E008EABB6 /* EventHandlerIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = FE6938B51045D67E008EABB6 /* EventHandlerIOS.mm */; };
</ins><span class="cx">                 FE6F6AAF169E057500FC30A2 /* DatabaseBackendContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FE6F6AAD169E057500FC30A2 /* DatabaseBackendContext.cpp */; };
</span><span class="cx">                 FE6F6AB0169E057500FC30A2 /* DatabaseBackendContext.h in Headers */ = {isa = PBXBuildFile; fileRef = FE6F6AAE169E057500FC30A2 /* DatabaseBackendContext.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 FE6FD48D0F676E9300092873 /* JSCoordinates.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FE6FD48B0F676E9300092873 /* JSCoordinates.cpp */; };
</span><span class="lines">@@ -6352,6 +6353,7 @@
</span><span class="cx">                 FEBC5F3116BD0CC300659BD3 /* DatabaseBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FEBC5F2F16BD0CC300659BD3 /* DatabaseBase.cpp */; };
</span><span class="cx">                 FEBC5F3216BD0CC300659BD3 /* DatabaseBase.h in Headers */ = {isa = PBXBuildFile; fileRef = FEBC5F3016BD0CC300659BD3 /* DatabaseBase.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 FED13D3A0CEA934600D89466 /* EditorIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = FED13D390CEA934600D89466 /* EditorIOS.mm */; };
</span><ins>+                FED13D3D0CEA936A00D89466 /* FrameIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = FED13D3B0CEA936A00D89466 /* FrameIOS.mm */; };
</ins><span class="cx">                 FED13D520CEA949700D89466 /* RenderThemeIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = FED13D500CEA949700D89466 /* RenderThemeIOS.h */; };
</span><span class="cx">                 FED48390CED66C3255F72C59 /* MathMLSelectElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F75A059AF170D8FAA5B8CABE /* MathMLSelectElement.cpp */; };
</span><span class="cx">                 FEDEF84116797108000E444A /* DatabaseStrategy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FEDEF83F16797108000E444A /* DatabaseStrategy.cpp */; };
</span><span class="lines">@@ -7099,6 +7101,8 @@
</span><span class="cx">                 0F5B7A5310F65D7A00376302 /* RenderEmbeddedObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderEmbeddedObject.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 0F605AEA15F94848004DF0C0 /* ScrollingConstraints.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScrollingConstraints.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 0F605AEB15F94848004DF0C0 /* ScrollingConstraints.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollingConstraints.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                0F6383DB18615B29003E5DB5 /* ThreadedScrollingTree.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ThreadedScrollingTree.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                0F6383DC18615B29003E5DB5 /* ThreadedScrollingTree.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ThreadedScrollingTree.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 0FA24D77162DF91900A3F4C0 /* GraphicsLayerUpdater.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GraphicsLayerUpdater.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 0FA24D78162DF91900A3F4C0 /* GraphicsLayerUpdater.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GraphicsLayerUpdater.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 0FA88EBC16A8D1BD00F99984 /* ScrollingStateScrollingNodeMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ScrollingStateScrollingNodeMac.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -12625,8 +12629,6 @@
</span><span class="cx">                 CE057FA41220731100A476D5 /* DocumentMarkerController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DocumentMarkerController.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CE08C3CF152B599A0021B8C2 /* AlternativeTextController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AlternativeTextController.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CE08C3D0152B599A0021B8C2 /* AlternativeTextController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AlternativeTextController.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                FE6938B51045D67E008EABB6 /* EventHandlerIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = EventHandlerIOS.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
-                FED13D3B0CEA936A00D89466 /* FrameIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = FrameIOS.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><span class="cx">                 CE5CB1B314EDAB6F00BB2795 /* EventSender.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EventSender.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CE7B2DAF1586ABAD0098B3FA /* AlternativeTextUIController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AlternativeTextUIController.h; path = mac/AlternativeTextUIController.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CE7B2DB01586ABAD0098B3FA /* AlternativeTextUIController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AlternativeTextUIController.mm; path = mac/AlternativeTextUIController.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -13583,6 +13585,7 @@
</span><span class="cx">                 FE456F171677D74E005EDDF9 /* DatabaseManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DatabaseManager.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 FE4AADEC16D2C37400026FFC /* AbstractSQLStatement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AbstractSQLStatement.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 FE4AADED16D2C37400026FFC /* AbstractSQLStatementBackend.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AbstractSQLStatementBackend.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                FE6938B51045D67E008EABB6 /* EventHandlerIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = EventHandlerIOS.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 FE6F6AAD169E057500FC30A2 /* DatabaseBackendContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DatabaseBackendContext.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 FE6F6AAE169E057500FC30A2 /* DatabaseBackendContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DatabaseBackendContext.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 FE6FD48B0F676E9300092873 /* JSCoordinates.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCoordinates.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -13605,6 +13608,7 @@
</span><span class="cx">                 FEBC5F2F16BD0CC300659BD3 /* DatabaseBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DatabaseBase.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 FEBC5F3016BD0CC300659BD3 /* DatabaseBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DatabaseBase.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 FED13D390CEA934600D89466 /* EditorIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = EditorIOS.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                FED13D3B0CEA936A00D89466 /* FrameIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = FrameIOS.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 FED13D500CEA949700D89466 /* RenderThemeIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderThemeIOS.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 FEDEF83F16797108000E444A /* DatabaseStrategy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DatabaseStrategy.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 FEDEF84016797108000E444A /* DatabaseStrategy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DatabaseStrategy.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -14277,6 +14281,15 @@
</span><span class="cx">                         path = DerivedSources/WebCore;
</span><span class="cx">                         sourceTree = BUILT_PRODUCTS_DIR;
</span><span class="cx">                 };
</span><ins>+                18A6CD6F0D8F2025001DC3CE /* ios */ = {
+                        isa = PBXGroup;
+                        children = (
+                                FE6938B51045D67E008EABB6 /* EventHandlerIOS.mm */,
+                                FED13D3B0CEA936A00D89466 /* FrameIOS.mm */,
+                        );
+                        path = ios;
+                        sourceTree = &quot;&lt;group&gt;&quot;;
+                };
</ins><span class="cx">                 1A2E6E560CC551E0004A2062 /* sql */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><span class="lines">@@ -14476,6 +14489,8 @@
</span><span class="cx">                                 1AAADDE214DC8C8F00AF64B3 /* ScrollingTreeNode.h */,
</span><span class="cx">                                 9391A99A1629D6FF00297330 /* ScrollingTreeScrollingNode.cpp */,
</span><span class="cx">                                 9391A99B1629D70000297330 /* ScrollingTreeScrollingNode.h */,
</span><ins>+                                0F6383DB18615B29003E5DB5 /* ThreadedScrollingTree.cpp */,
+                                0F6383DC18615B29003E5DB5 /* ThreadedScrollingTree.h */,
</ins><span class="cx">                         );
</span><span class="cx">                         path = scrolling;
</span><span class="cx">                         sourceTree = &quot;&lt;group&gt;&quot;;
</span><span class="lines">@@ -20545,15 +20560,6 @@
</span><span class="cx">                         path = mediasource;
</span><span class="cx">                         sourceTree = &quot;&lt;group&gt;&quot;;
</span><span class="cx">                 };
</span><del>-                18A6CD6F0D8F2025001DC3CE /* ios */ = {
-                        isa = PBXGroup;
-                        children = (
-                                FE6938B51045D67E008EABB6 /* EventHandlerIOS.mm */,
-                                FED13D3B0CEA936A00D89466 /* FrameIOS.mm */,
-                        );
-                        path = ios;
-                        sourceTree = &quot;&lt;group&gt;&quot;;
-                };
</del><span class="cx">                 CE79D68617F220ED00815C00 /* ios */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><span class="lines">@@ -24181,6 +24187,7 @@
</span><span class="cx">                                 BCE1C41B0D982980003B02F2 /* Location.h in Headers */,
</span><span class="cx">                                 A8239E0109B3CF8A00B60641 /* Logging.h in Headers */,
</span><span class="cx">                                 510194411836D20800925523 /* IDBIndexWriterLevelDB.h in Headers */,
</span><ins>+                                0F6383DE18615B29003E5DB5 /* ThreadedScrollingTree.h in Headers */,
</ins><span class="cx">                                 9BA273F4172206BB0097CE47 /* LogicalSelectionOffsetCaches.h in Headers */,
</span><span class="cx">                                 E187056316E54A0D00585E97 /* MainThreadTask.h in Headers */,
</span><span class="cx">                                 1A8F6BC60DB55CDC001DB794 /* ManifestParser.h in Headers */,
</span><span class="lines">@@ -26889,6 +26896,7 @@
</span><span class="cx">                                 975CA2A11303679D00E99AD9 /* JSCrypto.cpp in Sources */,
</span><span class="cx">                                 209B456B16796A7E00E54E4E /* JSCryptoCustom.cpp in Sources */,
</span><span class="cx">                                 BC46C1FA0C0DDC8F0020CFC3 /* JSCSSCharsetRule.cpp in Sources */,
</span><ins>+                                0F6383DD18615B29003E5DB5 /* ThreadedScrollingTree.cpp in Sources */,
</ins><span class="cx">                                 409EBDC516B7F3CA00CBA3FC /* JSCSSFontFaceLoadEvent.cpp in Sources */,
</span><span class="cx">                                 BC46C1FC0C0DDC8F0020CFC3 /* JSCSSFontFaceRule.cpp in Sources */,
</span><span class="cx">                                 BC46C1FE0C0DDC8F0020CFC3 /* JSCSSImportRule.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingScrollingStateTreeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/ScrollingStateTree.h (161197 => 161198)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/ScrollingStateTree.h        2014-01-01 23:18:46 UTC (rev 161197)
+++ trunk/Source/WebCore/page/scrolling/ScrollingStateTree.h        2014-01-01 23:20:25 UTC (rev 161198)
</span><span class="lines">@@ -72,8 +72,6 @@
</span><span class="cx">     void removeNode(ScrollingStateNode*);
</span><span class="cx">     void didRemoveNode(ScrollingNodeID);
</span><span class="cx"> 
</span><del>-    PassOwnPtr&lt;ScrollingStateTree&gt; clone();
-
</del><span class="cx">     HashMap&lt;ScrollingNodeID, ScrollingStateNode*&gt; m_stateNodeMap;
</span><span class="cx">     OwnPtr&lt;ScrollingStateScrollingNode&gt; m_rootStateNode;
</span><span class="cx">     Vector&lt;ScrollingNodeID&gt; m_nodesRemovedSinceLastCommit;
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingScrollingTreecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/ScrollingTree.cpp (161197 => 161198)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/ScrollingTree.cpp        2014-01-01 23:18:46 UTC (rev 161197)
+++ trunk/Source/WebCore/page/scrolling/ScrollingTree.cpp        2014-01-01 23:20:25 UTC (rev 161198)
</span><span class="lines">@@ -29,26 +29,17 @@
</span><span class="cx"> #if ENABLE(ASYNC_SCROLLING)
</span><span class="cx"> 
</span><span class="cx"> #include &quot;PlatformWheelEvent.h&quot;
</span><del>-#include &quot;ScrollingCoordinator.h&quot;
</del><span class="cx"> #include &quot;ScrollingStateTree.h&quot;
</span><del>-#include &quot;ScrollingThread.h&quot;
</del><span class="cx"> #include &quot;ScrollingTreeFixedNode.h&quot;
</span><span class="cx"> #include &quot;ScrollingTreeNode.h&quot;
</span><span class="cx"> #include &quot;ScrollingTreeScrollingNode.h&quot;
</span><span class="cx"> #include &quot;ScrollingTreeStickyNode.h&quot;
</span><del>-#include &lt;wtf/MainThread.h&gt;
</del><span class="cx"> #include &lt;wtf/TemporaryChange.h&gt;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-PassRefPtr&lt;ScrollingTree&gt; ScrollingTree::create(ScrollingCoordinator* scrollingCoordinator)
-{
-    return adoptRef(new ScrollingTree(scrollingCoordinator));
-}
-
-ScrollingTree::ScrollingTree(ScrollingCoordinator* scrollingCoordinator)
-    : m_scrollingCoordinator(scrollingCoordinator)
-    , m_hasWheelEventHandlers(false)
</del><ins>+ScrollingTree::ScrollingTree()
+    : m_hasWheelEventHandlers(false)
</ins><span class="cx">     , m_rubberBandsAtLeft(true)
</span><span class="cx">     , m_rubberBandsAtRight(true)
</span><span class="cx">     , m_rubberBandsAtTop(true)
</span><span class="lines">@@ -66,65 +57,33 @@
</span><span class="cx"> 
</span><span class="cx"> ScrollingTree::~ScrollingTree()
</span><span class="cx"> {
</span><del>-    ASSERT(!m_scrollingCoordinator);
</del><span class="cx"> }
</span><span class="cx"> 
</span><del>-ScrollingTree::EventResult ScrollingTree::tryToHandleWheelEvent(const PlatformWheelEvent&amp; wheelEvent)
</del><ins>+bool ScrollingTree::shouldHandleWheelEventSynchronously(const PlatformWheelEvent&amp; wheelEvent)
</ins><span class="cx"> {
</span><del>-    {
-        MutexLocker lock(m_mutex);
</del><ins>+    MutexLocker lock(m_mutex);
</ins><span class="cx"> 
</span><del>-        if (m_hasWheelEventHandlers)
-            return SendToMainThread;
</del><ins>+    if (m_hasWheelEventHandlers)
+        return true;
</ins><span class="cx"> 
</span><del>-        if (!m_nonFastScrollableRegion.isEmpty()) {
-            // FIXME: This is not correct for non-default scroll origins.
-            IntPoint position = wheelEvent.position();
-            position.moveBy(m_mainFrameScrollPosition);
-            if (m_nonFastScrollableRegion.contains(position))
-                return SendToMainThread;
-        }
</del><ins>+    if (!m_nonFastScrollableRegion.isEmpty()) {
+        // FIXME: This is not correct for non-default scroll origins.
+        IntPoint position = wheelEvent.position();
+        position.moveBy(m_mainFrameScrollPosition);
+        if (m_nonFastScrollableRegion.contains(position))
+            return true;
</ins><span class="cx">     }
</span><del>-
-    if (willWheelEventStartSwipeGesture(wheelEvent))
-        return DidNotHandleEvent;
-
-    ScrollingThread::dispatch(bind(&amp;ScrollingTree::handleWheelEvent, this, wheelEvent));
-    return DidHandleEvent;
</del><ins>+    return false;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void ScrollingTree::handleWheelEvent(const PlatformWheelEvent&amp; wheelEvent)
</span><span class="cx"> {
</span><del>-    ASSERT(ScrollingThread::isCurrentThread());
-    
</del><span class="cx">     if (m_rootNode)
</span><span class="cx">         m_rootNode-&gt;handleWheelEvent(wheelEvent);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static void derefScrollingCoordinator(ScrollingCoordinator* scrollingCoordinator)
-{
-    ASSERT(isMainThread());
-
-    scrollingCoordinator-&gt;deref();
-}
-
-void ScrollingTree::invalidate()
-{
-    // Invalidate is dispatched by the ScrollingCoordinator class on the ScrollingThread
-    // to break the reference cycle between ScrollingTree and ScrollingCoordinator when the
-    // ScrollingCoordinator's page is destroyed.
-    ASSERT(ScrollingThread::isCurrentThread());
-
-    // Since this can potentially be the last reference to the scrolling coordinator,
-    // we need to release it on the main thread since it has member variables (such as timers)
-    // that expect to be destroyed from the main thread.
-    callOnMainThread(bind(derefScrollingCoordinator, m_scrollingCoordinator.release().leakRef()));
-}
-
</del><span class="cx"> void ScrollingTree::commitNewTreeState(PassOwnPtr&lt;ScrollingStateTree&gt; scrollingStateTree)
</span><span class="cx"> {
</span><del>-    ASSERT(ScrollingThread::isCurrentThread());
-
</del><span class="cx">     bool rootStateNodeChanged = scrollingStateTree-&gt;hasNewRootStateNode();
</span><span class="cx">     
</span><span class="cx">     ScrollingStateScrollingNode* rootNode = scrollingStateTree-&gt;rootStateNode();
</span><span class="lines">@@ -238,34 +197,17 @@
</span><span class="cx">     m_mainFramePinnedToTheBottom = pinnedToTheBottom;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void ScrollingTree::updateMainFrameScrollPosition(const IntPoint&amp; scrollPosition, SetOrSyncScrollingLayerPosition scrollingLayerPositionAction)
-{
-    if (!m_scrollingCoordinator)
-        return;
-
-    {
-        MutexLocker lock(m_mutex);
-        m_mainFrameScrollPosition = scrollPosition;
-    }
-
-    callOnMainThread(bind(&amp;ScrollingCoordinator::scheduleUpdateMainFrameScrollPosition, m_scrollingCoordinator.get(), scrollPosition, m_isHandlingProgrammaticScroll, scrollingLayerPositionAction));
-}
-
</del><span class="cx"> IntPoint ScrollingTree::mainFrameScrollPosition()
</span><span class="cx"> {
</span><span class="cx">     MutexLocker lock(m_mutex);
</span><span class="cx">     return m_mainFrameScrollPosition;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#if PLATFORM(MAC)
-void ScrollingTree::handleWheelEventPhase(PlatformWheelEventPhase phase)
</del><ins>+void ScrollingTree::setMainFrameScrollPosition(IntPoint position)
</ins><span class="cx"> {
</span><del>-    if (!m_scrollingCoordinator)
-        return;
-
-    callOnMainThread(bind(&amp;ScrollingCoordinator::handleWheelEventPhase, m_scrollingCoordinator.get(), phase));
</del><ins>+    MutexLocker lock(m_mutex);
+    m_mainFrameScrollPosition = position;
</ins><span class="cx"> }
</span><del>-#endif
</del><span class="cx"> 
</span><span class="cx"> bool ScrollingTree::isRubberBandInProgress()
</span><span class="cx"> {
</span><span class="lines">@@ -318,7 +260,12 @@
</span><span class="cx"> 
</span><span class="cx">     return m_rubberBandsAtTop;
</span><span class="cx"> }
</span><del>-    
</del><ins>+
+bool ScrollingTree::isHandlingProgrammaticScroll()
+{
+    return m_isHandlingProgrammaticScroll;
+}
+
</ins><span class="cx"> void ScrollingTree::setScrollPinningBehavior(ScrollPinningBehavior pinning)
</span><span class="cx"> {
</span><span class="cx">     MutexLocker locker(m_swipeStateMutex);
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingScrollingTreeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/ScrollingTree.h (161197 => 161198)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/ScrollingTree.h        2014-01-01 23:18:46 UTC (rev 161197)
+++ trunk/Source/WebCore/page/scrolling/ScrollingTree.h        2014-01-01 23:20:25 UTC (rev 161198)
</span><span class="lines">@@ -35,60 +35,45 @@
</span><span class="cx"> #include &lt;wtf/HashMap.h&gt;
</span><span class="cx"> #include &lt;wtf/OwnPtr.h&gt;
</span><span class="cx"> #include &lt;wtf/PassOwnPtr.h&gt;
</span><del>-#include &lt;wtf/PassRefPtr.h&gt;
-#include &lt;wtf/RefPtr.h&gt;
</del><span class="cx"> #include &lt;wtf/ThreadSafeRefCounted.h&gt;
</span><span class="cx"> 
</span><del>-#if PLATFORM(MAC)
-#include &lt;wtf/RetainPtr.h&gt;
-OBJC_CLASS CALayer;
-#endif
-
</del><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class IntPoint;
</span><del>-class ScrollingStateNode;
</del><span class="cx"> class ScrollingStateTree;
</span><ins>+class ScrollingStateNode;
</ins><span class="cx"> class ScrollingTreeNode;
</span><span class="cx"> class ScrollingTreeScrollingNode;
</span><span class="cx"> 
</span><del>-// The ScrollingTree class lives almost exclusively on the scrolling thread and manages the
-// hierarchy of scrollable regions on the page. It's also responsible for dispatching events
-// to the correct scrolling tree nodes or dispatching events back to the ScrollingCoordinator
-// object on the main thread if they can't be handled on the scrolling thread for various reasons.
</del><span class="cx"> class ScrollingTree : public ThreadSafeRefCounted&lt;ScrollingTree&gt; {
</span><span class="cx"> public:
</span><del>-    static PassRefPtr&lt;ScrollingTree&gt; create(ScrollingCoordinator*);
-    ~ScrollingTree();
</del><ins>+    ScrollingTree();
+    virtual ~ScrollingTree();
</ins><span class="cx"> 
</span><span class="cx">     enum EventResult {
</span><span class="cx">         DidNotHandleEvent,
</span><span class="cx">         DidHandleEvent,
</span><span class="cx">         SendToMainThread
</span><span class="cx">     };
</span><ins>+    
+    virtual bool isThreadedScrollingTree() const { return false; }
</ins><span class="cx"> 
</span><del>-    // Can be called from any thread. Will try to handle the wheel event on the scrolling thread.
-    // Returns true if the wheel event can be handled on the scrolling thread and false if the
-    // event must be sent again to the WebCore event handler.
-    EventResult tryToHandleWheelEvent(const PlatformWheelEvent&amp;);
-    bool hasWheelEventHandlers() const { return m_hasWheelEventHandlers; }
</del><ins>+    virtual EventResult tryToHandleWheelEvent(const PlatformWheelEvent&amp;) = 0;
+    bool shouldHandleWheelEventSynchronously(const PlatformWheelEvent&amp;);
</ins><span class="cx"> 
</span><del>-    // Must be called from the scrolling thread. Handles the wheel event.
-    void handleWheelEvent(const PlatformWheelEvent&amp;);
-
</del><span class="cx">     void setMainFrameIsRubberBanding(bool);
</span><span class="cx">     bool isRubberBandInProgress();
</span><span class="cx"> 
</span><del>-    void invalidate();
-    void commitNewTreeState(PassOwnPtr&lt;ScrollingStateTree&gt;);
</del><ins>+    virtual void invalidate() { }
+    virtual void commitNewTreeState(PassOwnPtr&lt;ScrollingStateTree&gt;);
</ins><span class="cx"> 
</span><span class="cx">     void setMainFramePinState(bool pinnedToTheLeft, bool pinnedToTheRight, bool pinnedToTheTop, bool pinnedToTheBottom);
</span><span class="cx"> 
</span><del>-    void updateMainFrameScrollPosition(const IntPoint&amp; scrollPosition, SetOrSyncScrollingLayerPosition = SyncScrollingLayerPosition);
</del><ins>+    virtual void updateMainFrameScrollPosition(const IntPoint&amp; scrollPosition, SetOrSyncScrollingLayerPosition = SyncScrollingLayerPosition) = 0;
</ins><span class="cx">     IntPoint mainFrameScrollPosition();
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(MAC)
</span><del>-    void handleWheelEventPhase(PlatformWheelEventPhase);
</del><ins>+    virtual void handleWheelEventPhase(PlatformWheelEventPhase) = 0;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     // Can be called from any thread. Will update what edges allow rubber-banding.
</span><span class="lines">@@ -98,6 +83,7 @@
</span><span class="cx">     bool rubberBandsAtRight();
</span><span class="cx">     bool rubberBandsAtTop();
</span><span class="cx">     bool rubberBandsAtBottom();
</span><ins>+    bool isHandlingProgrammaticScroll();
</ins><span class="cx">     
</span><span class="cx">     void setScrollPinningBehavior(ScrollPinningBehavior);
</span><span class="cx">     ScrollPinningBehavior scrollPinningBehavior();
</span><span class="lines">@@ -109,13 +95,14 @@
</span><span class="cx"> 
</span><span class="cx">     ScrollingTreeScrollingNode* rootNode() const { return m_rootNode.get(); }
</span><span class="cx"> 
</span><del>-private:
-    explicit ScrollingTree(ScrollingCoordinator*);
</del><ins>+protected:
+    void setMainFrameScrollPosition(IntPoint);
+    virtual void handleWheelEvent(const PlatformWheelEvent&amp;);
</ins><span class="cx"> 
</span><ins>+private:
</ins><span class="cx">     void removeDestroyedNodes(const ScrollingStateTree&amp;);
</span><span class="cx">     void updateTreeFromStateNode(const ScrollingStateNode*);
</span><span class="cx"> 
</span><del>-    RefPtr&lt;ScrollingCoordinator&gt; m_scrollingCoordinator;
</del><span class="cx">     OwnPtr&lt;ScrollingTreeScrollingNode&gt; m_rootNode;
</span><span class="cx"> 
</span><span class="cx">     typedef HashMap&lt;ScrollingNodeID, ScrollingTreeNode*&gt; ScrollingTreeNodeMap;
</span><span class="lines">@@ -143,6 +130,9 @@
</span><span class="cx">     bool m_isHandlingProgrammaticScroll;
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+#define SCROLLING_TREE_TYPE_CASTS(ToValueTypeName, predicate) \
+    TYPE_CASTS_BASE(ToValueTypeName, ScrollingTree, value, value-&gt;predicate, value.predicate)
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(ASYNC_SCROLLING)
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingThreadedScrollingTreecpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/page/scrolling/ThreadedScrollingTree.cpp (0 => 161198)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/ThreadedScrollingTree.cpp                                (rev 0)
+++ trunk/Source/WebCore/page/scrolling/ThreadedScrollingTree.cpp        2014-01-01 23:20:25 UTC (rev 161198)
</span><span class="lines">@@ -0,0 +1,125 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;ThreadedScrollingTree.h&quot;
+
+#if ENABLE(ASYNC_SCROLLING)
+
+#include &quot;PlatformWheelEvent.h&quot;
+#include &quot;ScrollingCoordinator.h&quot;
+#include &quot;ScrollingThread.h&quot;
+#include &quot;ScrollingTreeFixedNode.h&quot;
+#include &quot;ScrollingTreeNode.h&quot;
+#include &quot;ScrollingTreeScrollingNode.h&quot;
+#include &quot;ScrollingTreeStickyNode.h&quot;
+#include &lt;wtf/MainThread.h&gt;
+#include &lt;wtf/TemporaryChange.h&gt;
+
+namespace WebCore {
+
+RefPtr&lt;ThreadedScrollingTree&gt; ThreadedScrollingTree::create(ScrollingCoordinator* scrollingCoordinator)
+{
+    return adoptRef(new ThreadedScrollingTree(scrollingCoordinator));
+}
+
+ThreadedScrollingTree::ThreadedScrollingTree(ScrollingCoordinator* scrollingCoordinator)
+    : m_scrollingCoordinator(scrollingCoordinator)
+{
+}
+
+ThreadedScrollingTree::~ThreadedScrollingTree()
+{
+    // invalidate() should have cleared m_scrollingCoordinator.
+    ASSERT(!m_scrollingCoordinator);
+}
+
+ScrollingTree::EventResult ThreadedScrollingTree::tryToHandleWheelEvent(const PlatformWheelEvent&amp; wheelEvent)
+{
+    if (shouldHandleWheelEventSynchronously(wheelEvent))
+        return SendToMainThread;
+
+    if (willWheelEventStartSwipeGesture(wheelEvent))
+        return DidNotHandleEvent;
+
+    ScrollingThread::dispatch(bind(&amp;ThreadedScrollingTree::handleWheelEvent, this, wheelEvent));
+    return DidHandleEvent;
+}
+
+void ThreadedScrollingTree::handleWheelEvent(const PlatformWheelEvent&amp; wheelEvent)
+{
+    ASSERT(ScrollingThread::isCurrentThread());
+    ScrollingTree::handleWheelEvent(wheelEvent);
+}
+
+static void derefScrollingCoordinator(ScrollingCoordinator* scrollingCoordinator)
+{
+    ASSERT(isMainThread());
+
+    scrollingCoordinator-&gt;deref();
+}
+
+void ThreadedScrollingTree::invalidate()
+{
+    // Invalidate is dispatched by the ScrollingCoordinator class on the ScrollingThread
+    // to break the reference cycle between ScrollingTree and ScrollingCoordinator when the
+    // ScrollingCoordinator's page is destroyed.
+    ASSERT(ScrollingThread::isCurrentThread());
+
+    // Since this can potentially be the last reference to the scrolling coordinator,
+    // we need to release it on the main thread since it has member variables (such as timers)
+    // that expect to be destroyed from the main thread.
+    callOnMainThread(bind(derefScrollingCoordinator, m_scrollingCoordinator.release().leakRef()));
+}
+
+void ThreadedScrollingTree::commitNewTreeState(PassOwnPtr&lt;ScrollingStateTree&gt; scrollingStateTree)
+{
+    ASSERT(ScrollingThread::isCurrentThread());
+    ScrollingTree::commitNewTreeState(scrollingStateTree);
+}
+
+void ThreadedScrollingTree::updateMainFrameScrollPosition(const IntPoint&amp; scrollPosition, SetOrSyncScrollingLayerPosition scrollingLayerPositionAction)
+{
+    if (!m_scrollingCoordinator)
+        return;
+
+    setMainFrameScrollPosition(scrollPosition);
+
+    callOnMainThread(bind(&amp;ScrollingCoordinator::scheduleUpdateMainFrameScrollPosition, m_scrollingCoordinator.get(), scrollPosition, isHandlingProgrammaticScroll(), scrollingLayerPositionAction));
+}
+
+#if PLATFORM(MAC)
+void ThreadedScrollingTree::handleWheelEventPhase(PlatformWheelEventPhase phase)
+{
+    if (!m_scrollingCoordinator)
+        return;
+
+    callOnMainThread(bind(&amp;ScrollingCoordinator::handleWheelEventPhase, m_scrollingCoordinator.get(), phase));
+}
+#endif
+
+} // namespace WebCore
+
+#endif // ENABLE(ASYNC_SCROLLING)
</ins></span></pre></div>
<a id="trunkSourceWebCorepagescrollingThreadedScrollingTreeh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/page/scrolling/ThreadedScrollingTree.h (0 => 161198)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/ThreadedScrollingTree.h                                (rev 0)
+++ trunk/Source/WebCore/page/scrolling/ThreadedScrollingTree.h        2014-01-01 23:20:25 UTC (rev 161198)
</span><span class="lines">@@ -0,0 +1,77 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef ThreadedScrollingTree_h
+#define ThreadedScrollingTree_h
+
+#if ENABLE(ASYNC_SCROLLING)
+
+#include &quot;ScrollingStateTree.h&quot;
+#include &quot;ScrollingTree.h&quot;
+#include &lt;wtf/PassRefPtr.h&gt;
+#include &lt;wtf/RefPtr.h&gt;
+
+namespace WebCore {
+
+// The ThreadedScrollingTree class lives almost exclusively on the scrolling thread and manages the
+// hierarchy of scrollable regions on the page. It's also responsible for dispatching events
+// to the correct scrolling tree nodes or dispatching events back to the ScrollingCoordinator
+// object on the main thread if they can't be handled on the scrolling thread for various reasons.
+class ThreadedScrollingTree : public ScrollingTree {
+public:
+    static RefPtr&lt;ThreadedScrollingTree&gt; create(ScrollingCoordinator*);
+
+    virtual ~ThreadedScrollingTree();
+
+    virtual bool isThreadedScrollingTree() const { return true; }
+
+    virtual void handleWheelEvent(const PlatformWheelEvent&amp;) OVERRIDE;
+
+    // Can be called from any thread. Will try to handle the wheel event on the scrolling thread.
+    // Returns true if the wheel event can be handled on the scrolling thread and false if the
+    // event must be sent again to the WebCore event handler.
+    virtual EventResult tryToHandleWheelEvent(const PlatformWheelEvent&amp;) OVERRIDE;
+
+    virtual void invalidate() OVERRIDE;
+
+private:
+    explicit ThreadedScrollingTree(ScrollingCoordinator*);
+
+    virtual void commitNewTreeState(PassOwnPtr&lt;ScrollingStateTree&gt;) OVERRIDE;
+    virtual void updateMainFrameScrollPosition(const IntPoint&amp; scrollPosition, SetOrSyncScrollingLayerPosition = SyncScrollingLayerPosition) OVERRIDE;
+#if PLATFORM(MAC)
+    virtual void handleWheelEventPhase(PlatformWheelEventPhase) OVERRIDE;
+#endif
+
+    RefPtr&lt;ScrollingCoordinator&gt; m_scrollingCoordinator;
+};
+
+SCROLLING_TREE_TYPE_CASTS(ThreadedScrollingTree, isThreadedScrollingTree());
+
+} // namespace WebCore
+
+#endif // ENABLE(ASYNC_SCROLLING)
+
+#endif // ThreadedScrollingTree_h
</ins></span></pre></div>
<a id="trunkSourceWebCorepagescrollingmacScrollingCoordinatorMach"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.h (161197 => 161198)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.h        2014-01-01 23:18:46 UTC (rev 161197)
+++ trunk/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.h        2014-01-01 23:20:25 UTC (rev 161198)
</span><span class="lines">@@ -36,6 +36,7 @@
</span><span class="cx"> class ScrollingStateNode;
</span><span class="cx"> class ScrollingStateScrollingNode;
</span><span class="cx"> class ScrollingStateTree;
</span><ins>+class ThreadedScrollingTree;
</ins><span class="cx"> 
</span><span class="cx"> class ScrollingCoordinatorMac : public ScrollingCoordinator {
</span><span class="cx"> public:
</span><span class="lines">@@ -114,7 +115,7 @@
</span><span class="cx">     void commitTreeState();
</span><span class="cx"> 
</span><span class="cx">     OwnPtr&lt;ScrollingStateTree&gt; m_scrollingStateTree;
</span><del>-    RefPtr&lt;ScrollingTree&gt; m_scrollingTree;
</del><ins>+    RefPtr&lt;ThreadedScrollingTree&gt; m_scrollingTree;
</ins><span class="cx">     Timer&lt;ScrollingCoordinatorMac&gt; m_scrollingStateTreeCommitterTimer;
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingmacScrollingCoordinatorMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.mm (161197 => 161198)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.mm        2014-01-01 23:18:46 UTC (rev 161197)
+++ trunk/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.mm        2014-01-01 23:20:25 UTC (rev 161198)
</span><span class="lines">@@ -46,7 +46,7 @@
</span><span class="cx"> #include &quot;ScrollingStateStickyNode.h&quot;
</span><span class="cx"> #include &quot;ScrollingStateTree.h&quot;
</span><span class="cx"> #include &quot;ScrollingThread.h&quot;
</span><del>-#include &quot;ScrollingTree.h&quot;
</del><ins>+#include &quot;ThreadedScrollingTree.h&quot;
</ins><span class="cx"> #include &quot;TiledBacking.h&quot;
</span><span class="cx"> #include &lt;wtf/Functional.h&gt;
</span><span class="cx"> #include &lt;wtf/MainThread.h&gt;
</span><span class="lines">@@ -61,7 +61,7 @@
</span><span class="cx"> ScrollingCoordinatorMac::ScrollingCoordinatorMac(Page* page)
</span><span class="cx">     : ScrollingCoordinator(page)
</span><span class="cx">     , m_scrollingStateTree(ScrollingStateTree::create())
</span><del>-    , m_scrollingTree(ScrollingTree::create(this))
</del><ins>+    , m_scrollingTree(ThreadedScrollingTree::create(this))
</ins><span class="cx">     , m_scrollingStateTreeCommitterTimer(this, &amp;ScrollingCoordinatorMac::scrollingStateTreeCommitterTimerFired)
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="lines">@@ -232,8 +232,7 @@
</span><span class="cx">     if (m_scrollingTree-&gt;willWheelEventStartSwipeGesture(wheelEvent))
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    ScrollingThread::dispatch(bind(&amp;ScrollingTree::handleWheelEvent, m_scrollingTree.get(), wheelEvent));
-
</del><ins>+    ScrollingThread::dispatch(bind(&amp;ThreadedScrollingTree::handleWheelEvent, m_scrollingTree.get(), wheelEvent));
</ins><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (161197 => 161198)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-01-01 23:18:46 UTC (rev 161197)
+++ trunk/Source/WebKit2/ChangeLog        2014-01-01 23:20:25 UTC (rev 161198)
</span><span class="lines">@@ -1,5 +1,26 @@
</span><span class="cx"> 2014-01-01  Simon Fraser  &lt;simon.fraser@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Create a ThreadedScrollingTree subclass of ScrollingTree, and push all knowledge of the scrolling thread into it
+        https://bugs.webkit.org/show_bug.cgi?id=126362
+
+        Reviewed by Sam Weinig.
+
+        Eventually we'll have a ScrollingTree in situations where there is no scrolling
+        thread, so make the ScrollingTree base class thread-agnostic (but threadsafe),
+        and subclass it in ThreadedScrollingTree for scrolling-thread-specific functionality.
+        
+        The ScrollingTree base class also no longer needs to know about the
+        ScrollingCoordinator.
+
+        ScrollingCoordinatorMac creates a ThreadedScrollingTree.
+
+        * WebProcess/WebPage/EventDispatcher.cpp:
+        (WebKit::EventDispatcher::addScrollingTreeForPage):
+        (WebKit::EventDispatcher::wheelEvent):
+        * WebProcess/WebPage/EventDispatcher.h:
+
+2014-01-01  Simon Fraser  &lt;simon.fraser@apple.com&gt;
+
</ins><span class="cx">         Add a typedef for PlatformLayerID on GraphicsLayer, and migrate RemoteLayerTreeTransaction to use it
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=126346
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageEventDispatchercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/EventDispatcher.cpp (161197 => 161198)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/EventDispatcher.cpp        2014-01-01 23:18:46 UTC (rev 161197)
+++ trunk/Source/WebKit2/WebProcess/WebPage/EventDispatcher.cpp        2014-01-01 23:20:25 UTC (rev 161198)
</span><span class="lines">@@ -39,7 +39,7 @@
</span><span class="cx"> #if ENABLE(ASYNC_SCROLLING)
</span><span class="cx"> #include &lt;WebCore/ScrollingCoordinator.h&gt;
</span><span class="cx"> #include &lt;WebCore/ScrollingThread.h&gt;
</span><del>-#include &lt;WebCore/ScrollingTree.h&gt;
</del><ins>+#include &lt;WebCore/ThreadedScrollingTree.h&gt;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> using namespace WebCore;
</span><span class="lines">@@ -67,7 +67,7 @@
</span><span class="cx"> 
</span><span class="cx">     ASSERT(webPage-&gt;corePage()-&gt;scrollingCoordinator());
</span><span class="cx">     ASSERT(!m_scrollingTrees.contains(webPage-&gt;pageID()));
</span><del>-    m_scrollingTrees.set(webPage-&gt;pageID(), webPage-&gt;corePage()-&gt;scrollingCoordinator()-&gt;scrollingTree());
</del><ins>+    m_scrollingTrees.set(webPage-&gt;pageID(), toThreadedScrollingTree(webPage-&gt;corePage()-&gt;scrollingCoordinator()-&gt;scrollingTree()));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void EventDispatcher::removeScrollingTreeForPage(WebPage* webPage)
</span><span class="lines">@@ -88,7 +88,7 @@
</span><span class="cx"> {
</span><span class="cx"> #if ENABLE(ASYNC_SCROLLING)
</span><span class="cx">     MutexLocker locker(m_scrollingTreesMutex);
</span><del>-    if (ScrollingTree* scrollingTree = m_scrollingTrees.get(pageID)) {
</del><ins>+    if (ThreadedScrollingTree* scrollingTree = m_scrollingTrees.get(pageID)) {
</ins><span class="cx">         PlatformWheelEvent platformWheelEvent = platform(wheelEvent);
</span><span class="cx"> 
</span><span class="cx">         // FIXME: It's pretty horrible that we're updating the back/forward state here.
</span><span class="lines">@@ -96,7 +96,7 @@
</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><span class="cx">         if (platformWheelEvent.phase() == PlatformWheelEventPhaseBegan)
</span><del>-            ScrollingThread::dispatch(bind(&amp;ScrollingTree::setCanRubberBandState, scrollingTree, canRubberBandAtLeft, canRubberBandAtRight, canRubberBandAtTop, canRubberBandAtBottom));
</del><ins>+            ScrollingThread::dispatch(bind(&amp;ThreadedScrollingTree::setCanRubberBandState, scrollingTree, 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></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageEventDispatcherh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/EventDispatcher.h (161197 => 161198)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/EventDispatcher.h        2014-01-01 23:18:46 UTC (rev 161197)
+++ trunk/Source/WebKit2/WebProcess/WebPage/EventDispatcher.h        2014-01-01 23:20:25 UTC (rev 161198)
</span><span class="lines">@@ -33,7 +33,7 @@
</span><span class="cx"> #include &lt;wtf/ThreadingPrimitives.h&gt;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><del>-    class ScrollingTree;
</del><ins>+class ThreadedScrollingTree;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="lines">@@ -74,7 +74,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(ASYNC_SCROLLING)
</span><span class="cx">     Mutex m_scrollingTreesMutex;
</span><del>-    HashMap&lt;uint64_t, RefPtr&lt;WebCore::ScrollingTree&gt;&gt; m_scrollingTrees;
</del><ins>+    HashMap&lt;uint64_t, RefPtr&lt;WebCore::ThreadedScrollingTree&gt;&gt; m_scrollingTrees;
</ins><span class="cx"> #endif
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>