Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Portals: separate contents lifetime from element lifetime. #18919

Merged
merged 1 commit into from Sep 12, 2019

Conversation

chromium-wpt-export-bot
Copy link
Collaborator

@chromium-wpt-export-bot chromium-wpt-export-bot commented Sep 7, 2019

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}

Copy link
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already reviewed downstream.

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}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants