Bug 201225 - [PSON] Bump the WebPage's identifier every time we process-swap
Summary: [PSON] Bump the WebPage's identifier every time we process-swap
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on: 201223 201233 205012
Blocks: 201344
  Show dependency treegraph
 
Reported: 2019-08-28 10:22 PDT by Chris Dumez
Modified: 2019-12-09 08:53 PST (History)
7 users (show)

See Also:


Attachments
WIP Patch (32.43 KB, patch)
2019-08-29 10:31 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
WIP Patch (33.26 KB, patch)
2019-08-29 10:36 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
WIP Patch (47.91 KB, patch)
2019-08-29 12:17 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
WIP Patch (53.39 KB, patch)
2019-08-29 12:40 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
WIP Patch (95.47 KB, patch)
2019-08-29 13:32 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
WIP Patch (95.45 KB, patch)
2019-08-29 13:38 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
WIP Patch (100.84 KB, patch)
2019-08-29 14:38 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (113.06 KB, patch)
2019-08-29 14:52 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (112.69 KB, patch)
2019-08-29 15:24 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (116.42 KB, patch)
2019-08-29 16:00 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2019-08-28 10:22:49 PDT
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.
Comment 1 Tim Horton 2019-08-28 10:27:45 PDT
🥳
Comment 2 Alex Christensen 2019-08-28 11:02:50 PDT
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)?
Comment 3 Chris Dumez 2019-08-29 09:38:31 PDT
(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.
Comment 4 Chris Dumez 2019-08-29 10:31:21 PDT
Created attachment 377595 [details]
WIP Patch
Comment 5 Chris Dumez 2019-08-29 10:36:40 PDT
Created attachment 377596 [details]
WIP Patch
Comment 6 Chris Dumez 2019-08-29 12:17:34 PDT
Created attachment 377606 [details]
WIP Patch
Comment 7 Chris Dumez 2019-08-29 12:40:40 PDT
Created attachment 377612 [details]
WIP Patch
Comment 8 Chris Dumez 2019-08-29 13:32:28 PDT
Created attachment 377619 [details]
WIP Patch
Comment 9 Chris Dumez 2019-08-29 13:38:19 PDT
Created attachment 377622 [details]
WIP Patch
Comment 10 Chris Dumez 2019-08-29 14:38:57 PDT
Created attachment 377627 [details]
WIP Patch
Comment 11 Chris Dumez 2019-08-29 14:52:29 PDT
Created attachment 377629 [details]
Patch
Comment 12 Chris Dumez 2019-08-29 15:24:47 PDT
Created attachment 377633 [details]
Patch
Comment 13 Chris Dumez 2019-08-29 16:00:13 PDT
Created attachment 377646 [details]
Patch
Comment 14 Chris Dumez 2019-08-29 19:42:06 PDT
Comment on attachment 377646 [details]
Patch

Ready for review.
Comment 15 Antti Koivisto 2019-08-30 09:26:15 PDT
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 16 Chris Dumez 2019-08-30 09:34:46 PDT
Comment on attachment 377646 [details]
Patch

Clearing flags on attachment: 377646

Committed r249329: <https://trac.webkit.org/changeset/249329>
Comment 17 Chris Dumez 2019-08-30 09:34:47 PDT
All reviewed patches have been landed.  Closing bug.
Comment 18 Radar WebKit Bug Importer 2019-08-30 09:35:16 PDT
<rdar://problem/54884961>