-
Notifications
You must be signed in to change notification settings - Fork 164
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
Use an AbortController instead of signaling abort on AbortSignal #1279
Conversation
- Replace WritableStreamDefaultController's [[signal]] with [[AbortController]], using the controller's signal where [[signal]] was used. Signal abort on [[abortController]] rather than the [[signal]]. - Remove the note about specs not signaling abort on the WritableStream's signal, since this won't be possible once AbortSignal's "signal abort" no longer exported.
@annevk how does this look? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you replace the getter with the appropriate reference I think this works. Thanks!
@MattiasBuelens should do the final review though.
index.bs
Outdated
@@ -4508,7 +4508,7 @@ closed. It is only used internally, and is never exposed to web developers. | |||
The <dfn id="ws-default-controller-signal" attribute | |||
for="WritableStreamDefaultController">signal</dfn> getter steps are: | |||
|
|||
1. Return [=this=].[=WritableStreamDefaultController/[[signal]]=]. | |||
1. Return [=this=].[=WritableStreamDefaultController/[[abortController]]=].{{AbortController/signal}}. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to return the value of the "internal slot" and not reference the "public" getter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I understand Bikeshed's autolink syntax correctly, this should do the trick:
1. Return [=this=].[=WritableStreamDefaultController/[[abortController]]=].{{AbortController/signal}}. | |
1. Return [=this=].[=WritableStreamDefaultController/[[abortController]]=].[=AbortController/signal=]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'd have to be something like
1. Return [=this=].[=WritableStreamDefaultController/[[abortController]]=].{{AbortController/signal}}. | |
1. Return [=this=].[=WritableStreamDefaultController/[[abortController]]=]'s [=AbortController/signal=]. |
as we don't define dot syntax for these.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah okay, makes sense. We'll need to export
[=AbortController/signal=] for this to build/link, which I can do along with removing export
from "signal abort".
index.bs
Outdated
@@ -4508,7 +4508,7 @@ closed. It is only used internally, and is never exposed to web developers. | |||
The <dfn id="ws-default-controller-signal" attribute | |||
for="WritableStreamDefaultController">signal</dfn> getter steps are: | |||
|
|||
1. Return [=this=].[=WritableStreamDefaultController/[[signal]]=]. | |||
1. Return [=this=].[=WritableStreamDefaultController/[[abortController]]=].{{AbortController/signal}}. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I understand Bikeshed's autolink syntax correctly, this should do the trick:
1. Return [=this=].[=WritableStreamDefaultController/[[abortController]]=].{{AbortController/signal}}. | |
1. Return [=this=].[=WritableStreamDefaultController/[[abortController]]=].[=AbortController/signal=]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for reviewing! I'll put together the dom changes this depends on.
index.bs
Outdated
@@ -4508,7 +4508,7 @@ closed. It is only used internally, and is never exposed to web developers. | |||
The <dfn id="ws-default-controller-signal" attribute | |||
for="WritableStreamDefaultController">signal</dfn> getter steps are: | |||
|
|||
1. Return [=this=].[=WritableStreamDefaultController/[[signal]]=]. | |||
1. Return [=this=].[=WritableStreamDefaultController/[[abortController]]=].{{AbortController/signal}}. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah okay, makes sense. We'll need to export
[=AbortController/signal=] for this to build/link, which I can do along with removing export
from "signal abort".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm once it builds.
Latest build failure looks like a problem with Bikeshed itself. I've opened speced/bikeshed#2561. |
The new Bikeshed version fixes the build issue, so I think we're good to go! 🙂 |
Instead: - WritableStreamDefaultController has a AbortController - WritableStreamDefaultController::signal() returns the controller's signal - The signal is aborted via AbortController::abort() Spec PR: whatwg/streams#1279 Bug: 1448352 Change-Id: I2abe12b9570b11de0767888a369316d3622c908d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4564333 Commit-Queue: Scott Haseley <shaseley@chromium.org> Reviewed-by: Adam Rice <ricea@chromium.org> Cr-Commit-Position: refs/heads/main@{#1151315}
For whatwg/dom#1194 (and follow-up from #1277).
Preview | Diff