Skip to content
Permalink
Browse files
[iOS] REGRESSION(r238490?): Safari sometimes shows blank page until a…
… cross site navigation or re-opening the tab

https://bugs.webkit.org/show_bug.cgi?id=195037
<rdar://problem/48154508>

Reviewed by Antti Koivisto.

Restore the pre-r238490 behavior of WebPage::didCompletePageTransition clearing LayerTreeFreezeReason::ProcessSuspended
as this has been an issue when I was able to reproduce the issue locally.

Also added release logging to help diagnose the issue in the future.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::freezeLayerTree):
(WebKit::WebPage::unfreezeLayerTree):
(WebKit::WebPage::didCompletePageTransition):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::freezeAllLayerTrees):
(WebKit::WebProcess::unfreezeAllLayerTrees):


Canonical link: https://commits.webkit.org/209420@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242098 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
rniwa committed Feb 26, 2019
1 parent d48ed61 commit ea2e9cecab327f628deeb80a6497b9d3935be800
Showing 3 changed files with 36 additions and 0 deletions.
@@ -1,3 +1,24 @@
2019-02-26 Ryosuke Niwa <rniwa@webkit.org>

[iOS] REGRESSION(r238490?): Safari sometimes shows blank page until a cross site navigation or re-opening the tab
https://bugs.webkit.org/show_bug.cgi?id=195037
<rdar://problem/48154508>

Reviewed by Antti Koivisto.

Restore the pre-r238490 behavior of WebPage::didCompletePageTransition clearing LayerTreeFreezeReason::ProcessSuspended
as this has been an issue when I was able to reproduce the issue locally.

Also added release logging to help diagnose the issue in the future.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::freezeLayerTree):
(WebKit::WebPage::unfreezeLayerTree):
(WebKit::WebPage::didCompletePageTransition):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::freezeAllLayerTrees):
(WebKit::WebProcess::unfreezeAllLayerTrees):

2019-02-26 Youenn Fablet <youenn@apple.com>

Create WebPageProxy::m_userMediaPermissionRequestManager only when needed
@@ -2401,12 +2401,16 @@ const WebEvent* WebPage::currentEvent()

void WebPage::freezeLayerTree(LayerTreeFreezeReason reason)
{
RELEASE_LOG(ProcessSuspension, "%p - WebPage (PageID=%llu) - Adding a reason %d to freeze layer tree; current reasons are %d",
this, m_pageID, static_cast<unsigned>(reason), m_LayerTreeFreezeReasons.toRaw());
m_LayerTreeFreezeReasons.add(reason);
updateDrawingAreaLayerTreeFreezeState();
}

void WebPage::unfreezeLayerTree(LayerTreeFreezeReason reason)
{
RELEASE_LOG(ProcessSuspension, "%p - WebPage (PageID=%llu) - Removing a reason %d to freeze layer tree; current reasons are %d",
this, m_pageID, static_cast<unsigned>(reason), m_LayerTreeFreezeReasons.toRaw());
m_LayerTreeFreezeReasons.remove(reason);
updateDrawingAreaLayerTreeFreezeState();
}
@@ -3133,6 +3137,15 @@ void WebPage::didCompletePageTransition()
{
unfreezeLayerTree(LayerTreeFreezeReason::PageTransition);

if (m_LayerTreeFreezeReasons.contains(LayerTreeFreezeReason::ProcessSuspended)) {
RELEASE_LOG_ERROR(ProcessSuspension, "%p - WebPage (PageID=%llu) - LayerTreeFreezeReason::ProcessSuspended was set when removing LayerTreeFreezeReason::PageTransition; current reasons are %d",
this, m_pageID, m_LayerTreeFreezeReasons.toRaw());
}

// FIXME: In iOS, we sometimes never unset ProcessSuspended. See <rdar://problem/48154508>.
unfreezeLayerTree(LayerTreeFreezeReason::ProcessSuspended);
RELEASE_LOG_IF_ALLOWED("%p - WebPage - Did complete page transition", this);

bool isInitialEmptyDocument = !m_mainFrame;
if (!isInitialEmptyDocument)
unfreezeLayerTree(LayerTreeFreezeReason::ProcessSwap);
@@ -1521,12 +1521,14 @@ void WebProcess::cancelMarkAllLayersVolatile()

void WebProcess::freezeAllLayerTrees()
{
RELEASE_LOG(ProcessSuspension, "WebProcess %i is freezing all layer trees", getpid());
for (auto& page : m_pageMap.values())
page->freezeLayerTree(WebPage::LayerTreeFreezeReason::ProcessSuspended);
}

void WebProcess::unfreezeAllLayerTrees()
{
RELEASE_LOG(ProcessSuspension, "WebProcess %i is unfreezing all layer trees", getpid());
for (auto& page : m_pageMap.values())
page->unfreezeLayerTree(WebPage::LayerTreeFreezeReason::ProcessSuspended);
}

0 comments on commit ea2e9ce

Please sign in to comment.