RemoteScrollingCoordinator.h [plain text]
#pragma once
#if ENABLE(ASYNC_SCROLLING)
#include "MessageReceiver.h"
#include <WebCore/AsyncScrollingCoordinator.h>
#include <WebCore/ScrollTypes.h>
#include <WebCore/ScrollingConstraints.h>
#include <WebCore/Timer.h>
namespace IPC {
class Decoder;
class Encoder;
}
namespace WebKit {
class WebPage;
class RemoteScrollingCoordinatorTransaction;
class RemoteScrollingUIState;
class RemoteScrollingCoordinator : public WebCore::AsyncScrollingCoordinator, public IPC::MessageReceiver {
public:
static Ref<RemoteScrollingCoordinator> create(WebPage* page)
{
return adoptRef(*new RemoteScrollingCoordinator(page));
}
void buildTransaction(RemoteScrollingCoordinatorTransaction&);
void scrollingStateInUIProcessChanged(const RemoteScrollingUIState&);
private:
RemoteScrollingCoordinator(WebPage*);
virtual ~RemoteScrollingCoordinator();
bool isRemoteScrollingCoordinator() const override { return true; }
bool coordinatesScrollingForFrameView(const WebCore::FrameView&) const override;
void scheduleTreeStateCommit() override;
bool isRubberBandInProgress(WebCore::ScrollingNodeID) const final;
bool isUserScrollInProgress(WebCore::ScrollingNodeID) const final;
#if ENABLE(CSS_SCROLL_SNAP)
bool isScrollSnapInProgress(WebCore::ScrollingNodeID) const final;
#endif
void setScrollPinningBehavior(WebCore::ScrollPinningBehavior) override;
void didReceiveMessage(IPC::Connection&, IPC::Decoder&) override;
void scrollPositionChangedForNode(WebCore::ScrollingNodeID, const WebCore::FloatPoint& scrollPosition, bool syncLayerPosition);
void currentSnapPointIndicesChangedForNode(WebCore::ScrollingNodeID, unsigned horizontal, unsigned vertical);
WebPage* m_webPage;
HashSet<WebCore::ScrollingNodeID> m_nodesWithActiveRubberBanding;
HashSet<WebCore::ScrollingNodeID> m_nodesWithActiveScrollSnap;
HashSet<WebCore::ScrollingNodeID> m_nodesWithActiveUserScrolls;
};
}
SPECIALIZE_TYPE_TRAITS_SCROLLING_COORDINATOR(WebKit::RemoteScrollingCoordinator, isRemoteScrollingCoordinator());
#endif // ENABLE(ASYNC_SCROLLING)