RESOLVED FIXED 190879
[PSON] Avoid tearing down the drawing area when suspending a WebPage due to process-swap
https://bugs.webkit.org/show_bug.cgi?id=190879
Summary [PSON] Avoid tearing down the drawing area when suspending a WebPage due to p...
Chris Dumez
Reported 2018-10-24 10:17:08 PDT
Avoid tearing down the drawing area when suspending a WebPage due to process-swap. We really only need to reset the drawing area upon resuming the WebPage. There is no strict need to destroy the drawing area on suspension and this has caused various crashes because code usually assumes we always have a drawing area.
Attachments
Patch (14.22 KB, patch)
2018-10-24 10:19 PDT, Chris Dumez
no flags
Patch (14.47 KB, patch)
2018-10-24 13:27 PDT, Chris Dumez
no flags
Patch (14.40 KB, patch)
2018-10-26 10:24 PDT, Chris Dumez
no flags
Chris Dumez
Comment 1 2018-10-24 10:19:50 PDT
Chris Dumez
Comment 2 2018-10-24 10:21:05 PDT
Comment on attachment 353039 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=353039&action=review > Source/WebKit/UIProcess/WebPageProxy.h:2264 > WeakPtr<SuspendedPageProxy> m_pageSuspendedDueToCurrentNavigation; I will look into dropping this member in a follow-up now that it is barely used and only on Mac.
Chris Dumez
Comment 3 2018-10-24 11:00:38 PDT
Works on iOS but breaks Mac, trying to figure out why.
Chris Dumez
Comment 4 2018-10-24 13:27:15 PDT
Antti Koivisto
Comment 5 2018-10-25 05:50:17 PDT
Comment on attachment 353050 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=353050&action=review Which mechanism guarantees that we don't use memory for any tiles in suspended process? > Source/WebKit/WebProcess/WebPage/WebPage.cpp:6140 > if (!m_isSuspended) > - return; > - m_drawingArea = nullptr; > + m_shouldResetDrawingArea = true; > + > + setLayerTreeStateIsFrozen(true); Why does this now call setLayerTreeStateIsFrozen(true) even when unsuspending?
Chris Dumez
Comment 6 2018-10-25 06:52:07 PDT
Comment on attachment 353050 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=353050&action=review >> Source/WebKit/WebProcess/WebPage/WebPage.cpp:6140 >> + setLayerTreeStateIsFrozen(true); > > Why does this now call setLayerTreeStateIsFrozen(true) even when unsuspending? I was wondering the same thing. This is pre-existing code that you added so you tell me :)
Chris Dumez
Comment 7 2018-10-25 06:56:14 PDT
(In reply to Antti Koivisto from comment #5) > Comment on attachment 353050 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=353050&action=review > > Which mechanism guarantees that we don't use memory for any tiles in > suspended process? I need to look into this as I do not know. The reason I started tearing down the drawing area was to fix the view freezing when navigating back with PSON on iOS, not for memory savings though. > > > Source/WebKit/WebProcess/WebPage/WebPage.cpp:6140 > > if (!m_isSuspended) > > - return; > > - m_drawingArea = nullptr; > > + m_shouldResetDrawingArea = true; > > + > > + setLayerTreeStateIsFrozen(true); > > Why does this now call setLayerTreeStateIsFrozen(true) even when > unsuspending?
Chris Dumez
Comment 8 2018-10-25 08:46:09 PDT
Comment on attachment 353050 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=353050&action=review > Source/WebKit/WebProcess/WebPage/WebPage.cpp:-6131 > - setLayerTreeStateIsFrozen(true); Notice that setLayerTreeStateIsFrozen(true); was already called unconditionally here, whether suspended is true or false. I merely added a 'm_shouldResetDrawingArea = true;' statement to this method, did not change freezing behavior in any way. The diff just looks a bit weird because I dropped the method below and it shared some code with this one.
Chris Dumez
Comment 9 2018-10-26 10:24:13 PDT
WebKit Commit Bot
Comment 10 2018-10-26 11:01:49 PDT
Comment on attachment 353189 [details] Patch Clearing flags on attachment: 353189 Committed r237467: <https://trac.webkit.org/changeset/237467>
WebKit Commit Bot
Comment 11 2018-10-26 11:01:50 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 12 2018-10-26 11:04:42 PDT
Geoffrey Garen
Comment 13 2019-02-18 14:58:53 PST
> > Which mechanism guarantees that we don't use memory for any tiles in > > suspended process? > > I need to look into this as I do not know. The reason I started tearing down > the drawing area was to fix the view freezing when navigating back with PSON > on iOS, not for memory savings though. Did we figure this out?
Note You need to log in before you can comment on or make changes to this bug.