-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use typed promises/resolvers for ReadableStream and related classes, …
…attempt #3 This converts IDL-exposed promises in ReadableStream, ReadableStreamBYOBReader, ReadableStreamDefaultReader, and ReadableStreamGenericReader to use typed ScriptPromiseResolver instead of StreamPromiseResolver and to return typed ScriptPromises. Bug: 329702363 Change-Id: I8ad1af1a7c9c909d711881ce7621c6c9fac58931 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5429731 Reviewed-by: Adam Rice <ricea@chromium.org> Reviewed-by: Nidhi Jaju <nidhijaju@chromium.org> Commit-Queue: Nate Chapin <japhet@chromium.org> Cr-Commit-Position: refs/heads/main@{#1289397}
- Loading branch information
1 parent
2f45407
commit 26d9744
Showing
4 changed files
with
37 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<!DOCTYPE html> | ||
<body> | ||
<script> | ||
window.onload = () => { | ||
const i = document.createElement("iframe"); | ||
i.src = "about:blank"; | ||
document.body.appendChild(i); | ||
|
||
const rs = new i.contentWindow.ReadableStream({ | ||
start(controller) { controller.error(); } | ||
}); | ||
const ws = new i.contentWindow.WritableStream(); | ||
|
||
i.remove(); | ||
|
||
// pipeTo() should not crash with a ReadableStream or WritableStream from | ||
// a detached iframe. | ||
rs.pipeTo(ws); | ||
}; | ||
</script> | ||
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!doctype html> | ||
<body> | ||
<script> | ||
const i = document.createElement("iframe"); | ||
document.body.appendChild(i); | ||
|
||
const rs = new i.contentWindow.ReadableStream(); | ||
i.remove(); | ||
|
||
// tee() on a ReadableStream from a detached iframe should not crash. | ||
rs.tee(); | ||
</script> | ||
</body> |