[Security] Implement the context switch for COOP. #21191
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This CL lands the Cross-Origin-Opener-Policy "changes to navigation",
as per: https://gist.github.com/annevk/6f2dd8c79c77123f39797f6bdac43f3e
In practice, it forces a BrowsingInstance switch when we have a COOP
mismatch. This is necessary but not sufficient, as we want to ensure
the following behavior:
(1) window.open() returned WindowProxy is closed when we know that we
need to switch.
(2) opener is null in opened popups.
(3) window.name is empty in opened popups.
This CL solves (2). Currently (1) is untested and will follow in
a different patch (tests under development by pmeuleman@ at
#21161) and (2) needs to
be updated with some other state in DidCommit.
Bug: 922191
Change-Id: I7d5169f7d53bfc28ea01a1a03c7658e0645bc492
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1985013
Commit-Queue: Arthur Hemery <ahemery@chromium.org>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#736344}