Move SuspendedPage logic from WebProcessPool to new WebBackForwardCache class. This is a step towards implementing back / forward cache handling in the UIProcess.
Created attachment 380372 [details] WIP Patch TestWebKitAPI.ProcessSwap.ReuseSuspendedProcessLoadHTMLString is failing. Still needs some cleanup.
Created attachment 380440 [details] Patch
Created attachment 380465 [details] Patch
ping review?
Comment on attachment 380465 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=380465&action=review > Source/WebKit/UIProcess/SuspendedPageProxy.cpp:147 > +void SuspendedPageProxy::setBackForwardListItem(WebBackForwardListItem* item) > +{ > + ASSERT(!m_backForwardListItem || !item); Considering the assert it would be better to divide this into separate set/clear functions (where set takes a reference). > Source/WebKit/UIProcess/SuspendedPageProxy.cpp:149 > + if (m_backForwardListItem) > + process().processPool().backForwardCache().unregisterItemWithCachedPage(*m_backForwardListItem); The only call sites for setBackForwardListItem are in WebBackForwardListItem. Is it odd that registering WebBackForwardListItems is managed here instead of the call sites?
(In reply to Antti Koivisto from comment #5) > Comment on attachment 380465 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=380465&action=review > > > Source/WebKit/UIProcess/SuspendedPageProxy.cpp:147 > > +void SuspendedPageProxy::setBackForwardListItem(WebBackForwardListItem* item) > > +{ > > + ASSERT(!m_backForwardListItem || !item); > > Considering the assert it would be better to divide this into separate > set/clear functions (where set takes a reference). > > > Source/WebKit/UIProcess/SuspendedPageProxy.cpp:149 > > + if (m_backForwardListItem) > > + process().processPool().backForwardCache().unregisterItemWithCachedPage(*m_backForwardListItem); > > The only call sites for setBackForwardListItem are in > WebBackForwardListItem. Is it odd that registering WebBackForwardListItems > is managed here instead of the call sites? Thanks Antti, very useful feedback. I'll make the suggested improvements before landing.
Created attachment 380778 [details] Patch
<rdar://problem/56200933>
Comment on attachment 380778 [details] Patch Clearing flags on attachment: 380778 Committed r251022: <https://trac.webkit.org/changeset/251022>
All reviewed patches have been landed. Closing bug.