Response body should be marked as used if used as stream

RESOLVED FIXED in Firefox 61

Status

()

enhancement
RESOLVED FIXED
Last year
3 months ago

People

(Reporter: baku, Assigned: baku)

Tracking

58 Branch
mozilla61
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox61 fixed)

Details

Attachments

(1 attachment)

Assignee

Description

Last year
Currently this is not true. We use an internal readableStream object to know if the stream is in use, but eventually that readableStream is released and the body becomes 'reusable'.
Assignee

Comment 1

Last year
Here a patch where the stream is marked as used at the first call of RequestDataCallback.
Attachment #8959380 - Flags: review?(till)
Assignee

Updated

Last year
Blocks: 1445587
Comment on attachment 8959380 [details] [diff] [review]
stream_timeout.patch

Review of attachment 8959380 [details] [diff] [review]:
-----------------------------------------------------------------

Makes sense to me, but note that I'm not a DOM reviewer. This seems simple enough that my r+ might be enough, but if you're unsure about that, perhaps get another review?

In any case, r=me with nits addressed.

::: dom/fetch/Fetch.h
@@ +245,5 @@
>  
> +  void
> +  MarkAsRead() override
> +  {
> +    mBodyUsed = true;

Should this have an assert that the stream's state is `eInitialize`?

::: dom/fetch/FetchStream.h
@@ +90,5 @@
>    // Common methods
>  
>    enum State {
> +    // This is the beginning state before any reading operation.
> +    eInitialize,

This name seems a bit confusing because "initialize" isn't really a state. Should it perhaps be eInitializing or eUninitialized? From the current name I'm not sure which of those would be more correct.
Attachment #8959380 - Flags: review?(till) → review+

Comment 3

Last year
Pushed by amarchesini@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/947cf2126bb3
Response body should be marked as used if used as stream, r=till

Comment 4

Last year
bugherder
https://hg.mozilla.org/mozilla-central/rev/947cf2126bb3
Status: NEW → RESOLVED
Closed: Last year
Resolution: --- → FIXED
Target Milestone: --- → mozilla61
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.