Skip to content

Commit

Permalink
RemoteLayerTreeDrawingAreaProxy::hideContentUntilPendingUpdate on a p…
Browse files Browse the repository at this point in the history
…rovisional DrawingAreaProxy can hide the page forever.

https://bugs.webkit.org/show_bug.cgi?id=265404
<rdar://118700595>

Reviewed by Chris Dumez.

DrawingAreaProxy always accesses the WebPageProxy to use its process' connection to send messages.
If the DrawingAreaProxy was created for a ProvisionalPageProxy, then this isn't the right connection.

The result is that a DispatchAfterEnsuringDrawing message can be sent to the wrong process, and we'll end up
hiding the layer tree indefinitely (even after the provisional page has been committed).

This change stores the right WebProcessProxy on DrawingAreaProxy, and changes all message sending to
go through that. It also implements IPC::MessageSender on DrawingAreaProxy to make this simpler.

* Source/WebKit/UIProcess/API/gtk/PageClientImpl.cpp:
(WebKit::PageClientImpl::createDrawingAreaProxy):
* Source/WebKit/UIProcess/API/gtk/PageClientImpl.h:
* Source/WebKit/UIProcess/API/wpe/PageClientImpl.cpp:
(WebKit::PageClientImpl::createDrawingAreaProxy):
* Source/WebKit/UIProcess/API/wpe/PageClientImpl.h:
* Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp:
(WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingAreaProxyCoordinatedGraphics):
(WebKit::DrawingAreaProxyCoordinatedGraphics::forceUpdateIfNeeded):
(WebKit::DrawingAreaProxyCoordinatedGraphics::deviceScaleFactorDidChange):
(WebKit::DrawingAreaProxyCoordinatedGraphics::adjustTransientZoom):
(WebKit::DrawingAreaProxyCoordinatedGraphics::commitTransientZoom):
(WebKit::DrawingAreaProxyCoordinatedGraphics::update):
(WebKit::DrawingAreaProxyCoordinatedGraphics::sendUpdateGeometry):
(WebKit::DrawingAreaProxyCoordinatedGraphics::discardBackingStore):
* Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.h:
* Source/WebKit/UIProcess/DrawingAreaProxy.cpp:
(WebKit::DrawingAreaProxy::DrawingAreaProxy):
(WebKit::DrawingAreaProxy::messageSenderConnection const):
(WebKit::DrawingAreaProxy::messageSenderDestinationID const):
(WebKit::DrawingAreaProxy::viewExposedRectChangedTimerFired):
* Source/WebKit/UIProcess/DrawingAreaProxy.h:
* Source/WebKit/UIProcess/PageClient.h:
* Source/WebKit/UIProcess/ProvisionalPageProxy.cpp:
(WebKit::ProvisionalPageProxy::initializeWebPage):
* Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h:
* Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy):
(WebKit::RemoteLayerTreeDrawingAreaProxy::deviceScaleFactorDidChange):
(WebKit::RemoteLayerTreeDrawingAreaProxy::sendUpdateGeometry):
(WebKit::RemoteLayerTreeDrawingAreaProxy::processStateForConnection):
(WebKit::RemoteLayerTreeDrawingAreaProxy::acceleratedAnimationDidStart):
(WebKit::RemoteLayerTreeDrawingAreaProxy::acceleratedAnimationDidEnd):
(WebKit::RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay):
(WebKit::RemoteLayerTreeDrawingAreaProxy::hideContentUntilPendingUpdate):
* Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteLayerTreeDrawingAreaProxyIOS.h:
* Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteLayerTreeDrawingAreaProxyIOS.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxyIOS::RemoteLayerTreeDrawingAreaProxyIOS):
* Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteLayerTreeDrawingAreaProxyMac.h:
* Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteLayerTreeDrawingAreaProxyMac.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxyMac::RemoteLayerTreeDrawingAreaProxyMac):
(WebKit::RemoteLayerTreeDrawingAreaProxyMac::adjustTransientZoom):
(WebKit::RemoteLayerTreeDrawingAreaProxyMac::commitTransientZoom):
(WebKit::RemoteLayerTreeDrawingAreaProxyMac::colorSpaceDidChange):
(WebKit::RemoteLayerTreeDrawingAreaProxyMac::createFence):
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::initializeWebPage):
* Source/WebKit/UIProcess/ios/PageClientImplIOS.h:
* Source/WebKit/UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::createDrawingAreaProxy):
* Source/WebKit/UIProcess/ios/WKContentView.h:
* Source/WebKit/UIProcess/ios/WKContentView.mm:
(-[WKContentView _createDrawingAreaProxy:]):
(-[WKContentView _createDrawingAreaProxy]): Deleted.
* Source/WebKit/UIProcess/mac/PageClientImplMac.h:
* Source/WebKit/UIProcess/mac/PageClientImplMac.mm:
(WebKit::PageClientImpl::createDrawingAreaProxy):
* Source/WebKit/UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
* Source/WebKit/UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
(WebKit::TiledCoreAnimationDrawingAreaProxy::TiledCoreAnimationDrawingAreaProxy):
(WebKit::TiledCoreAnimationDrawingAreaProxy::deviceScaleFactorDidChange):
(WebKit::TiledCoreAnimationDrawingAreaProxy::colorSpaceDidChange):
(WebKit::TiledCoreAnimationDrawingAreaProxy::createFence):
(WebKit::TiledCoreAnimationDrawingAreaProxy::sendUpdateGeometry):
(WebKit::TiledCoreAnimationDrawingAreaProxy::adjustTransientZoom):
(WebKit::TiledCoreAnimationDrawingAreaProxy::commitTransientZoom):
(WebKit::TiledCoreAnimationDrawingAreaProxy::displayNominalFramesPerSecond):
* Source/WebKit/UIProcess/mac/WebViewImpl.h:
* Source/WebKit/UIProcess/mac/WebViewImpl.mm:
(WebKit::WebViewImpl::createDrawingAreaProxy):
* Source/WebKit/UIProcess/playstation/PageClientImpl.cpp:
(WebKit::PageClientImpl::createDrawingAreaProxy):
* Source/WebKit/UIProcess/playstation/PageClientImpl.h:
* Source/WebKit/UIProcess/wc/DrawingAreaProxyWC.cpp:
(WebKit::DrawingAreaProxyWC::DrawingAreaProxyWC):
(WebKit::DrawingAreaProxyWC::sizeDidChange):
(WebKit::DrawingAreaProxyWC::update):
* Source/WebKit/UIProcess/wc/DrawingAreaProxyWC.h:
* Source/WebKit/UIProcess/win/PageClientImpl.cpp:
(WebKit::PageClientImpl::createDrawingAreaProxy):
* Source/WebKit/UIProcess/win/PageClientImpl.h:

Canonical link: https://commits.webkit.org/271260@main
  • Loading branch information
mattwoodrow committed Nov 29, 2023
1 parent b3a279c commit 7445f27
Show file tree
Hide file tree
Showing 33 changed files with 128 additions and 109 deletions.
4 changes: 2 additions & 2 deletions Source/WebKit/UIProcess/API/gtk/PageClientImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ PageClientImpl::PageClientImpl(GtkWidget* viewWidget)
}

// PageClient's pure virtual functions
std::unique_ptr<DrawingAreaProxy> PageClientImpl::createDrawingAreaProxy()
std::unique_ptr<DrawingAreaProxy> PageClientImpl::createDrawingAreaProxy(WebProcessProxy& webProcessProxy)
{
return makeUnique<DrawingAreaProxyCoordinatedGraphics>(*webkitWebViewBaseGetPage(WEBKIT_WEB_VIEW_BASE(m_viewWidget)));
return makeUnique<DrawingAreaProxyCoordinatedGraphics>(*webkitWebViewBaseGetPage(WEBKIT_WEB_VIEW_BASE(m_viewWidget)), webProcessProxy);
}

void PageClientImpl::setViewNeedsDisplay(const WebCore::Region& region)
Expand Down
2 changes: 1 addition & 1 deletion Source/WebKit/UIProcess/API/gtk/PageClientImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class PageClientImpl : public PageClient

private:
// PageClient
std::unique_ptr<DrawingAreaProxy> createDrawingAreaProxy() override;
std::unique_ptr<DrawingAreaProxy> createDrawingAreaProxy(WebProcessProxy&) override;
void setViewNeedsDisplay(const WebCore::Region&) override;
void requestScroll(const WebCore::FloatPoint& scrollPosition, const WebCore::IntPoint& scrollOrigin, WebCore::ScrollIsAnimated) override;
void requestScrollToRect(const WebCore::FloatRect& targetRect, const WebCore::FloatPoint& origin) override;
Expand Down
4 changes: 2 additions & 2 deletions Source/WebKit/UIProcess/API/wpe/PageClientImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ UnixFileDescriptor PageClientImpl::hostFileDescriptor()
return UnixFileDescriptor { wpe_view_backend_get_renderer_host_fd(m_view.backend()), UnixFileDescriptor::Adopt };
}

std::unique_ptr<DrawingAreaProxy> PageClientImpl::createDrawingAreaProxy()
std::unique_ptr<DrawingAreaProxy> PageClientImpl::createDrawingAreaProxy(WebProcessProxy& webProcessProxy)
{
return makeUnique<DrawingAreaProxyCoordinatedGraphics>(m_view.page());
return makeUnique<DrawingAreaProxyCoordinatedGraphics>(m_view.page(), webProcessProxy);
}

void PageClientImpl::setViewNeedsDisplay(const WebCore::Region&)
Expand Down
2 changes: 1 addition & 1 deletion Source/WebKit/UIProcess/API/wpe/PageClientImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class PageClientImpl final : public PageClient

private:
// PageClient
std::unique_ptr<DrawingAreaProxy> createDrawingAreaProxy() override;
std::unique_ptr<DrawingAreaProxy> createDrawingAreaProxy(WebProcessProxy&) override;
void setViewNeedsDisplay(const WebCore::Region&) override;
void requestScroll(const WebCore::FloatPoint&, const WebCore::IntPoint&, WebCore::ScrollIsAnimated) override;
WebCore::FloatPoint viewScrollPosition() override;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@
namespace WebKit {
using namespace WebCore;

DrawingAreaProxyCoordinatedGraphics::DrawingAreaProxyCoordinatedGraphics(WebPageProxy& webPageProxy)
: DrawingAreaProxy(DrawingAreaType::CoordinatedGraphics, webPageProxy)
DrawingAreaProxyCoordinatedGraphics::DrawingAreaProxyCoordinatedGraphics(WebPageProxy& webPageProxy, WebProcessProxy& webProcessProxy)
: DrawingAreaProxy(DrawingAreaType::CoordinatedGraphics, webPageProxy, webProcessProxy)
#if !PLATFORM(WPE)
, m_discardBackingStoreTimer(RunLoop::current(), this, &DrawingAreaProxyCoordinatedGraphics::discardBackingStore)
#endif
Expand Down Expand Up @@ -94,22 +94,21 @@ bool DrawingAreaProxyCoordinatedGraphics::forceUpdateIfNeeded()
{
ASSERT(!isInAcceleratedCompositingMode());

auto webPageProxy = protectedWebPageProxy();
if (!webPageProxy->hasRunningProcess())
if (!m_webProcessProxy->hasConnection())
return false;

if (webPageProxy->process().state() == WebProcessProxy::State::Launching)
if (m_webProcessProxy->state() == WebProcessProxy::State::Launching)
return false;

if (m_isWaitingForDidUpdateGeometry)
return false;

if (!webPageProxy->isViewVisible())
if (!protectedWebPageProxy()->isViewVisible())
return false;

SetForScope inForceUpdate(m_inForceUpdate, true);
webPageProxy->send(Messages::DrawingArea::ForceUpdate(), m_identifier);
webPageProxy->process().connection()->waitForAndDispatchImmediately<Messages::DrawingAreaProxy::Update>(m_identifier, Seconds::fromMilliseconds(500));
send(Messages::DrawingArea::ForceUpdate());
m_webProcessProxy->connection()->waitForAndDispatchImmediately<Messages::DrawingAreaProxy::Update>(m_identifier, 500_ms);
return !!m_backingStore;
}

Expand Down Expand Up @@ -162,7 +161,7 @@ void DrawingAreaProxyCoordinatedGraphics::sizeDidChange()

void DrawingAreaProxyCoordinatedGraphics::deviceScaleFactorDidChange()
{
protectedWebPageProxy()->send(Messages::DrawingArea::SetDeviceScaleFactor(m_webPageProxy->deviceScaleFactor()), m_identifier);
send(Messages::DrawingArea::SetDeviceScaleFactor(m_webPageProxy->deviceScaleFactor()));
}

void DrawingAreaProxyCoordinatedGraphics::setBackingStoreIsDiscardable(bool isBackingStoreDiscardable)
Expand All @@ -182,19 +181,19 @@ void DrawingAreaProxyCoordinatedGraphics::setBackingStoreIsDiscardable(bool isBa
#if PLATFORM(GTK)
void DrawingAreaProxyCoordinatedGraphics::adjustTransientZoom(double scale, FloatPoint origin)
{
protectedWebPageProxy()->send(Messages::DrawingArea::AdjustTransientZoom(scale, origin), m_identifier);
send(Messages::DrawingArea::AdjustTransientZoom(scale, origin));
}

void DrawingAreaProxyCoordinatedGraphics::commitTransientZoom(double scale, FloatPoint origin)
{
protectedWebPageProxy()->send(Messages::DrawingArea::CommitTransientZoom(scale, origin), m_identifier);
send(Messages::DrawingArea::CommitTransientZoom(scale, origin));
}
#endif

void DrawingAreaProxyCoordinatedGraphics::update(uint64_t, UpdateInfo&& updateInfo)
{
if (m_isWaitingForDidUpdateGeometry && updateInfo.viewSize != m_lastSentSize) {
protectedWebPageProxy()->send(Messages::DrawingArea::DisplayDidRefresh(), m_identifier);
send(Messages::DrawingArea::DisplayDidRefresh());
return;
}

Expand All @@ -205,7 +204,7 @@ void DrawingAreaProxyCoordinatedGraphics::update(uint64_t, UpdateInfo&& updateIn
#endif

if (!m_isWaitingForDidUpdateGeometry)
protectedWebPageProxy()->send(Messages::DrawingArea::DisplayDidRefresh(), m_identifier);
send(Messages::DrawingArea::DisplayDidRefresh());
}

void DrawingAreaProxyCoordinatedGraphics::enterAcceleratedCompositingMode(uint64_t, const LayerTreeContext& layerTreeContext)
Expand Down Expand Up @@ -263,11 +262,11 @@ void DrawingAreaProxyCoordinatedGraphics::sendUpdateGeometry()
m_lastSentSize = m_size;
m_isWaitingForDidUpdateGeometry = true;

protectedWebPageProxy()->sendWithAsyncReply(Messages::DrawingArea::UpdateGeometry(m_size), [weakThis = WeakPtr { *this }] {
sendWithAsyncReply(Messages::DrawingArea::UpdateGeometry(m_size), [weakThis = WeakPtr { *this }] {
if (!weakThis)
return;
weakThis->didUpdateGeometry();
}, m_identifier);
});
}

void DrawingAreaProxyCoordinatedGraphics::didUpdateGeometry()
Expand Down Expand Up @@ -301,7 +300,7 @@ void DrawingAreaProxyCoordinatedGraphics::discardBackingStore()
return;

m_backingStore = nullptr;
protectedWebPageProxy()->send(Messages::DrawingArea::DidDiscardBackingStore(), m_identifier);
send(Messages::DrawingArea::DidDiscardBackingStore());
}
#endif

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class BackingStore;

class DrawingAreaProxyCoordinatedGraphics final : public DrawingAreaProxy {
public:
DrawingAreaProxyCoordinatedGraphics(WebPageProxy&);
DrawingAreaProxyCoordinatedGraphics(WebPageProxy&, WebProcessProxy&);
virtual ~DrawingAreaProxyCoordinatedGraphics();

#if !PLATFORM(WPE)
Expand Down
25 changes: 23 additions & 2 deletions Source/WebKit/UIProcess/DrawingAreaProxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,11 @@
namespace WebKit {
using namespace WebCore;

DrawingAreaProxy::DrawingAreaProxy(DrawingAreaType type, WebPageProxy& webPageProxy)
DrawingAreaProxy::DrawingAreaProxy(DrawingAreaType type, WebPageProxy& webPageProxy, WebProcessProxy& webProcessProxy)
: m_type(type)
, m_identifier(DrawingAreaIdentifier::generate())
, m_webPageProxy(webPageProxy)
, m_webProcessProxy(webProcessProxy)
, m_size(webPageProxy.viewSize())
#if PLATFORM(MAC)
, m_viewExposedRectChangedTimer(RunLoop::main(), this, &DrawingAreaProxy::viewExposedRectChangedTimerFired)
Expand Down Expand Up @@ -76,6 +77,26 @@ std::span<IPC::ReceiverName> DrawingAreaProxy::messageReceiverNames() const
return { name };
}

IPC::Connection* DrawingAreaProxy::messageSenderConnection() const
{
return m_webProcessProxy->connection();
}

bool DrawingAreaProxy::sendMessage(UniqueRef<IPC::Encoder>&& encoder, OptionSet<IPC::SendOption> sendOptions)
{
return m_webProcessProxy->sendMessage(WTFMove(encoder), sendOptions);
}

bool DrawingAreaProxy::sendMessageWithAsyncReply(UniqueRef<IPC::Encoder>&& encoder, AsyncReplyHandler handler, OptionSet<IPC::SendOption> sendOptions)
{
return m_webProcessProxy->sendMessage(WTFMove(encoder), sendOptions, WTFMove(handler));
}

uint64_t DrawingAreaProxy::messageSenderDestinationID() const
{
return identifier().toUInt64();
}

DelegatedScrollingMode DrawingAreaProxy::delegatedScrollingMode() const
{
return DelegatedScrollingMode::NotDelegated;
Expand Down Expand Up @@ -118,7 +139,7 @@ void DrawingAreaProxy::viewExposedRectChangedTimerFired()
if (viewExposedRect == m_lastSentViewExposedRect)
return;

m_webPageProxy->send(Messages::DrawingArea::SetViewExposedRect(viewExposedRect), m_identifier);
send(Messages::DrawingArea::SetViewExposedRect(viewExposedRect));
m_lastSentViewExposedRect = viewExposedRect;
}
#endif // PLATFORM(MAC)
Expand Down
12 changes: 10 additions & 2 deletions Source/WebKit/UIProcess/DrawingAreaProxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "Connection.h"
#include "DrawingAreaInfo.h"
#include "MessageReceiver.h"
#include "MessageSender.h"
#include <WebCore/FloatRect.h>
#include <WebCore/IntRect.h>
#include <WebCore/IntSize.h>
Expand Down Expand Up @@ -61,7 +62,7 @@ class WebProcessProxy;
struct UpdateInfo;
#endif

class DrawingAreaProxy : public IPC::MessageReceiver {
class DrawingAreaProxy : public IPC::MessageReceiver, public IPC::MessageSender {
WTF_MAKE_FAST_ALLOCATED;
WTF_MAKE_NONCOPYABLE(DrawingAreaProxy);

Expand Down Expand Up @@ -130,17 +131,24 @@ class DrawingAreaProxy : public IPC::MessageReceiver {
// IPC::MessageReceiver
void didReceiveMessage(IPC::Connection&, IPC::Decoder&) override;

// IPC::MessageSender
bool sendMessage(UniqueRef<IPC::Encoder>&&, OptionSet<IPC::SendOption>) final;
bool sendMessageWithAsyncReply(UniqueRef<IPC::Encoder>&&, AsyncReplyHandler, OptionSet<IPC::SendOption>) final;
IPC::Connection* messageSenderConnection() const final;
uint64_t messageSenderDestinationID() const final;

virtual void addRemotePageDrawingAreaProxy(RemotePageDrawingAreaProxy&) { }
virtual void removeRemotePageDrawingAreaProxy(RemotePageDrawingAreaProxy&) { }

protected:
DrawingAreaProxy(DrawingAreaType, WebPageProxy&);
DrawingAreaProxy(DrawingAreaType, WebPageProxy&, WebProcessProxy&);

Ref<WebPageProxy> protectedWebPageProxy() const;

DrawingAreaType m_type;
DrawingAreaIdentifier m_identifier;
CheckedRef<WebPageProxy> m_webPageProxy;
Ref<WebProcessProxy> m_webProcessProxy;

WebCore::IntSize m_size;
WebCore::IntSize m_scrollOffset;
Expand Down
2 changes: 1 addition & 1 deletion Source/WebKit/UIProcess/PageClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ class PageClient : public CanMakeWeakPtr<PageClient> {
virtual ~PageClient() { }

// Create a new drawing area proxy for the given page.
virtual std::unique_ptr<DrawingAreaProxy> createDrawingAreaProxy() = 0;
virtual std::unique_ptr<DrawingAreaProxy> createDrawingAreaProxy(WebProcessProxy&) = 0;

// Tell the view to invalidate the given region. The region is in view coordinates.
virtual void setViewNeedsDisplay(const WebCore::Region&) = 0;
Expand Down
2 changes: 1 addition & 1 deletion Source/WebKit/UIProcess/ProvisionalPageProxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ void ProvisionalPageProxy::cancel()

void ProvisionalPageProxy::initializeWebPage(RefPtr<API::WebsitePolicies>&& websitePolicies)
{
m_drawingArea = m_page->pageClient().createDrawingAreaProxy();
m_drawingArea = m_page->pageClient().createDrawingAreaProxy(m_process.copyRef());

bool sendPageCreationParameters { true };
auto parameters = m_page->creationParameters(m_process, *m_drawingArea, WTFMove(websitePolicies));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class RemoteScrollingCoordinatorTransaction;

class RemoteLayerTreeDrawingAreaProxy : public DrawingAreaProxy {
public:
RemoteLayerTreeDrawingAreaProxy(WebPageProxy&);
RemoteLayerTreeDrawingAreaProxy(WebPageProxy&, WebProcessProxy&);
virtual ~RemoteLayerTreeDrawingAreaProxy();

virtual bool isRemoteLayerTreeDrawingAreaProxyMac() const { return false; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@
using namespace IPC;
using namespace WebCore;

RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy(WebPageProxy& pageProxy)
: DrawingAreaProxy(DrawingAreaType::RemoteLayerTree, pageProxy)
RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy(WebPageProxy& pageProxy, WebProcessProxy& webProcessProxy)
: DrawingAreaProxy(DrawingAreaType::RemoteLayerTree, pageProxy, webProcessProxy)
, m_remoteLayerTreeHost(makeUnique<RemoteLayerTreeHost>(*this))
{
// We don't want to pool surfaces in the UI process.
Expand Down Expand Up @@ -118,7 +118,7 @@

void RemoteLayerTreeDrawingAreaProxy::deviceScaleFactorDidChange()
{
protectedWebPageProxy()->send(Messages::DrawingArea::SetDeviceScaleFactor(m_webPageProxy->deviceScaleFactor()), m_identifier);
send(Messages::DrawingArea::SetDeviceScaleFactor(m_webPageProxy->deviceScaleFactor()));
}

void RemoteLayerTreeDrawingAreaProxy::didUpdateGeometry()
Expand All @@ -144,11 +144,11 @@
m_lastSentSizeToContentAutoSizeMaximumSize = webPageProxy->sizeToContentAutoSizeMaximumSize();
m_lastSentSize = m_size;
m_isWaitingForDidUpdateGeometry = true;
protectedWebPageProxy()->sendWithAsyncReply(Messages::DrawingArea::UpdateGeometry(m_size, false /* flushSynchronously */, MachSendRight()), [weakThis = WeakPtr { this }] {
sendWithAsyncReply(Messages::DrawingArea::UpdateGeometry(m_size, false /* flushSynchronously */, MachSendRight()), [weakThis = WeakPtr { this }] {
if (!weakThis)
return;
weakThis->didUpdateGeometry();
}, m_identifier);
});
}

RemoteLayerTreeDrawingAreaProxy::ProcessState& RemoteLayerTreeDrawingAreaProxy::processStateForConnection(IPC::Connection& connection)
Expand All @@ -158,7 +158,7 @@
return pair.value;
}

ASSERT(m_webPageProxy->process().hasConnection() && &connection == m_webPageProxy->process().connection());
ASSERT(m_webProcessProxy->hasConnection() && &connection == m_webProcessProxy->connection());
return m_webPageProxyProcessState;
}

Expand Down Expand Up @@ -335,12 +335,12 @@

void RemoteLayerTreeDrawingAreaProxy::acceleratedAnimationDidStart(WebCore::PlatformLayerIdentifier layerID, const String& key, MonotonicTime startTime)
{
protectedWebPageProxy()->send(Messages::DrawingArea::AcceleratedAnimationDidStart(layerID, key, startTime), m_identifier);
send(Messages::DrawingArea::AcceleratedAnimationDidStart(layerID, key, startTime));
}

void RemoteLayerTreeDrawingAreaProxy::acceleratedAnimationDidEnd(WebCore::PlatformLayerIdentifier layerID, const String& key)
{
protectedWebPageProxy()->send(Messages::DrawingArea::AcceleratedAnimationDidEnd(layerID, key), m_identifier);
send(Messages::DrawingArea::AcceleratedAnimationDidEnd(layerID, key));
}

static const float indicatorInset = 10;
Expand Down Expand Up @@ -492,7 +492,7 @@

state.commitLayerTreeMessageState = CommitLayerTreePending;

if (m_webPageProxy->process().connection() == &connection)
if (m_webProcessProxy->connection() == &connection)
m_webPageProxy->scrollingCoordinatorProxy()->sendScrollingTreeNodeDidScroll();

// Waiting for CA to commit is insufficient, because the render server can still be
Expand All @@ -514,8 +514,8 @@
ProcessState& state = processStateForConnection(*connection);
didRefreshDisplay(state, *connection);
} else {
if (m_webPageProxy->process().hasConnection())
didRefreshDisplay(m_webPageProxyProcessState, *m_webPageProxy->process().protectedConnection());
if (m_webProcessProxy->hasConnection())
didRefreshDisplay(m_webPageProxyProcessState, *m_webProcessProxy->protectedConnection());
for (auto pair : m_remotePageProcessState) {
if (pair.key.process().hasConnection())
didRefreshDisplay(pair.value, *pair.key.process().protectedConnection());
Expand Down Expand Up @@ -562,7 +562,7 @@

void RemoteLayerTreeDrawingAreaProxy::hideContentUntilPendingUpdate()
{
m_replyForUnhidingContent = protectedWebPageProxy()->sendWithAsyncReply(Messages::DrawingArea::DispatchAfterEnsuringDrawing(), [] { }, identifier());
m_replyForUnhidingContent = sendWithAsyncReply(Messages::DrawingArea::DispatchAfterEnsuringDrawing(), [] { });
m_remoteLayerTreeHost->detachRootLayer();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ namespace WebKit {

class RemoteLayerTreeDrawingAreaProxyIOS final : public RemoteLayerTreeDrawingAreaProxy {
public:
RemoteLayerTreeDrawingAreaProxyIOS(WebPageProxy&);
RemoteLayerTreeDrawingAreaProxyIOS(WebPageProxy&, WebProcessProxy&);
virtual ~RemoteLayerTreeDrawingAreaProxyIOS();

private:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,8 @@ - (void)didChangeNominalFramesPerSecond
using namespace IPC;
using namespace WebCore;

RemoteLayerTreeDrawingAreaProxyIOS::RemoteLayerTreeDrawingAreaProxyIOS(WebPageProxy& pageProxy)
: RemoteLayerTreeDrawingAreaProxy(pageProxy)
RemoteLayerTreeDrawingAreaProxyIOS::RemoteLayerTreeDrawingAreaProxyIOS(WebPageProxy& pageProxy, WebProcessProxy& webProcessProxy)
: RemoteLayerTreeDrawingAreaProxy(pageProxy, webProcessProxy)
{
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class RemoteScrollingCoordinatorTransaction;
class RemoteLayerTreeDrawingAreaProxyMac final : public RemoteLayerTreeDrawingAreaProxy {
friend class RemoteScrollingCoordinatorProxyMac;
public:
RemoteLayerTreeDrawingAreaProxyMac(WebPageProxy&);
RemoteLayerTreeDrawingAreaProxyMac(WebPageProxy&, WebProcessProxy&);
~RemoteLayerTreeDrawingAreaProxyMac();

void didRefreshDisplay() override;
Expand Down

0 comments on commit 7445f27

Please sign in to comment.