COOP: restrict-properties 3/*: CoopRelatedGroup
This is the core patch of the COOP: restrict-properties implementation. It introduces an important abstraction, the CoopRelatedGroup. It represents a grouping of BrowsingContext groups (BrowsingInstance) that are capable of a limited set of asynchronous interactions, namely postMessage and closed. It is built as closely as possible to how BrowsingInstance is built on SiteInstance: - It is fully private, and interacted with through SiteInstance and BrowsingInstance. SiteInstance exposes a single new method, GetCoopRelatedSiteInstance(), that works similarly to the GetRelatedSiteInstance() method, but at the CoopRelatedGroup level. - It is collectively owned by the BrowsingInstances that are part of it. A register/unregister mechanism is used to know about the BrowsingInstances that are still part of the group. - It might reuse an existing BrowsingInstance when necessary, similar to how SiteInstance's are reused within a BrowsingInstance. To support BrowsingInstance reuse, some information needs to be available to the CoopRelatedGroup when doing the selection. In particular it needs to know whether the BrowsingInstance hosts COOP: restrict-properties pages, and from which origin. We record that information from the NavigationRequest into UrlInfo. The SiteInstance picking algorithm is updated to output a SiteInstance created via GetCoopRelatedSiteInstance() when a BrowsingContextGroupSwap::kCoopRelatedSwap is requested. Added browser tests and unit tests cover the newly introduced code. Bug: 1221127, 1385827 Change-Id: Ief8436b5d532b6aadc5d9a29d94346e3fae2641c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3948564 Commit-Queue: Arthur Hemery <ahemery@chromium.org> Reviewed-by:Charlie Reis <creis@chromium.org> Cr-Commit-Position: refs/heads/main@{#1112861}
Loading
Please register or sign in to comment