Create a ThreadedScrollingTree subclass of ScrollingTree, and push all knowledge...
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 1 Jan 2014 23:20:25 +0000 (23:20 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 1 Jan 2014 23:20:25 +0000 (23:20 +0000)
commitfb9195bc027f9bf36f9aad7dadea3c385added82
tree71862ad1ed18253e5ebe139fa12fc8be028eabde
parentb7320c7cba7996a5896524d8a18c21014901aa83
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:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@161198 268f45cc-cd09-0410-ab3c-d52691b4dbfc
13 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/page/scrolling/ScrollingStateTree.h
Source/WebCore/page/scrolling/ScrollingTree.cpp
Source/WebCore/page/scrolling/ScrollingTree.h
Source/WebCore/page/scrolling/ThreadedScrollingTree.cpp [new file with mode: 0644]
Source/WebCore/page/scrolling/ThreadedScrollingTree.h [new file with mode: 0644]
Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.h
Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.mm
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebPage/EventDispatcher.cpp
Source/WebKit2/WebProcess/WebPage/EventDispatcher.h