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

Dispatch close event when MessagePort is disentangled #43015

Merged
merged 1 commit into from
Dec 1, 2023

Conversation

chromium-wpt-export-bot
Copy link
Collaborator

@chromium-wpt-export-bot chromium-wpt-export-bot commented Nov 8, 2023

We want to dispatch a close event when an entangled MessagePort is disconnected.
Given a pair of entangled ports, port1 and port2, if port2 is closed at any point,
a port1’s error handler is run.
So we can change an error handler to dispatch a close event.

The tests of close event are as follows:

  1. port was explicitly closed.
  2. owning document was destroyed.
  3. owning document crashed.
  4. port was garbage collected.

Design Doc:https://docs.google.com/document/d/1lXZU2Pk2ycitqj8aL9kxT2aauwXqpA0vJDUalkXA29Y
Explainer:https://github.com/fergald/explainer-messageport-close
HTML spec PR:whatwg/html#9933

Bug: 1495616
Change-Id: I99f9f5a0d7cc63f0916da316ec666ba793215019
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5003089
Reviewed-by: Jeremy Roman <[email protected]>
Commit-Queue: Nonoka Muraki <[email protected]>
Reviewed-by: Ming-Ying Chung <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1231743}

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.

The review process for this patch is being conducted in the Chromium project.

@chromium-wpt-export-bot chromium-wpt-export-bot force-pushed the chromium-export-cl-5003089 branch 6 times, most recently from f99ff08 to 96cebb0 Compare November 15, 2023 04:44
@chromium-wpt-export-bot chromium-wpt-export-bot force-pushed the chromium-export-cl-5003089 branch 8 times, most recently from 3bbd703 to e3cca1d Compare November 22, 2023 08:28
@chromium-wpt-export-bot chromium-wpt-export-bot force-pushed the chromium-export-cl-5003089 branch 2 times, most recently from d4b2548 to 24a273d Compare November 27, 2023 01:10
@chromium-wpt-export-bot chromium-wpt-export-bot changed the title Dispatch a close event Dispatch close event when MessagePort is disentangled Nov 27, 2023
@chromium-wpt-export-bot chromium-wpt-export-bot force-pushed the chromium-export-cl-5003089 branch 3 times, most recently from 8cf04d1 to 3578e85 Compare November 30, 2023 14:37
We want to dispatch a close event when an entangled MessagePort is disconnected.
Given a pair of entangled ports, port1 and port2, if port2 is closed at any point,
a port1’s error handler is run.
So we can change an error handler to dispatch a close event.

The tests of close event are as follows:
1) port was explicitly closed.
2) owning document was destroyed.
3) owning document crashed.
4) port was garbage collected.

Design Doc:https://docs.google.com/document/d/1lXZU2Pk2ycitqj8aL9kxT2aauwXqpA0vJDUalkXA29Y
Explainer:https://github.com/fergald/explainer-messageport-close
HTML spec PR:whatwg/html#9933

Bug: 1495616
Change-Id: I99f9f5a0d7cc63f0916da316ec666ba793215019
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5003089
Reviewed-by: Jeremy Roman <[email protected]>
Commit-Queue: Nonoka Muraki <[email protected]>
Reviewed-by: Ming-Ying Chung <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1231743}
@chromium-wpt-export-bot chromium-wpt-export-bot merged commit dd47f14 into master Dec 1, 2023
12 of 16 checks passed
@chromium-wpt-export-bot chromium-wpt-export-bot deleted the chromium-export-cl-5003089 branch December 1, 2023 05:32
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.

3 participants