- Revision
- 106723
- Author
- [email protected]
- Date
- 2012-02-03 17:56:42 -0800 (Fri, 03 Feb 2012)
Log Message
WebKit2 should dispatch wheel events to the new ScrollingTree class
https://bugs.webkit.org/show_bug.cgi?id=77795
Reviewed by Andreas Kling.
Source/WebCore:
* WebCore.exp.in:
Add new symbols needed by WebKit2.
* WebCore.xcodeproj/project.pbxproj:
Make ScrollingTree.h private so it can be included by WebKit2.
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::scrollingTree):
* page/scrolling/ScrollingCoordinator.h:
Add a scrolling tree getter.
Source/WebKit2:
Replace all uses of ScrollingCoordinator with ScrollingTree instead.
Also, don't try to handle gesture events on the scrolling thread anymore;
we don't need to to that right now.
* WebProcess/WebPage/EventDispatcher.cpp:
(WebKit::EventDispatcher::addScrollingTreeForPage):
(WebKit::EventDispatcher::removeScrollingTreeForPage):
(WebKit::EventDispatcher::wheelEvent):
(WebKit::EventDispatcher::gestureEvent):
* WebProcess/WebPage/EventDispatcher.h:
(WebCore):
(EventDispatcher):
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
(WebKit::TiledCoreAnimationDrawingArea::~TiledCoreAnimationDrawingArea):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (106722 => 106723)
--- trunk/Source/WebCore/ChangeLog 2012-02-04 01:45:14 UTC (rev 106722)
+++ trunk/Source/WebCore/ChangeLog 2012-02-04 01:56:42 UTC (rev 106723)
@@ -1,3 +1,21 @@
+2012-02-03 Anders Carlsson <[email protected]>
+
+ WebKit2 should dispatch wheel events to the new ScrollingTree class
+ https://bugs.webkit.org/show_bug.cgi?id=77795
+
+ Reviewed by Andreas Kling.
+
+ * WebCore.exp.in:
+ Add new symbols needed by WebKit2.
+
+ * WebCore.xcodeproj/project.pbxproj:
+ Make ScrollingTree.h private so it can be included by WebKit2.
+
+ * page/scrolling/ScrollingCoordinator.cpp:
+ (WebCore::ScrollingCoordinator::scrollingTree):
+ * page/scrolling/ScrollingCoordinator.h:
+ Add a scrolling tree getter.
+
2012-02-03 Dmitry Lomov <[email protected]>
[Chromium] WebCore::toV8Context crashes if DomWindow::frame() returns null.
Modified: trunk/Source/WebCore/WebCore.exp.in (106722 => 106723)
--- trunk/Source/WebCore/WebCore.exp.in 2012-02-04 01:45:14 UTC (rev 106722)
+++ trunk/Source/WebCore/WebCore.exp.in 2012-02-04 01:56:42 UTC (rev 106723)
@@ -2066,9 +2066,12 @@
#endif
#if ENABLE(THREADED_SCROLLING)
+__ZN7WebCore13ScrollingTree21tryToHandleWheelEventERKNS_18PlatformWheelEventE
+__ZN7WebCore13ScrollingTreeD1Ev
__ZN7WebCore20ScrollingCoordinator16handleWheelEventERKNS_18PlatformWheelEventE
__ZN7WebCore20ScrollingCoordinatorD1Ev
__ZN7WebCore4Page20scrollingCoordinatorEv
+__ZNK7WebCore20ScrollingCoordinator13scrollingTreeEv
#if ENABLE(GESTURE_EVENTS)
__ZN7WebCore20ScrollingCoordinator18handleGestureEventERKNS_20PlatformGestureEventE
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (106722 => 106723)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2012-02-04 01:45:14 UTC (rev 106722)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2012-02-04 01:56:42 UTC (rev 106723)
@@ -489,7 +489,7 @@
1AA84F05143BA7BD0051D153 /* ScrollElasticityController.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AA84F03143BA7BD0051D153 /* ScrollElasticityController.h */; };
1AA8799011CBE846003C664F /* PluginStrategy.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AA8798F11CBE846003C664F /* PluginStrategy.h */; settings = {ATTRIBUTES = (Private, ); }; };
1AAADDA314DB409F00AF64B3 /* ScrollingTree.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAADDA114DB409F00AF64B3 /* ScrollingTree.cpp */; };
- 1AAADDA414DB409F00AF64B3 /* ScrollingTree.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AAADDA214DB409F00AF64B3 /* ScrollingTree.h */; };
+ 1AAADDA414DB409F00AF64B3 /* ScrollingTree.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AAADDA214DB409F00AF64B3 /* ScrollingTree.h */; settings = {ATTRIBUTES = (Private, ); }; };
1AAADDBE14DC640700AF64B3 /* ScrollingTreeState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAADDBC14DC640600AF64B3 /* ScrollingTreeState.cpp */; };
1AAADDBF14DC640700AF64B3 /* ScrollingTreeState.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AAADDBD14DC640600AF64B3 /* ScrollingTreeState.h */; };
1AAADDDA14DC74EC00AF64B3 /* ScrollingTreeStateMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AAADDD814DC74EC00AF64B3 /* ScrollingTreeStateMac.mm */; };
Modified: trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp (106722 => 106723)
--- trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp 2012-02-04 01:45:14 UTC (rev 106722)
+++ trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp 2012-02-04 01:56:42 UTC (rev 106723)
@@ -73,6 +73,12 @@
ScrollingThread::dispatch(bind(&ScrollingTree::invalidate, m_scrollingTree.release()));
}
+ScrollingTree* ScrollingCoordinator::scrollingTree() const
+{
+ ASSERT(m_scrollingTree);
+ return m_scrollingTree.get();
+}
+
bool ScrollingCoordinator::coordinatesScrollingForFrameView(FrameView* frameView) const
{
ASSERT(isMainThread());
Modified: trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h (106722 => 106723)
--- trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h 2012-02-04 01:45:14 UTC (rev 106722)
+++ trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h 2012-02-04 01:56:42 UTC (rev 106723)
@@ -59,6 +59,8 @@
void pageDestroyed();
+ ScrollingTree* scrollingTree() const;
+
// Return whether this scrolling coordinator handles scrolling for the given frame view.
bool coordinatesScrollingForFrameView(FrameView*) const;
Modified: trunk/Source/WebKit2/ChangeLog (106722 => 106723)
--- trunk/Source/WebKit2/ChangeLog 2012-02-04 01:45:14 UTC (rev 106722)
+++ trunk/Source/WebKit2/ChangeLog 2012-02-04 01:56:42 UTC (rev 106723)
@@ -1,3 +1,26 @@
+2012-02-03 Anders Carlsson <[email protected]>
+
+ WebKit2 should dispatch wheel events to the new ScrollingTree class
+ https://bugs.webkit.org/show_bug.cgi?id=77795
+
+ Reviewed by Andreas Kling.
+
+ Replace all uses of ScrollingCoordinator with ScrollingTree instead.
+ Also, don't try to handle gesture events on the scrolling thread anymore;
+ we don't need to to that right now.
+
+ * WebProcess/WebPage/EventDispatcher.cpp:
+ (WebKit::EventDispatcher::addScrollingTreeForPage):
+ (WebKit::EventDispatcher::removeScrollingTreeForPage):
+ (WebKit::EventDispatcher::wheelEvent):
+ (WebKit::EventDispatcher::gestureEvent):
+ * WebProcess/WebPage/EventDispatcher.h:
+ (WebCore):
+ (EventDispatcher):
+ * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
+ (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
+ (WebKit::TiledCoreAnimationDrawingArea::~TiledCoreAnimationDrawingArea):
+
2012-02-03 Alexey Proskuryakov <[email protected]>
[WK2 Mac] No need to allow access to input methods or keyboard layouts
Modified: trunk/Source/WebKit2/WebProcess/WebPage/EventDispatcher.cpp (106722 => 106723)
--- trunk/Source/WebKit2/WebProcess/WebPage/EventDispatcher.cpp 2012-02-04 01:45:14 UTC (rev 106722)
+++ trunk/Source/WebKit2/WebProcess/WebPage/EventDispatcher.cpp 2012-02-04 01:56:42 UTC (rev 106723)
@@ -37,6 +37,7 @@
#if ENABLE(THREADED_SCROLLING)
#include <WebCore/ScrollingCoordinator.h>
+#include <WebCore/ScrollingTree.h>
#endif
using namespace WebCore;
@@ -52,21 +53,21 @@
}
#if ENABLE(THREADED_SCROLLING)
-void EventDispatcher::addScrollingCoordinatorForPage(WebPage* webPage)
+void EventDispatcher::addScrollingTreeForPage(WebPage* webPage)
{
- MutexLocker locker(m_scrollingCoordinatorsMutex);
+ MutexLocker locker(m_scrollingTreesMutex);
ASSERT(webPage->corePage()->scrollingCoordinator());
- ASSERT(!m_scrollingCoordinators.contains(webPage->pageID()));
- m_scrollingCoordinators.set(webPage->pageID(), webPage->corePage()->scrollingCoordinator());
+ ASSERT(!m_scrollingTrees.contains(webPage->pageID()));
+ m_scrollingTrees.set(webPage->pageID(), webPage->corePage()->scrollingCoordinator()->scrollingTree());
}
-void EventDispatcher::removeScrollingCoordinatorForPage(WebPage* webPage)
+void EventDispatcher::removeScrollingTreeForPage(WebPage* webPage)
{
- MutexLocker locker(m_scrollingCoordinatorsMutex);
- ASSERT(m_scrollingCoordinators.contains(webPage->pageID()));
+ MutexLocker locker(m_scrollingTreesMutex);
+ ASSERT(m_scrollingTrees.contains(webPage->pageID()));
- m_scrollingCoordinators.remove(webPage->pageID());
+ m_scrollingTrees.remove(webPage->pageID());
}
#endif
@@ -81,11 +82,11 @@
void EventDispatcher::wheelEvent(CoreIPC::Connection*, uint64_t pageID, const WebWheelEvent& wheelEvent)
{
#if ENABLE(THREADED_SCROLLING)
- MutexLocker locker(m_scrollingCoordinatorsMutex);
- if (ScrollingCoordinator* scrollingCoordinator = m_scrollingCoordinators.get(pageID).get()) {
+ MutexLocker locker(m_scrollingTreesMutex);
+ if (ScrollingTree* scrollingTree = m_scrollingTrees.get(pageID).get()) {
PlatformWheelEvent platformWheelEvent = platform(wheelEvent);
- if (scrollingCoordinator->handleWheelEvent(platformWheelEvent)) {
+ if (scrollingTree->tryToHandleWheelEvent(platformWheelEvent)) {
sendDidHandleEvent(pageID, wheelEvent);
return;
}
@@ -98,18 +99,6 @@
#if ENABLE(GESTURE_EVENTS)
void EventDispatcher::gestureEvent(CoreIPC::Connection*, uint64_t pageID, const WebGestureEvent& gestureEvent)
{
-#if ENABLE(THREADED_SCROLLING)
- MutexLocker locker(m_scrollingCoordinatorsMutex);
- if (ScrollingCoordinator* scrollingCoordinator = m_scrollingCoordinators.get(pageID).get()) {
- PlatformGestureEvent platformGestureEvent = platform(gestureEvent);
-
- if (scrollingCoordinator->handleGestureEvent(platformGestureEvent)) {
- sendDidHandleEvent(pageID, gestureEvent);
- return;
- }
- }
-#endif
-
RunLoop::main()->dispatch(bind(&EventDispatcher::dispatchGestureEvent, this, pageID, gestureEvent));
}
#endif
Modified: trunk/Source/WebKit2/WebProcess/WebPage/EventDispatcher.h (106722 => 106723)
--- trunk/Source/WebKit2/WebProcess/WebPage/EventDispatcher.h 2012-02-04 01:45:14 UTC (rev 106722)
+++ trunk/Source/WebKit2/WebProcess/WebPage/EventDispatcher.h 2012-02-04 01:56:42 UTC (rev 106723)
@@ -33,7 +33,7 @@
#include <wtf/ThreadingPrimitives.h>
namespace WebCore {
- class ScrollingCoordinator;
+ class ScrollingTree;
}
namespace WebKit {
@@ -54,8 +54,8 @@
~EventDispatcher();
#if ENABLE(THREADED_SCROLLING)
- void addScrollingCoordinatorForPage(WebPage*);
- void removeScrollingCoordinatorForPage(WebPage*);
+ void addScrollingTreeForPage(WebPage*);
+ void removeScrollingTreeForPage(WebPage*);
#endif
private:
@@ -80,8 +80,8 @@
#if ENABLE(THREADED_SCROLLING)
void sendDidHandleEvent(uint64_t pageID, const WebEvent&);
- Mutex m_scrollingCoordinatorsMutex;
- HashMap<uint64_t, RefPtr<WebCore::ScrollingCoordinator> > m_scrollingCoordinators;
+ Mutex m_scrollingTreesMutex;
+ HashMap<uint64_t, RefPtr<WebCore::ScrollingTree> > m_scrollingTrees;
#endif
};
Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm (106722 => 106723)
--- trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm 2012-02-04 01:45:14 UTC (rev 106722)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm 2012-02-04 01:56:42 UTC (rev 106723)
@@ -66,7 +66,7 @@
#if ENABLE(THREADED_SCROLLING)
page->settings()->setScrollingCoordinatorEnabled(true);
- WebProcess::shared().eventDispatcher().addScrollingCoordinatorForPage(webPage);
+ WebProcess::shared().eventDispatcher().addScrollingTreeForPage(webPage);
#endif
m_rootLayer = [CALayer layer];
@@ -88,7 +88,7 @@
TiledCoreAnimationDrawingArea::~TiledCoreAnimationDrawingArea()
{
#if ENABLE(THREADED_SCROLLING)
- WebProcess::shared().eventDispatcher().removeScrollingCoordinatorForPage(m_webPage);
+ WebProcess::shared().eventDispatcher().removeScrollingTreeForPage(m_webPage);
#endif
m_layerFlushScheduler.invalidate();