Bump the WebPage's identifier every time we process-swap. This will avoid confusion with IPC messages when swapping back and forth between WebContent process. This will also allow us to keep a suspended WebPage (for PageCache) in a WebProcess that is used for a new load of the same WebPageProxy.
🥳
Does this mean there will no longer be two WebPages in the same process with the same identifier? What are we going to do about things in the NetworkProcess that use a PageIdentifier (such as ResourceLoadStatistics)?
(In reply to Alex Christensen from comment #2) > Does this mean there will no longer be two WebPages in the same process with > the same identifier? We already closed the previous page if it had the same identifier as the new page. That said, the old page could indeed still live for a while after getting closed. Once we bump page ids, this should no longer happen, and we also would not need to close the previous page in the process if it is useful (e.g. for page cache). > What are we going to do about things in the NetworkProcess that use a > PageIdentifier (such as ResourceLoadStatistics)? That's a good question, I need to look into those particular cases. My best is that they would need to use PageIdentifier and not WebPageProxyIdentifier since they are associated with specific WebCore loads.
Created attachment 377595 [details] WIP Patch
Created attachment 377596 [details] WIP Patch
Created attachment 377606 [details] WIP Patch
Created attachment 377612 [details] WIP Patch
Created attachment 377619 [details] WIP Patch
Created attachment 377622 [details] WIP Patch
Created attachment 377627 [details] WIP Patch
Created attachment 377629 [details] Patch
Created attachment 377633 [details] Patch
Created attachment 377646 [details] Patch
Comment on attachment 377646 [details] Patch Ready for review.
Comment on attachment 377646 [details] Patch Looks like good progress. As discussed, it would be good to eventually have WebPageProxy with the same lifetime as the WebPage, and have a separate (browsing context) object that stays the same over navigations. The current WebPageProxyIdentifier would then become the identifier of the latter object.
Comment on attachment 377646 [details] Patch Clearing flags on attachment: 377646 Committed r249329: <https://trac.webkit.org/changeset/249329>
All reviewed patches have been landed. Closing bug.
<rdar://problem/54884961>