Portals: separate contents lifetime from element lifetime. #18919
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.
A portal contents briefly has some work to do after the activate()
operation is called, but from a spec perspective this operation
detaches from the <portal> element and should be largely independent
of it from that point onward.
To express this separation between the element which hosts the
WebContents and the management of the WebContents itself
(in the renderer process), this breaks HTMLPortalElement into two
classes, one for each.
DocumentPortals then needs only to track the existing contents,
and HTMLPortalElement doesn't need to keep around an is_activating_
boolean, as it no longer has guest contents the moment activation
begins.
For convenience, PortalContents is directly aware of whether it is
in an element, since communication back to the element is still
required and implementing a PortalContentsClient interface seems
like overkill at this point.
Bug: 964481
Change-Id: I9b394e34f64b891fe013f7ae48a8aaf00ed06d30
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1789466
Commit-Queue: Jeremy Roman <jbroman@chromium.org>
Reviewed-by: Lucas Gadani <lfg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#695882}