Changeset 236257 in webkit
- Timestamp:
- Sep 20, 2018, 4:49:55 AM (8 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 22 edited
-
ChangeLog (modified) (1 diff)
-
UIProcess/Cocoa/WebViewImpl.mm (modified) (1 diff)
-
UIProcess/DrawingAreaProxy.h (modified) (1 diff)
-
UIProcess/PageClient.h (modified) (1 diff)
-
UIProcess/SuspendedPageProxy.cpp (modified) (2 diffs)
-
UIProcess/SuspendedPageProxy.h (modified) (1 diff)
-
UIProcess/WebPageProxy.cpp (modified) (4 diffs)
-
UIProcess/WebPageProxy.h (modified) (1 diff)
-
UIProcess/WebPageProxy.messages.in (modified) (1 diff)
-
UIProcess/ios/PageClientImplIOS.h (modified) (1 diff)
-
UIProcess/ios/PageClientImplIOS.mm (modified) (1 diff)
-
UIProcess/mac/PageClientImplMac.h (modified) (1 diff)
-
UIProcess/mac/PageClientImplMac.mm (modified) (1 diff)
-
UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h (modified) (1 diff)
-
UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm (modified) (1 diff)
-
WebProcess/WebPage/DrawingArea.h (modified) (1 diff)
-
WebProcess/WebPage/DrawingArea.messages.in (modified) (1 diff)
-
WebProcess/WebPage/WebPage.cpp (modified) (6 diffs)
-
WebProcess/WebPage/WebPage.h (modified) (1 diff)
-
WebProcess/WebPage/WebPage.messages.in (modified) (1 diff)
-
WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h (modified) (1 diff)
-
WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r236245 r236257 1 2018-09-20 Antti Koivisto <antti@apple.com> 2 3 REGRESSION (PSON): White or Black flash occurs when process swapping on navigation on Mac 4 https://bugs.webkit.org/show_bug.cgi?id=189663 5 <rdar://problem/44184955> 6 7 Reviewed by Geoff Garen and Chris Dumez. 8 9 We need to keep the layer tree of the previous page alive and visible until we have something 10 to render on the new page. With PSON on Mac this means that we should keep displaying the 11 layer tree from the previus process. 12 13 This patch moves the management of 'attaching' the drawing area (Mac only concept) from web process 14 to UI process. This is when we parent the layer tree to the view root layer. It also ensures that 15 the layer tree is not deleted too early on process swap and that it still eventually gets deleted. 16 17 * UIProcess/DrawingAreaProxy.h: 18 (WebKit::DrawingAreaProxy::attachInWebProcess): 19 * UIProcess/SuspendedPageProxy.cpp: 20 (WebKit::messageNamesToIgnoreWhileSuspended): 21 (WebKit::SuspendedPageProxy::tearDownDrawingAreaInWebProcess): 22 23 We no longer tear down drawing area (layer tree) for suspended pages automatically. Send an explicit 24 message for it. 25 26 * UIProcess/SuspendedPageProxy.h: 27 * UIProcess/WebPageProxy.cpp: 28 (WebKit::WebPageProxy::didCompletePageTransition): 29 30 Attach the drawing area if appropriate. 31 32 (WebKit::WebPageProxy::resetStateAfterProcessExited): 33 34 Call PageClien::processWillSwap instead of processDidExit when appropriate. 35 36 (WebKit::WebPageProxy::enterAcceleratedCompositingMode): 37 38 This is called when we have switched to the new layer tree. 39 Tear down the drawing area in the previus process. 40 41 * UIProcess/WebPageProxy.h: 42 * UIProcess/WebPageProxy.messages.in: 43 * UIProcess/ios/PageClientImplIOS.h: 44 * UIProcess/ios/PageClientImplIOS.mm: 45 (WebKit::PageClientImpl::processWillSwap): 46 47 On iOS this just call processDidExit for now. 48 49 * UIProcess/mac/PageClientImplMac.h: 50 * UIProcess/mac/PageClientImplMac.mm: 51 (WebKit::PageClientImpl::processWillSwap): 52 (WebKit::PageClientImpl::processDidExit): 53 54 Add processWillSwap separately from processDidExit. They are currently the same 55 except processWillSwap doesn't clear the root layer. 56 57 * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h: 58 * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm: 59 (WebKit::TiledCoreAnimationDrawingAreaProxy::attachInWebProcess): 60 61 Send a message to the web process to attach the drawing area. 62 63 * WebProcess/WebPage/DrawingArea.h: 64 (WebKit::DrawingArea::attach): 65 (WebKit::DrawingArea::attachDrawingArea): Deleted. 66 67 Rename to be less redundant. 68 69 * WebProcess/WebPage/DrawingArea.messages.in: 70 * WebProcess/WebPage/WebPage.cpp: 71 (WebKit::WebPage::reinitializeWebPage): 72 73 Don't attach drawing area automatically. It will be done by a message from UI process. 74 75 (WebKit::WebPage::setLayerTreeStateIsFrozen): 76 77 Layer tree is always frozen in a suspended process (if it exists). 78 79 (WebKit::WebPage::didReceivePolicyDecision): 80 81 Suspend immediately when receiving policy decision to avoid flash on 'about:blank' loading. 82 83 (WebKit::WebPage::didStartPageTransition): 84 (WebKit::WebPage::didCompletePageTransition): 85 86 Notify UI process of transition completion. 87 88 (WebKit::WebPage::setIsSuspended): 89 (WebKit::WebPage::tearDownDrawingAreaForSuspend): 90 * WebProcess/WebPage/WebPage.h: 91 * WebProcess/WebPage/WebPage.messages.in: 92 * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h: 93 * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: 94 (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea): 95 96 Don't attach drawing area automatically. It will be done by a message from UI process. 97 98 (WebKit::TiledCoreAnimationDrawingArea::attach): 99 (WebKit::TiledCoreAnimationDrawingArea::attachDrawingArea): Deleted. 100 1 101 2018-09-20 Tomas Popela <tpopela@redhat.com> 2 102 -
trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm
r235955 r236257 1461 1461 notifyInputContextAboutDiscardedComposition(); 1462 1462 1463 if (m_layerHostingView)1464 setAcceleratedCompositingRootLayer(nil);1465 1466 1463 updateRemoteAccessibilityRegistration(false); 1467 1464 flushPendingMouseEventCallbacks(); -
trunk/Source/WebKit/UIProcess/DrawingAreaProxy.h
r236146 r236257 83 83 #endif 84 84 85 virtual void attachInWebProcess() { } 86 85 87 virtual void updateDebugIndicator() { } 86 88 -
trunk/Source/WebKit/UIProcess/PageClient.h
r235907 r236257 185 185 186 186 virtual void processDidExit() = 0; 187 virtual void processWillSwap() { processDidExit(); } 187 188 virtual void didRelaunchProcess() = 0; 188 189 virtual void pageClosed() = 0; -
trunk/Source/WebKit/UIProcess/SuspendedPageProxy.cpp
r236226 r236257 55 55 messageNames.get().add("DidFinishDocumentLoadForFrame"); 56 56 messageNames.get().add("DidFinishProgress"); 57 messageNames.get().add("DidCompletePageTransition"); 57 58 messageNames.get().add("DidFirstLayoutForFrame"); 58 59 messageNames.get().add("DidFirstVisuallyNonEmptyLayoutForFrame"); … … 110 111 } 111 112 113 void SuspendedPageProxy::tearDownDrawingAreaInWebProcess() 114 { 115 m_process->send(Messages::WebPage::TearDownDrawingAreaForSuspend(), m_page.pageID()); 116 } 117 112 118 void SuspendedPageProxy::didFinishLoad() 113 119 { -
trunk/Source/WebKit/UIProcess/SuspendedPageProxy.h
r236226 r236257 50 50 void webProcessDidClose(WebProcessProxy&); 51 51 void destroyWebPageInWebProcess(); 52 void tearDownDrawingAreaInWebProcess(); 52 53 53 54 #if !LOG_DISABLED -
trunk/Source/WebKit/UIProcess/WebPageProxy.cpp
r236227 r236257 57 57 #include "DataReference.h" 58 58 #include "DownloadProxy.h" 59 #include "DrawingAreaMessages.h" 59 60 #include "DrawingAreaProxy.h" 60 #include "DrawingAreaProxyMessages.h"61 61 #include "EventDispatcherMessages.h" 62 62 #include "FrameInfoData.h" … … 3431 3431 } 3432 3432 3433 void WebPageProxy::didCompletePageTransition(bool isInitialEmptyDocument) 3434 { 3435 // Attach drawing area for the initial empty document only if this is not a process swap. 3436 if (isInitialEmptyDocument && m_suspendedPage) 3437 return; 3438 3439 #if PLATFORM(MAC) 3440 if (!m_drawingArea) 3441 return; 3442 3443 // Drawing area for the suspended page will be torn down when the attach completes. 3444 m_drawingArea->attachInWebProcess(); 3445 #else 3446 if (m_suspendedPage) 3447 m_suspendedPage->tearDownDrawingAreaInWebProcess(); 3448 #endif 3449 } 3450 3433 3451 void WebPageProxy::setNetworkRequestsInProgress(bool networkRequestsInProgress) 3434 3452 { … … 6138 6156 m_editorState = EditorState(); 6139 6157 6140 pageClient().processDidExit(); 6158 if (terminationReason == ProcessTerminationReason::NavigationSwap) 6159 pageClient().processWillSwap(); 6160 else 6161 pageClient().processDidExit(); 6162 6141 6163 pageClient().clearAllEditCommands(); 6142 6164 … … 6279 6301 { 6280 6302 pageClient().enterAcceleratedCompositingMode(layerTreeContext); 6303 6304 // We have completed the page transition and can tear down the layers in the suspended process. 6305 if (m_suspendedPage) 6306 m_suspendedPage->tearDownDrawingAreaInWebProcess(); 6281 6307 } 6282 6308 -
trunk/Source/WebKit/UIProcess/WebPageProxy.h
r236154 r236257 1428 1428 void didChangeProgress(double); 1429 1429 void didFinishProgress(); 1430 void didCompletePageTransition(bool isInitialEmptyDocument); 1430 1431 void setNetworkRequestsInProgress(bool); 1431 1432 -
trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in
r236146 r236257 118 118 DidStartProgress() 119 119 120 DidCompletePageTransition(bool isInitialEmptyDocument) 121 120 122 SetNetworkRequestsInProgress(bool networkRequestsInProgress) 121 123 -
trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.h
r235741 r236257 66 66 bool isVisuallyIdle() override; 67 67 void processDidExit() override; 68 void processWillSwap() override; 68 69 void didRelaunchProcess() override; 69 70 void pageClosed() override; -
trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm
r235878 r236257 210 210 } 211 211 212 void PageClientImpl::processWillSwap() 213 { 214 // FIXME: It didn't really exit. 215 processDidExit(); 216 } 217 212 218 void PageClientImpl::didRelaunchProcess() 213 219 { -
trunk/Source/WebKit/UIProcess/mac/PageClientImplMac.h
r235925 r236257 80 80 81 81 void processDidExit() override; 82 void processWillSwap() override; 82 83 void pageClosed() override; 83 84 void didRelaunchProcess() override; -
trunk/Source/WebKit/UIProcess/mac/PageClientImplMac.mm
r235935 r236257 254 254 } 255 255 256 void PageClientImpl::processWillSwap() 257 { 258 // FIXME: It didn't really exit. 259 m_impl->processDidExit(); 260 } 261 256 262 void PageClientImpl::processDidExit() 257 263 { 258 264 m_impl->processDidExit(); 265 m_impl->setAcceleratedCompositingRootLayer(nil); 259 266 } 260 267 -
trunk/Source/WebKit/UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h
r236146 r236257 39 39 private: 40 40 // DrawingAreaProxy 41 void attachInWebProcess() override; 42 41 43 void deviceScaleFactorDidChange() override; 42 44 void sizeDidChange() override; -
trunk/Source/WebKit/UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm
r236146 r236257 54 54 } 55 55 56 void TiledCoreAnimationDrawingAreaProxy::attachInWebProcess() 57 { 58 m_webPageProxy.process().send(Messages::DrawingArea::Attach(), m_webPageProxy.pageID()); 59 } 60 56 61 void TiledCoreAnimationDrawingAreaProxy::deviceScaleFactorDidChange() 57 62 { -
trunk/Source/WebKit/WebProcess/WebPage/DrawingArea.h
r236146 r236257 152 152 #endif 153 153 154 virtual void attach DrawingArea() { };154 virtual void attach() { }; 155 155 156 156 protected: -
trunk/Source/WebKit/WebProcess/WebPage/DrawingArea.messages.in
r236146 r236257 46 46 #endif 47 47 48 #if PLATFORM(MAC) && ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING) 48 #if PLATFORM(MAC) 49 Attach() 50 51 #if ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING) 49 52 DisplayWasRefreshed() 50 53 #endif 54 #endif 51 55 } -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp
r236146 r236257 658 658 m_drawingArea->setPaintingEnabled(true); 659 659 } 660 m_drawingArea->attachDrawingArea();661 660 662 661 if (m_activityState != parameters.activityState) … … 2216 2215 return; 2217 2216 2218 drawingArea->setLayerTreeStateIsFrozen(frozen );2217 drawingArea->setLayerTreeStateIsFrozen(frozen || m_isSuspended); 2219 2218 } 2220 2219 … … 2834 2833 if (!frame) 2835 2834 return; 2835 if (policyAction == PolicyAction::Suspend) { 2836 ASSERT(frame == m_mainFrame); 2837 setIsSuspended(true); 2838 } 2836 2839 frame->didReceivePolicyDecision(listenerID, policyAction, navigationID, downloadID, WTFMove(websitePolicies)); 2837 2840 } … … 2847 2850 void WebPage::didStartPageTransition() 2848 2851 { 2849 m_drawingArea->setLayerTreeStateIsFrozen(true);2852 setLayerTreeStateIsFrozen(true); 2850 2853 2851 2854 #if PLATFORM(MAC) … … 2871 2874 void WebPage::didCompletePageTransition() 2872 2875 { 2873 if (m_drawingArea) 2874 m_drawingArea->setLayerTreeStateIsFrozen(false); 2876 // FIXME: Layer tree freezing should be managed entirely in the UI process side. 2877 setLayerTreeStateIsFrozen(false); 2878 2879 bool isInitialEmptyDocument = !m_mainFrame; 2880 send(Messages::WebPageProxy::DidCompletePageTransition(isInitialEmptyDocument)); 2875 2881 } 2876 2882 … … 6001 6007 6002 6008 m_isSuspended = suspended; 6003 if (m_isSuspended) 6004 m_drawingArea = nullptr; 6009 6010 setLayerTreeStateIsFrozen(true); 6011 } 6012 6013 void WebPage::tearDownDrawingAreaForSuspend() 6014 { 6015 if (!m_isSuspended) 6016 return; 6017 m_drawingArea = nullptr; 6005 6018 } 6006 6019 -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.h
r236146 r236257 1415 1415 1416 1416 void setIsSuspended(bool); 1417 void tearDownDrawingAreaForSuspend(); 1417 1418 1418 1419 RefPtr<WebImage> snapshotAtSize(const WebCore::IntRect&, const WebCore::IntSize& bitmapSize, SnapshotOptions); -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in
r236146 r236257 507 507 508 508 SetIsSuspended(bool suspended) 509 TearDownDrawingAreaForSuspend(); 509 510 510 511 #if HAVE(CFNETWORK_STORAGE_PARTITIONING) -
trunk/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h
r236146 r236257 104 104 void setShouldScaleViewToFitDocument(bool) override; 105 105 106 void attach DrawingArea() override;106 void attach() override; 107 107 108 108 void adjustTransientZoom(double scale, WebCore::FloatPoint origin) override; -
trunk/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm
r236146 r236257 92 92 updateLayerHostingContext(); 93 93 setColorSpace(parameters.colorSpace); 94 95 attachDrawingArea();96 94 } 97 95 … … 102 100 103 101 104 void TiledCoreAnimationDrawingArea::attach DrawingArea()102 void TiledCoreAnimationDrawingArea::attach() 105 103 { 106 104 LayerTreeContext layerTreeContext;
Note:
See TracChangeset
for help on using the changeset viewer.