Changeset 240343 in webkit
- Timestamp:
- Jan 23, 2019 9:43:02 AM (5 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r240342 r240343 1 2019-01-23 Antti Koivisto <antti@apple.com> 2 3 [PSON] Flash on back navigation on Mac 4 https://bugs.webkit.org/show_bug.cgi?id=193716 5 <rdar://problem/47148458> 6 7 Reviewed by Chris Dumez. 8 9 We close the page immediately if we fail to suspend. Layers disappear and we get a flash. 10 11 * UIProcess/SuspendedPageProxy.cpp: 12 (WebKit::SuspendedPageProxy::didProcessRequestToSuspend): 13 14 Remove the suspended page (so closing it on web process side) if the suspension fails. 15 Skip this if we are using web process side compositing on Mac. 16 17 * UIProcess/WebPageProxy.cpp: 18 (WebKit::WebPageProxy::enterAcceleratedCompositingMode): 19 20 On Mac, remove failed SuspendedPageProxy when entering compositing mode. At this point we don't need it to keep layers alive. 21 22 * UIProcess/WebProcessPool.cpp: 23 (WebKit::WebProcessPool::removeFailedSuspendedPagesForPage): 24 * UIProcess/WebProcessPool.h: 25 * WebProcess/WebPage/WebPage.cpp: 26 (WebKit::WebPage::suspendForProcessSwap): 27 28 Don't close the page on suspension failure. 29 1 30 2019-01-23 Wenson Hsieh <wenson_hsieh@apple.com> 2 31 -
trunk/Source/WebKit/UIProcess/SuspendedPageProxy.cpp
r240046 r240343 27 27 #include "SuspendedPageProxy.h" 28 28 29 #include "DrawingAreaProxy.h" 29 30 #include "Logging.h" 30 31 #include "WebPageMessages.h" … … 155 156 m_process->removeMessageReceiver(Messages::WebPageProxy::messageReceiverName(), m_page.pageID()); 156 157 158 bool shouldKeepOnFailure = false; 159 #if PLATFORM(MAC) 160 // With web process side tiles, we need to keep the suspended page around on failure to avoid flashing. 161 // It is removed by WebPageProxy::enterAcceleratedCompositingMode when the target page is ready. 162 shouldKeepOnFailure = m_page.drawingArea() && m_page.drawingArea()->type() == DrawingAreaTypeTiledCoreAnimation; 163 #endif 164 if (newSuspensionState == SuspensionState::FailedToSuspend && !shouldKeepOnFailure) { 165 RunLoop::main().dispatch([weakProcessPool = makeWeakPtr(m_process->processPool()), weakThis = makeWeakPtr(*this)] { 166 if (weakProcessPool && weakThis) 167 weakProcessPool->removeSuspendedPage(*weakThis); 168 }); 169 } 170 157 171 if (m_readyToUnsuspendHandler) 158 172 m_readyToUnsuspendHandler(this); -
trunk/Source/WebKit/UIProcess/WebPageProxy.cpp
r240342 r240343 6848 6848 void WebPageProxy::enterAcceleratedCompositingMode(const LayerTreeContext& layerTreeContext) 6849 6849 { 6850 #if PLATFORM(MAC) 6851 ASSERT(m_drawingArea->type() == DrawingAreaTypeTiledCoreAnimation); 6852 #endif 6850 6853 pageClient().enterAcceleratedCompositingMode(layerTreeContext); 6854 // We needed the failed suspended page to stay alive to avoid flashing. Now we can get rid of it. 6855 m_process->processPool().removeFailedSuspendedPagesForPage(*this); 6851 6856 } 6852 6857 -
trunk/Source/WebKit/UIProcess/WebProcessPool.cpp
r240292 r240343 2271 2271 } 2272 2272 2273 void WebProcessPool::removeFailedSuspendedPagesForPage(WebPageProxy& page) 2274 { 2275 m_suspendedPages.removeAllMatching([&page](auto& suspendedPage) { 2276 return &suspendedPage->page() == &page && suspendedPage->failedToSuspend(); 2277 }); 2278 } 2279 2273 2280 std::unique_ptr<SuspendedPageProxy> WebProcessPool::takeSuspendedPage(SuspendedPageProxy& suspendedPage) 2274 2281 { -
trunk/Source/WebKit/UIProcess/WebProcessPool.h
r239535 r240343 451 451 void addSuspendedPage(std::unique_ptr<SuspendedPageProxy>&&); 452 452 void removeAllSuspendedPagesForPage(WebPageProxy&); 453 void removeFailedSuspendedPagesForPage(WebPageProxy&); 453 454 std::unique_ptr<SuspendedPageProxy> takeSuspendedPage(SuspendedPageProxy&); 454 455 void removeSuspendedPage(SuspendedPageProxy&); -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp
r240298 r240343 1341 1341 { 1342 1342 auto failedToSuspend = [this, protectedThis = makeRef(*this)] { 1343 close();1344 1343 send(Messages::WebPageProxy::DidFailToSuspendAfterProcessSwap()); 1345 1344 };
Note: See TracChangeset
for help on using the changeset viewer.