WebKit Bugzilla
Attachment 359883 Details for
Bug 193716
: [PSON] Flash on back navigation on Mac
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch
suspended-page-back-flash.patch (text/plain), 5.53 KB, created by
Antti Koivisto
on 2019-01-23 07:48:47 PST
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Antti Koivisto
Created:
2019-01-23 07:48:47 PST
Size:
5.53 KB
patch
obsolete
>Index: Source/WebKit/ChangeLog >=================================================================== >--- Source/WebKit/ChangeLog (revision 240334) >+++ Source/WebKit/ChangeLog (working copy) >@@ -1,3 +1,32 @@ >+2019-01-23 Antti Koivisto <antti@apple.com> >+ >+ [PSON] Flash on back navigation on Mac >+ https://bugs.webkit.org/show_bug.cgi?id=193716 >+ <rdar://problem/47148458> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ We close the page immediately if we fail to suspend. Layers disappear and we get a flash. >+ >+ * UIProcess/SuspendedPageProxy.cpp: >+ (WebKit::SuspendedPageProxy::didProcessRequestToSuspend): >+ >+ Remove the suspended page (so closing it on web process side) if the suspension fails. >+ Skip this if we are using web process side compositing on Mac. >+ >+ * UIProcess/WebPageProxy.cpp: >+ (WebKit::WebPageProxy::enterAcceleratedCompositingMode): >+ >+ On Mac, remove failed SuspendedPageProxy when entering compositing mode. At this point we don't need it to keep layers alive. >+ >+ * UIProcess/WebProcessPool.cpp: >+ (WebKit::WebProcessPool::removeFailedSuspendedPagesForPage): >+ * UIProcess/WebProcessPool.h: >+ * WebProcess/WebPage/WebPage.cpp: >+ (WebKit::WebPage::suspendForProcessSwap): >+ >+ Don't close the page on suspension failure. >+ > 2019-01-23 David Kilzer <ddkilzer@apple.com> > > Switch remaining CoreMedia soft-linking in WebKit over to CoreMediaSoftLink.{cpp,h} >Index: Source/WebKit/UIProcess/SuspendedPageProxy.cpp >=================================================================== >--- Source/WebKit/UIProcess/SuspendedPageProxy.cpp (revision 240329) >+++ Source/WebKit/UIProcess/SuspendedPageProxy.cpp (working copy) >@@ -26,6 +26,7 @@ > #include "config.h" > #include "SuspendedPageProxy.h" > >+#include "DrawingAreaProxy.h" > #include "Logging.h" > #include "WebPageMessages.h" > #include "WebPageProxy.h" >@@ -154,6 +155,19 @@ void SuspendedPageProxy::didProcessReque > > m_process->removeMessageReceiver(Messages::WebPageProxy::messageReceiverName(), m_page.pageID()); > >+ bool shouldKeepOnFailure = false; >+#if PLATFORM(MAC) >+ // With web process side tiles, we need to keep the suspended page around on failure to avoid flashing. >+ // It is removed by WebPageProxy::enterAcceleratedCompositingMode when the target page is ready. >+ shouldKeepOnFailure = m_page.drawingArea() && m_page.drawingArea()->type() == DrawingAreaTypeTiledCoreAnimation; >+#endif >+ if (newSuspensionState == SuspensionState::FailedToSuspend && !shouldKeepOnFailure) { >+ RunLoop::main().dispatch([weakProcessPool = makeWeakPtr(m_process->processPool()), weakThis = makeWeakPtr(*this)] { >+ if (weakProcessPool && weakThis) >+ weakProcessPool->removeSuspendedPage(*weakThis); >+ }); >+ } >+ > if (m_readyToUnsuspendHandler) > m_readyToUnsuspendHandler(this); > } >Index: Source/WebKit/UIProcess/WebPageProxy.cpp >=================================================================== >--- Source/WebKit/UIProcess/WebPageProxy.cpp (revision 240329) >+++ Source/WebKit/UIProcess/WebPageProxy.cpp (working copy) >@@ -6850,7 +6850,11 @@ void WebPageProxy::isJITEnabled(Completi > > void WebPageProxy::enterAcceleratedCompositingMode(const LayerTreeContext& layerTreeContext) > { >+ ASSERT(m_drawingArea->type() == DrawingAreaTypeTiledCoreAnimation); >+ > pageClient().enterAcceleratedCompositingMode(layerTreeContext); >+ // We needed failed suspended page to stay alive to avoid flashing. Now we can get rid of them. >+ m_process->processPool().removeFailedSuspendedPagesForPage(*this); > } > > void WebPageProxy::exitAcceleratedCompositingMode() >Index: Source/WebKit/UIProcess/WebProcessPool.cpp >=================================================================== >--- Source/WebKit/UIProcess/WebProcessPool.cpp (revision 240329) >+++ Source/WebKit/UIProcess/WebProcessPool.cpp (working copy) >@@ -2270,6 +2270,13 @@ void WebProcessPool::removeAllSuspendedP > }); > } > >+void WebProcessPool::removeFailedSuspendedPagesForPage(WebPageProxy& page) >+{ >+ m_suspendedPages.removeAllMatching([&page](auto& suspendedPage) { >+ return &suspendedPage->page() == &page && suspendedPage->failedToSuspend(); >+ }); >+} >+ > std::unique_ptr<SuspendedPageProxy> WebProcessPool::takeSuspendedPage(SuspendedPageProxy& suspendedPage) > { > return m_suspendedPages.takeFirst([&suspendedPage](auto& item) { >Index: Source/WebKit/UIProcess/WebProcessPool.h >=================================================================== >--- Source/WebKit/UIProcess/WebProcessPool.h (revision 240329) >+++ Source/WebKit/UIProcess/WebProcessPool.h (working copy) >@@ -450,6 +450,7 @@ public: > // SuspendedPageProxy management. > void addSuspendedPage(std::unique_ptr<SuspendedPageProxy>&&); > void removeAllSuspendedPagesForPage(WebPageProxy&); >+ void removeFailedSuspendedPagesForPage(WebPageProxy&); > std::unique_ptr<SuspendedPageProxy> takeSuspendedPage(SuspendedPageProxy&); > void removeSuspendedPage(SuspendedPageProxy&); > bool hasSuspendedPageFor(WebProcessProxy&) const; >Index: Source/WebKit/WebProcess/WebPage/WebPage.cpp >=================================================================== >--- Source/WebKit/WebProcess/WebPage/WebPage.cpp (revision 240329) >+++ Source/WebKit/WebProcess/WebPage/WebPage.cpp (working copy) >@@ -1340,7 +1340,6 @@ void WebPage::sendClose() > void WebPage::suspendForProcessSwap() > { > auto failedToSuspend = [this, protectedThis = makeRef(*this)] { >- close(); > send(Messages::WebPageProxy::DidFailToSuspendAfterProcessSwap()); > }; >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
cdumez
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 193716
:
359883
|
359894
|
360002
|
360003
|
360019