}
auto suspendedPage = std::make_unique<SuspendedPageProxy>(*this, m_process.copyRef(), *currentItem, *mainFrameID);
+
+#if PLATFORM(MAC)
m_pageSuspendedDueToCurrentNavigation = makeWeakPtr(suspendedPage.get());
- m_process->processPool().addSuspendedPageProxy(WTFMove(suspendedPage));
+#endif
+
+ LOG(ProcessSwapping, "WebPageProxy %" PRIu64 " created suspended page %s for process pid %i, back/forward item %s" PRIu64, pageID(), suspendedPage->loggingString(), m_process->processIdentifier(), currentItem->itemID().logString());
- LOG(ProcessSwapping, "WebPageProxy %" PRIu64 " created suspended page %s for process pid %i, back/forward item %s" PRIu64, pageID(), m_pageSuspendedDueToCurrentNavigation->loggingString(), m_process->processIdentifier(), currentItem->itemID().logString());
+ m_process->processPool().addSuspendedPageProxy(WTFMove(suspendedPage));
}
void WebPageProxy::swapToWebProcess(Ref<WebProcessProxy>&& process, API::Navigation& navigation, std::optional<uint64_t> mainFrameIDInPreviousProcess)
}
if (policyAction == PolicyAction::Use && frame.isMainFrame()) {
+#if PLATFORM(MAC)
// We're about to navigate so we need to reset m_pageSuspendedDueToCurrentNavigation. If we decide to process swap,
// continueNavigationInNewProcess() will take care of updating m_pageSuspendedDueToCurrentNavigation as needed.
m_pageSuspendedDueToCurrentNavigation = nullptr;
+#endif
String reason;
auto proposedProcess = process().processPool().processForNavigation(*this, *navigation, processSwapRequestedByClient, policyAction, reason);
void WebPageProxy::didCompletePageTransition(bool isInitialEmptyDocument)
{
+#if PLATFORM(MAC)
// Attach drawing area for the initial empty document only if this is not a process swap.
if (isInitialEmptyDocument && m_pageSuspendedDueToCurrentNavigation)
return;
-#if PLATFORM(MAC)
if (!m_drawingArea)
return;
// Drawing area for the suspended page will be torn down when the attach completes.
m_drawingArea->attachInWebProcess();
#else
- if (m_pageSuspendedDueToCurrentNavigation)
- m_pageSuspendedDueToCurrentNavigation->tearDownDrawingAreaInWebProcess();
+ UNUSED_PARAM(isInitialEmptyDocument);
#endif
}
void WebPageProxy::enterAcceleratedCompositingMode(const LayerTreeContext& layerTreeContext)
{
pageClient().enterAcceleratedCompositingMode(layerTreeContext);
-
- // We have completed the page transition and can tear down the layers in the suspended process.
- if (m_pageSuspendedDueToCurrentNavigation)
- m_pageSuspendedDueToCurrentNavigation->tearDownDrawingAreaInWebProcess();
}
void WebPageProxy::exitAcceleratedCompositingMode()