Script implement TransformStream and TransformStreamDefaultController#36739
Conversation
gterzian
left a comment
There was a problem hiding this comment.
Looks good overall, I think I have found the reason for the timeouts you mentioned earlier.
6d3252f to
a2f9d69
Compare
|
🔨 Triggering try run (#14786276365) for Linux (WPT) |
|
|
a2f9d69 to
93514d4
Compare
|
🔨 Triggering try run (#14792811506) for Linux (WPT) |
|
Test results for linux-wpt from try job (#14792811506): Flaky unexpected result (15)
Stable unexpected results that are known to be intermittent (16)
Stable unexpected results (111)
|
|
|
93514d4 to
e042d85
Compare
|
🔨 Triggering try run (#14799657436) for Linux (WPT) |
|
Test results for linux-wpt from try job (#14799657436): Flaky unexpected result (20)
Stable unexpected results that are known to be intermittent (15)
Stable unexpected results (109)
|
|
|
e042d85 to
47aab82
Compare
|
🔨 Triggering try run (#14804808853) for Linux (WPT) |
|
Test results for linux-wpt from try job (#14804808853): Flaky unexpected result (27)
Stable unexpected results that are known to be intermittent (14)
Stable unexpected results (19)
|
|
|
47aab82 to
93f7c84
Compare
|
🔨 Triggering try run (#14891053852) for Linux (WPT) |
|
Test results for linux-wpt from try job (#14891053852): Flaky unexpected result (17)
Stable unexpected results that are known to be intermittent (15)
Stable unexpected results (1)
|
|
|
Signed-off-by: Taym Haddadi <[email protected]>
Signed-off-by: Taym Haddadi <[email protected]>
Signed-off-by: Taym Haddadi <[email protected]>
Signed-off-by: Taym Haddadi <[email protected]>
Signed-off-by: gterzian <[email protected]>
Signed-off-by: Taym Haddadi <[email protected]>
Signed-off-by: Taym Haddadi <[email protected]>
Signed-off-by: Taym Haddadi <[email protected]>
Signed-off-by: Taym Haddadi <[email protected]>
6b246ac to
146aed0
Compare
| #[ignore_malloc_size_of = "mozjs"] | ||
| chunk: Box<Heap<JSVal>>, | ||
|
|
||
| writable: Dom<WritableStream>, |
There was a problem hiding this comment.
/// The writable used in the fulfillment steps
See also other member below.
| // Return ! TransformStreamDefaultControllerPerformTransform(controller, chunk). | ||
| rooted!(in(*cx) let mut chunk = UndefinedValue()); | ||
| chunk.set(self.chunk.get()); | ||
|
|
There was a problem hiding this comment.
I don't think we need a space here, since all of these are part of the above spec step.
| can_gc, | ||
| ) | ||
| .expect("perform transform failed"); | ||
|
|
There was a problem hiding this comment.
let's add a note that those rejection and fulfillment hanlders do not have to be rooted because they only contain an Rc.
|
|
||
| #[derive(JSTraceable, MallocSizeOf)] | ||
| #[cfg_attr(crown, crown::unrooted_must_root_lint::must_root)] | ||
| struct PerformTransformFulfillment { |
There was a problem hiding this comment.
Would be good to document this and the ones below with links to the spec like is done with other types of handlers.
| } | ||
|
|
||
| impl js::gc::Rootable for FlushPromiseFulfillment {} | ||
| /// Reacting to fulfillment of the flushpromise as part of |
There was a problem hiding this comment.
A space between the impl and the docs would be good.
| // Perform ! TransformStreamDefaultControllerClearAlgorithms(controller). | ||
| controller.clear_algorithms(); | ||
|
|
||
| // React to cancelPromise: |
| transformer_obj.handle(), | ||
| &transformer_dict, | ||
| can_gc, | ||
| ); |
There was a problem hiding this comment.
Note that a ? in the spec would point to a ? here, but I guess it is not noticeable. Perhaps just add a note for now, or file an issue to clean this up across the streams implementation later.
| .error(cx, &self.controller.global(), v, can_gc); | ||
|
|
||
| // Throw r. | ||
| // Note: this is dont on perform_transform() |
| can_gc, | ||
| ); | ||
|
|
||
| match call_result { |
There was a problem hiding this comment.
I would not add a space here(and elsewhere).
| /// <https://streams.spec.whatwg.org/#ts-default-controller-enqueue> | ||
| fn Enqueue(&self, cx: SafeJSContext, chunk: SafeHandleValue, can_gc: CanGc) -> Fallible<()> { | ||
| // Perform ? TransformStreamDefaultControllerEnqueue(this, chunk). | ||
| self.enqueue(cx, &self.global(), chunk, can_gc) |
There was a problem hiding this comment.
For example here, not how the spec uses ? and we also follow that by propagating the error? So we should do that consistently.
…e" and Fix doc and comments Signed-off-by: Taym Haddadi <[email protected]>
21311cb to
d1f4dc0
Compare
Signed-off-by: Taym <[email protected]>
Part of #34676 #36739 needs to be merged first. --------- Signed-off-by: Taym Haddadi <[email protected]>
Part of #34676