Changeset 169409 in webkit


Ignore:
Timestamp:
May 27, 2014 9:44:51 PM (10 years ago)
Author:
Simon Fraser
Message:

Instantiate a ScrollingTreeMac on Mac
https://bugs.webkit.org/show_bug.cgi?id=133332

Reviewed by Tim Horton.

Mac previously instantiated a ThreadedScrollingTree, but this has no platform
knowledge. To support future expansion, create a ScrollingTreeMac subclass and
instantiate that on Mac.

Also protect ScrollingCoordinatorMac in PLATFORM(MAC) #ifdefs and remove it from the
EXCLUDED_SOURCE_FILE_NAMES list in the xcconfig file, following general trends.

  • Configurations/WebCore.xcconfig:
  • WebCore.xcodeproj/project.pbxproj:
  • page/scrolling/ThreadedScrollingTree.cpp:

(WebCore::ThreadedScrollingTree::create): Deleted.

  • page/scrolling/ThreadedScrollingTree.h:
  • page/scrolling/mac/ScrollingCoordinatorMac.h:
  • page/scrolling/mac/ScrollingCoordinatorMac.mm:

(WebCore::ScrollingCoordinatorMac::ScrollingCoordinatorMac):

  • page/scrolling/mac/ScrollingTreeMac.cpp: Copied from Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.h.

(ScrollingTreeMac::create):
(ScrollingTreeMac::ScrollingTreeMac):

  • page/scrolling/mac/ScrollingTreeMac.h: Copied from Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.h.
Location:
trunk/Source/WebCore
Files:
7 edited
2 copied

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r169408 r169409  
     12014-05-27  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Instantiate a ScrollingTreeMac on Mac
     4        https://bugs.webkit.org/show_bug.cgi?id=133332
     5
     6        Reviewed by Tim Horton.
     7
     8        Mac previously instantiated a ThreadedScrollingTree, but this has no platform
     9        knowledge. To support future expansion, create a ScrollingTreeMac subclass and
     10        instantiate that on Mac.
     11       
     12        Also protect ScrollingCoordinatorMac in PLATFORM(MAC) #ifdefs and remove it from the
     13        EXCLUDED_SOURCE_FILE_NAMES list in the xcconfig file, following general trends.
     14
     15        * Configurations/WebCore.xcconfig:
     16        * WebCore.xcodeproj/project.pbxproj:
     17        * page/scrolling/ThreadedScrollingTree.cpp:
     18        (WebCore::ThreadedScrollingTree::create): Deleted.
     19        * page/scrolling/ThreadedScrollingTree.h:
     20        * page/scrolling/mac/ScrollingCoordinatorMac.h:
     21        * page/scrolling/mac/ScrollingCoordinatorMac.mm:
     22        (WebCore::ScrollingCoordinatorMac::ScrollingCoordinatorMac):
     23        * page/scrolling/mac/ScrollingTreeMac.cpp: Copied from Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.h.
     24        (ScrollingTreeMac::create):
     25        (ScrollingTreeMac::ScrollingTreeMac):
     26        * page/scrolling/mac/ScrollingTreeMac.h: Copied from Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.h.
     27
    1282014-05-27  Simon Fraser  <simon.fraser@apple.com>
    229
  • trunk/Source/WebCore/Configurations/WebCore.xcconfig

    r169395 r169409  
    113113
    114114EXCLUDED_SOURCE_FILE_NAMES = $(EXCLUDED_SOURCE_FILE_NAMES_$(PLATFORM_NAME));
    115 EXCLUDED_SOURCE_FILE_NAMES_iphoneos = *.tiff *Cursor.png AccessibilityObjectMac.mm AXObjectCacheMac.mm ColorMac.mm Cursor.cpp CursorMac.mm DataTransferMac.mm EditorMac.mm EventHandlerMac.mm EventLoopMac.mm GeolocationServiceMac.mm GraphicsContext3DOpenGLES.cpp IconDatabase.cpp IconMac.mm KillRingMac.mm LocalCurrentGraphicsContext.mm MIMETypeRegistryMac.mm MediaPlayerPrivateQTKit.mm NSScrollerImpDetails.mm NetworkStateNotifierMac.cpp PasteboardMac.mm PlatformEventFactoryMac.mm PlatformMouseEventMac.mm PlatformPasteboardMac.mm PlatformScreenMac.mm PlatformSpeechSynthesizerMac.mm PluginMainThreadScheduler.cpp RunLoopMac.mm SSLKeyGeneratorMac.cpp ScrollingCoordinatorMac.mm ScrollViewMac.mm ScrollbarThemeMac.mm SharedTimerMac.mm SoundMac.mm SystemTimeMac.cpp ThemeMac.mm ThreadCheck.mm UserAgentMac.mm WebAccessibilityObjectWrapperMac.mm WebCoreSystemInterface.mm WebCoreURLResponse.mm WebCoreView.m WebFontCache.mm WebVideoFullscreenController.mm WebVideoFullscreenHUDWindowController.mm WebWindowAnimation.mm WidgetMac.mm DisplayRefreshMonitorMac.cpp;
     115EXCLUDED_SOURCE_FILE_NAMES_iphoneos = *.tiff *Cursor.png AccessibilityObjectMac.mm AXObjectCacheMac.mm ColorMac.mm Cursor.cpp CursorMac.mm DataTransferMac.mm EditorMac.mm EventHandlerMac.mm EventLoopMac.mm GeolocationServiceMac.mm GraphicsContext3DOpenGLES.cpp IconDatabase.cpp IconMac.mm KillRingMac.mm LocalCurrentGraphicsContext.mm MIMETypeRegistryMac.mm MediaPlayerPrivateQTKit.mm NSScrollerImpDetails.mm NetworkStateNotifierMac.cpp PasteboardMac.mm PlatformEventFactoryMac.mm PlatformMouseEventMac.mm PlatformPasteboardMac.mm PlatformScreenMac.mm PlatformSpeechSynthesizerMac.mm PluginMainThreadScheduler.cpp RunLoopMac.mm SSLKeyGeneratorMac.cpp ScrollViewMac.mm ScrollbarThemeMac.mm SharedTimerMac.mm SoundMac.mm SystemTimeMac.cpp ThemeMac.mm ThreadCheck.mm UserAgentMac.mm WebAccessibilityObjectWrapperMac.mm WebCoreSystemInterface.mm WebCoreURLResponse.mm WebCoreView.m WebFontCache.mm WebVideoFullscreenController.mm WebVideoFullscreenHUDWindowController.mm WebWindowAnimation.mm WidgetMac.mm DisplayRefreshMonitorMac.cpp;
    116116EXCLUDED_SOURCE_FILE_NAMES_iphonesimulator = $(EXCLUDED_SOURCE_FILE_NAMES_iphoneos);
    117117EXCLUDED_SOURCE_FILE_NAMES_macosx = *IOS.h *IOS.cpp *IOS.mm JSTouch* JSGesture* DOMGesture* DOMTouch* KillRingNone.cpp WAKAppKitStubs.h WAKClipView.h WAKResponder.h WAKScrollView.h WAKView.h WAKViewPrivate.h WAKWindow.h WKContentObservation.h WKGraphics.h WKTypes.h WKUtilities.h WKView.h WKViewPrivate.h WebCoreThread.h WebCoreThreadMessage.h WebCoreThreadRun.h WebCoreThreadSystemInterface.h;
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r169299 r169409  
    555555                0FDA7C261883333200C954B5 /* JSWebKitPlaybackTargetAvailabilityEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FDA7C241883333200C954B5 /* JSWebKitPlaybackTargetAvailabilityEvent.cpp */; };
    556556                0FDA7C271883333200C954B5 /* JSWebKitPlaybackTargetAvailabilityEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FDA7C251883333200C954B5 /* JSWebKitPlaybackTargetAvailabilityEvent.h */; };
     557                0FE5806319327A6200DE32EB /* ScrollingTreeMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FE5806119327A6200DE32EB /* ScrollingTreeMac.cpp */; };
     558                0FE5806419327A6200DE32EB /* ScrollingTreeMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FE5806219327A6200DE32EB /* ScrollingTreeMac.h */; };
    557559                0FE71405142170B800DB33BA /* ScrollbarThemeMock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FE71403142170B800DB33BA /* ScrollbarThemeMock.cpp */; };
    558560                0FE71406142170B800DB33BA /* ScrollbarThemeMock.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FE71404142170B800DB33BA /* ScrollbarThemeMock.h */; };
     
    74437445                0FDA7C241883333200C954B5 /* JSWebKitPlaybackTargetAvailabilityEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebKitPlaybackTargetAvailabilityEvent.cpp; sourceTree = "<group>"; };
    74447446                0FDA7C251883333200C954B5 /* JSWebKitPlaybackTargetAvailabilityEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWebKitPlaybackTargetAvailabilityEvent.h; sourceTree = "<group>"; };
     7447                0FE5806119327A6200DE32EB /* ScrollingTreeMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScrollingTreeMac.cpp; sourceTree = "<group>"; };
     7448                0FE5806219327A6200DE32EB /* ScrollingTreeMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollingTreeMac.h; sourceTree = "<group>"; };
    74457449                0FE71403142170B800DB33BA /* ScrollbarThemeMock.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScrollbarThemeMock.cpp; sourceTree = "<group>"; };
    74467450                0FE71404142170B800DB33BA /* ScrollbarThemeMock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollbarThemeMock.h; sourceTree = "<group>"; };
     
    1505715061                                93C4A4131629DF5A00C3EB6E /* ScrollingTreeFrameScrollingNodeMac.h */,
    1505815062                                93C4A4141629DF5A00C3EB6E /* ScrollingTreeFrameScrollingNodeMac.mm */,
     15063                                0FE5806219327A6200DE32EB /* ScrollingTreeMac.h */,
     15064                                0FE5806119327A6200DE32EB /* ScrollingTreeMac.cpp */,
    1505915065                                0FB88908167D2FA10010CDA5 /* ScrollingTreeStickyNode.h */,
    1506015066                                0FB88909167D2FA10010CDA5 /* ScrollingTreeStickyNode.mm */,
     
    2646226468                                0B9056F90F2685F30095FF6A /* WorkerThreadableLoader.h in Headers */,
    2646326469                                97AABD2D14FA09D5007457AE /* WorkerThreadableWebSocketChannel.h in Headers */,
     26470                                0FE5806419327A6200DE32EB /* ScrollingTreeMac.h in Headers */,
    2646426471                                93309E24099E64920056E581 /* WrapContentsInDummySpanCommand.h in Headers */,
    2646526472                                9BAF3B2412C1A39800014BF1 /* WritingDirection.h in Headers */,
     
    2766827675                                A81369CD097374F600D74463 /* HTMLInputElement.cpp in Sources */,
    2766927676                                93309DE5099E64920056E581 /* HTMLInterchange.cpp in Sources */,
     27677                                0FE5806319327A6200DE32EB /* ScrollingTreeMac.cpp in Sources */,
    2767027678                                A81369E5097374F600D74463 /* HTMLKeygenElement.cpp in Sources */,
    2767127679                                A81369E3097374F600D74463 /* HTMLLabelElement.cpp in Sources */,
  • trunk/Source/WebCore/page/scrolling/ThreadedScrollingTree.cpp

    r164358 r169409  
    4040
    4141namespace WebCore {
    42 
    43 RefPtr<ThreadedScrollingTree> ThreadedScrollingTree::create(AsyncScrollingCoordinator* scrollingCoordinator)
    44 {
    45     return adoptRef(new ThreadedScrollingTree(scrollingCoordinator));
    46 }
    4742
    4843ThreadedScrollingTree::ThreadedScrollingTree(AsyncScrollingCoordinator* scrollingCoordinator)
  • trunk/Source/WebCore/page/scrolling/ThreadedScrollingTree.h

    r164358 r169409  
    4444class ThreadedScrollingTree : public ScrollingTree {
    4545public:
    46     static RefPtr<ThreadedScrollingTree> create(AsyncScrollingCoordinator*);
    47 
    4846    virtual ~ThreadedScrollingTree();
    4947
     
    5957    virtual void invalidate() override;
    6058
    61 private:
     59protected:
    6260    explicit ThreadedScrollingTree(AsyncScrollingCoordinator*);
    63     virtual bool isThreadedScrollingTree() const override { return true; }
    6461
    6562    virtual PassOwnPtr<ScrollingTreeNode> createNode(ScrollingNodeType, ScrollingNodeID) override;
     
    6966    virtual void handleWheelEventPhase(PlatformWheelEventPhase) override;
    7067#endif
     68
     69private:
     70    virtual bool isThreadedScrollingTree() const override { return true; }
    7171
    7272    RefPtr<AsyncScrollingCoordinator> m_scrollingCoordinator;
  • trunk/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.h

    r162139 r169409  
    2727#define ScrollingCoordinatorMac_h
    2828
    29 #if ENABLE(ASYNC_SCROLLING)
     29#if ENABLE(ASYNC_SCROLLING) && PLATFORM(MAC)
    3030
    3131#include "AsyncScrollingCoordinator.h"
     
    6565} // namespace WebCore
    6666
    67 #endif // ENABLE(ASYNC_SCROLLING)
     67#endif // ENABLE(ASYNC_SCROLLING) && PLATFORM(MAC)
    6868
    6969#endif // ScrollingCoordinatorMac_h
  • trunk/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.mm

    r169063 r169409  
    2626#include "config.h"
    2727
    28 #if ENABLE(ASYNC_SCROLLING)
     28#if ENABLE(ASYNC_SCROLLING) && PLATFORM(MAC)
    2929
    3030#import "ScrollingCoordinatorMac.h"
     
    3939#include "ScrollingTreeFixedNode.h"
    4040#include "ScrollingTreeFrameScrollingNodeMac.h"
     41#include "ScrollingTreeMac.h"
    4142#include "ScrollingTreeStickyNode.h"
    42 #include "ThreadedScrollingTree.h"
    4343#include "TiledBacking.h"
    4444#include <wtf/Functional.h>
     
    5757    , m_scrollingStateTreeCommitterTimer(this, &ScrollingCoordinatorMac::scrollingStateTreeCommitterTimerFired)
    5858{
    59     setScrollingTree(ThreadedScrollingTree::create(this));
     59    setScrollingTree(ScrollingTreeMac::create(this));
    6060}
    6161
     
    163163} // namespace WebCore
    164164
    165 #endif // ENABLE(ASYNC_SCROLLING)
     165#endif // ENABLE(ASYNC_SCROLLING) && PLATFORM(MAC)
  • trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeMac.cpp

    r169408 r169409  
    11/*
    2  * Copyright (C) 2012 Apple Inc. All rights reserved.
     2 * Copyright (C) 2014 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2424 */
    2525
    26 #ifndef ScrollingCoordinatorMac_h
    27 #define ScrollingCoordinatorMac_h
     26#include "config.h"
     27#include "ScrollingTreeMac.h"
    2828
    29 #if ENABLE(ASYNC_SCROLLING)
     29#if ENABLE(ASYNC_SCROLLING) && PLATFORM(MAC)
    3030
    31 #include "AsyncScrollingCoordinator.h"
     31using namespace WebCore;
    3232
    33 namespace WebCore {
     33RefPtr<ScrollingTreeMac> ScrollingTreeMac::create(AsyncScrollingCoordinator* scrollingCoordinator)
     34{
     35    return adoptRef(new ScrollingTreeMac(scrollingCoordinator));
     36}
    3437
    35 class Scrollbar;
    36 class ScrollingStateNode;
    37 class ScrollingStateScrollingNode;
    38 class ScrollingStateTree;
    39 class ThreadedScrollingTree;
     38ScrollingTreeMac::ScrollingTreeMac(AsyncScrollingCoordinator* scrollingCoordinator)
     39    : ThreadedScrollingTree(scrollingCoordinator)
     40{
     41}
    4042
    41 class ScrollingCoordinatorMac : public AsyncScrollingCoordinator {
    42 public:
    43     explicit ScrollingCoordinatorMac(Page*);
    44     virtual ~ScrollingCoordinatorMac();
    45 
    46     virtual void pageDestroyed();
    47 
    48     virtual void commitTreeStateIfNeeded() override;
    49 
    50     // Handle the wheel event on the scrolling thread. Returns whether the event was handled or not.
    51     virtual bool handleWheelEvent(FrameView*, const PlatformWheelEvent&) override;
    52 
    53 private:
    54     virtual PassOwnPtr<ScrollingTreeNode> createScrollingTreeNode(ScrollingNodeType, ScrollingNodeID) override;
    55     virtual void scheduleTreeStateCommit() override;
    56 
    57     void scrollingStateTreeCommitterTimerFired(Timer<ScrollingCoordinatorMac>*);
    58     void commitTreeState();
    59    
    60     void updateTiledScrollingIndicator();
    61 
    62     Timer<ScrollingCoordinatorMac> m_scrollingStateTreeCommitterTimer;
    63 };
    64 
    65 } // namespace WebCore
    66 
    67 #endif // ENABLE(ASYNC_SCROLLING)
    68 
    69 #endif // ScrollingCoordinatorMac_h
     43#endif // ENABLE(ASYNC_SCROLLING) && PLATFORM(MAC)
  • trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeMac.h

    r169408 r169409  
    11/*
    2  * Copyright (C) 2012 Apple Inc. All rights reserved.
     2 * Copyright (C) 2014 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2424 */
    2525
    26 #ifndef ScrollingCoordinatorMac_h
    27 #define ScrollingCoordinatorMac_h
     26#ifndef ScrollingTreeMac_h
     27#define ScrollingTreeMac_h
    2828
    29 #if ENABLE(ASYNC_SCROLLING)
     29#if ENABLE(ASYNC_SCROLLING) && PLATFORM(MAC)
    3030
    31 #include "AsyncScrollingCoordinator.h"
     31#include "ThreadedScrollingTree.h"
    3232
    3333namespace WebCore {
    3434
    35 class Scrollbar;
    36 class ScrollingStateNode;
    37 class ScrollingStateScrollingNode;
    38 class ScrollingStateTree;
    39 class ThreadedScrollingTree;
    40 
    41 class ScrollingCoordinatorMac : public AsyncScrollingCoordinator {
     35class ScrollingTreeMac : public ThreadedScrollingTree {
    4236public:
    43     explicit ScrollingCoordinatorMac(Page*);
    44     virtual ~ScrollingCoordinatorMac();
    45 
    46     virtual void pageDestroyed();
    47 
    48     virtual void commitTreeStateIfNeeded() override;
    49 
    50     // Handle the wheel event on the scrolling thread. Returns whether the event was handled or not.
    51     virtual bool handleWheelEvent(FrameView*, const PlatformWheelEvent&) override;
    52 
     37    static RefPtr<ScrollingTreeMac> create(AsyncScrollingCoordinator*);
     38   
    5339private:
    54     virtual PassOwnPtr<ScrollingTreeNode> createScrollingTreeNode(ScrollingNodeType, ScrollingNodeID) override;
    55     virtual void scheduleTreeStateCommit() override;
    56 
    57     void scrollingStateTreeCommitterTimerFired(Timer<ScrollingCoordinatorMac>*);
    58     void commitTreeState();
    59    
    60     void updateTiledScrollingIndicator();
    61 
    62     Timer<ScrollingCoordinatorMac> m_scrollingStateTreeCommitterTimer;
     40    explicit ScrollingTreeMac(AsyncScrollingCoordinator*);
    6341};
    6442
    6543} // namespace WebCore
    6644
    67 #endif // ENABLE(ASYNC_SCROLLING)
     45#endif // ENABLE(ASYNC_SCROLLING) && PLATFORM(MAC)
    6846
    69 #endif // ScrollingCoordinatorMac_h
     47#endif // ScrollingTreeMac_h
Note: See TracChangeset for help on using the changeset viewer.