- Revision
- 258829
- Author
- [email protected]
- Date
- 2020-03-23 03:16:21 -0700 (Mon, 23 Mar 2020)
Log Message
Explicitly activate the new DrawingAreaProxy on PSON navigation
https://bugs.webkit.org/show_bug.cgi?id=209232
Reviewed by Antti Koivisto.
Delay tree unfreezing for provisional pages until the main frame load is committed.
At that point, UIProcess is made aware and is doing the process swap.
We can thus unfreeze the tree so that UIProcess starts getting DrawAreaProxy messages.
This allows UIProcess to start listening to DrawAreaProxy messages at the time of doing process swapping in WebPageProxy.
* UIProcess/DrawingAreaProxy.cpp:
(WebKit::DrawingAreaProxy::DrawingAreaProxy):
(WebKit::DrawingAreaProxy::startReceivingMessages):
* UIProcess/DrawingAreaProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::setDrawingArea):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::didCompletePageTransition):
(WebKit::WebPage::didCommitLoad):
Modified Paths
Diff
Modified: trunk/Source/WebCore/loader/FrameLoaderStateMachine.h (258828 => 258829)
--- trunk/Source/WebCore/loader/FrameLoaderStateMachine.h 2020-03-23 09:48:12 UTC (rev 258828)
+++ trunk/Source/WebCore/loader/FrameLoaderStateMachine.h 2020-03-23 10:16:21 UTC (rev 258829)
@@ -51,8 +51,8 @@
};
WEBCORE_EXPORT bool committingFirstRealLoad() const;
- WEBCORE_EXPORT bool committedFirstRealDocumentLoad() const;
- bool creatingInitialEmptyDocument() const;
+ bool committedFirstRealDocumentLoad() const;
+ WEBCORE_EXPORT bool creatingInitialEmptyDocument() const;
WEBCORE_EXPORT bool isDisplayingInitialEmptyDocument() const;
WEBCORE_EXPORT bool firstLayoutDone() const;
void advanceTo(State);
Modified: trunk/Source/WebKit/ChangeLog (258828 => 258829)
--- trunk/Source/WebKit/ChangeLog 2020-03-23 09:48:12 UTC (rev 258828)
+++ trunk/Source/WebKit/ChangeLog 2020-03-23 10:16:21 UTC (rev 258829)
@@ -1,3 +1,26 @@
+2020-03-23 youenn fablet <[email protected]>
+
+ Explicitly activate the new DrawingAreaProxy on PSON navigation
+ https://bugs.webkit.org/show_bug.cgi?id=209232
+
+ Reviewed by Antti Koivisto.
+
+ Delay tree unfreezing for provisional pages until the main frame load is committed.
+ At that point, UIProcess is made aware and is doing the process swap.
+ We can thus unfreeze the tree so that UIProcess starts getting DrawAreaProxy messages.
+
+ This allows UIProcess to start listening to DrawAreaProxy messages at the time of doing process swapping in WebPageProxy.
+
+ * UIProcess/DrawingAreaProxy.cpp:
+ (WebKit::DrawingAreaProxy::DrawingAreaProxy):
+ (WebKit::DrawingAreaProxy::startReceivingMessages):
+ * UIProcess/DrawingAreaProxy.h:
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::setDrawingArea):
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::didCompletePageTransition):
+ (WebKit::WebPage::didCommitLoad):
+
2020-03-22 Wenson Hsieh <[email protected]>
Adopt -[UIWindowScene interfaceOrientation] when determining device orientation
Modified: trunk/Source/WebKit/UIProcess/DrawingAreaProxy.cpp (258828 => 258829)
--- trunk/Source/WebKit/UIProcess/DrawingAreaProxy.cpp 2020-03-23 09:48:12 UTC (rev 258828)
+++ trunk/Source/WebKit/UIProcess/DrawingAreaProxy.cpp 2020-03-23 10:16:21 UTC (rev 258829)
@@ -48,14 +48,20 @@
, m_viewExposedRectChangedTimer(RunLoop::main(), this, &DrawingAreaProxy::viewExposedRectChangedTimerFired)
#endif
{
- process.addMessageReceiver(Messages::DrawingAreaProxy::messageReceiverName(), m_identifier, *this);
}
DrawingAreaProxy::~DrawingAreaProxy()
{
- process().removeMessageReceiver(Messages::DrawingAreaProxy::messageReceiverName(), m_identifier);
+ if (m_startedReceivingMessages)
+ process().removeMessageReceiver(Messages::DrawingAreaProxy::messageReceiverName(), m_identifier);
}
+void DrawingAreaProxy::startReceivingMessages()
+{
+ m_startedReceivingMessages = true;
+ process().addMessageReceiver(Messages::DrawingAreaProxy::messageReceiverName(), m_identifier, *this);
+}
+
bool DrawingAreaProxy::setSize(const IntSize& size, const IntSize& scrollDelta)
{
if (m_size == size && scrollDelta.isZero())
Modified: trunk/Source/WebKit/UIProcess/DrawingAreaProxy.h (258828 => 258829)
--- trunk/Source/WebKit/UIProcess/DrawingAreaProxy.h 2020-03-23 09:48:12 UTC (rev 258828)
+++ trunk/Source/WebKit/UIProcess/DrawingAreaProxy.h 2020-03-23 10:16:21 UTC (rev 258829)
@@ -61,6 +61,8 @@
DrawingAreaType type() const { return m_type; }
DrawingAreaIdentifier identifier() const { return m_identifier; }
+ void startReceivingMessages();
+
virtual void deviceScaleFactorDidChange() = 0;
// FIXME: These should be pure virtual.
@@ -155,6 +157,7 @@
virtual void didUpdateBackingStoreState(uint64_t /* backingStoreStateID */, const UpdateInfo&, const LayerTreeContext&) { }
virtual void exitAcceleratedCompositingMode(uint64_t /* backingStoreStateID */, const UpdateInfo&) { }
#endif
+ bool m_startedReceivingMessages { false };
};
} // namespace WebKit
Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.cpp (258828 => 258829)
--- trunk/Source/WebKit/UIProcess/WebPageProxy.cpp 2020-03-23 09:48:12 UTC (rev 258828)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.cpp 2020-03-23 10:16:21 UTC (rev 258829)
@@ -1035,6 +1035,8 @@
if (!m_drawingArea)
return;
+ m_drawingArea->startReceivingMessages();
+
#if ENABLE(ASYNC_SCROLLING) && PLATFORM(COCOA)
if (m_drawingArea->type() == DrawingAreaTypeRemoteLayerTree) {
m_scrollingCoordinatorProxy = makeUnique<RemoteScrollingCoordinatorProxy>(*this);
Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp (258828 => 258829)
--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp 2020-03-23 09:48:12 UTC (rev 258828)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp 2020-03-23 10:16:21 UTC (rev 258829)
@@ -3334,12 +3334,6 @@
void WebPage::didCompletePageTransition()
{
unfreezeLayerTree(LayerTreeFreezeReason::PageTransition);
-
- auto& stateMachine = m_mainFrame->coreFrame()->loader().stateMachine();
- RELEASE_LOG_IF_ALLOWED(Layers, "didCompletePageTransition: Did complete page transition, loader state is %d", stateMachine.stateForDebugging());
-
- if (stateMachine.committedFirstRealDocumentLoad())
- unfreezeLayerTree(LayerTreeFreezeReason::ProcessSwap);
}
void WebPage::show()
@@ -5865,6 +5859,9 @@
if (!frame->isMainFrame())
return;
+ ASSERT(!frame->coreFrame()->loader().stateMachine().creatingInitialEmptyDocument());
+ unfreezeLayerTree(LayerTreeFreezeReason::ProcessSwap);
+
#if ENABLE(RESOURCE_LOAD_STATISTICS)
clearLoadedThirdPartyDomains();
#endif