Closed Bug 1811882 Opened 2 years ago Closed 2 years ago

Merge BodyStream and InputToReadableStreamAlgorithms

Categories

(Core :: DOM: Streams, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
116 Branch
Tracking Status
firefox-esr115 --- fixed
firefox116 --- fixed

People

(Reporter: jesup, Assigned: saschanaz)

References

(Blocks 2 open bugs)

Details

Attachments

(5 files, 4 obsolete files)

48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review

This is more generic than Bodys (i.e. wider utility than in Fetch alone). I'm going to be using it in WebTransport, for example.

Name can be bikeshedded over...

This will be followed by adding a OutgoingByteStream

Should we move the files to dom/streams?

Assignee: nobody → rjesup
Status: NEW → ASSIGNED
Blocks: 1811905
See Also: → 1813011
Attachment #9313612 - Attachment description: Bug 1811882: change the name BodyStream to IncomingByteStream r=saschanaz,mgaudet → Bug 1811882: change the name BodyStream to InputToReadableStream r=saschanaz,mgaudet
Attachment #9313612 - Attachment is obsolete: true

We now have InputToReadableStreamAlgorithms added by bug 1815997.

Depends on: 1815997
Summary: Rename BodyStream to IncomingByteStream → Merge BodyStream and InputToReadableStreamAlgorithms
Assignee: rjesup → krosylight
Depends on: 1826537
Depends on: 1832326

So that it can be created without having ReadableStream first. (ReadableStream::Create also requires an algorithm, creating a mutual dependency.)

Depends on D178356

Wraps an nsIInputStream if it's not async, for blobs for example.

Depends on D178357

All existing GetBodyStreamHolder call is consciously done on unread streams, either to simply detect nsIInputStream-based streams or to get the internal nsIInputStream. The function can directly return nsIInputStream to fulfill the existing purposes.

Depends on D178358

Depends on: 1813013
Attachment #9334661 - Attachment description: WIP: Bug 1811882 - Part 2: Implement NonAsyncInputToReadableStreamAlgorithms → WIP: Bug 1811882 - Part 1: Implement NonAsyncInputToReadableStreamAlgorithms
Attachment #9334662 - Attachment description: WIP: Bug 1811882 - Part 3: Implement ReadableStream::MabyGetInputStreamIfUnread → WIP: Bug 1811882 - Part 2: Implement ReadableStream::MabyGetInputStreamIfUnread
Attachment #9334663 - Attachment description: WIP: Bug 1811882 - Part 4: Remove BodyStream in favor of InputToReadableStreamAlgorithms → WIP: Bug 1811882 - Part 3: Remove BodyStream in favor of InputToReadableStreamAlgorithms
Attachment #9334660 - Attachment is obsolete: true
Depends on: 1834800
Attachment #9334663 - Attachment description: WIP: Bug 1811882 - Part 3: Remove BodyStream in favor of InputToReadableStreamAlgorithms → WIP: Bug 1811882 - Part 5: Remove BodyStream in favor of InputToReadableStreamAlgorithms
Attachment #9334661 - Attachment description: WIP: Bug 1811882 - Part 1: Implement NonAsyncInputToReadableStreamAlgorithms → Bug 1811882 - Part 1: Implement NonAsyncInputToReadableStreamAlgorithms r=smaug
Attachment #9334662 - Attachment description: WIP: Bug 1811882 - Part 2: Implement ReadableStream::MabyGetInputStreamIfUnread → Bug 1811882 - Part 2: Implement ReadableStream::MabyGetInputStreamIfUnread r=smaug
Attachment #9335880 - Attachment description: WIP: Bug 1811882 - Part 3: Use NonAsyncInputToReadableStreamAlgorithms for Blob::Stream() → Bug 1811882 - Part 3: Use NonAsyncInputToReadableStreamAlgorithms for Blob::Stream() r=smaug
Attachment #9335881 - Attachment description: WIP: Bug 1811882 - Part 4: Use NonAsyncInputToReadableStreamAlgorithms for FetchBody::GetBody() → Bug 1811882 - Part 4: Use NonAsyncInputToReadableStreamAlgorithms for FetchBody::GetBody() r=smaug
Attachment #9334663 - Attachment description: WIP: Bug 1811882 - Part 5: Remove BodyStream in favor of InputToReadableStreamAlgorithms → Bug 1811882 - Part 5: Remove BodyStream in favor of InputToReadableStreamAlgorithms r=smaug
Attachment #9334662 - Attachment description: Bug 1811882 - Part 2: Implement ReadableStream::MabyGetInputStreamIfUnread r=smaug → Bug 1811882 - Part 2: Implement ReadableStream::MaybeGetInputStreamIfUnread r=smaug
See Also: → 1835390

So that it can be created without having ReadableStream first. (ReadableStream::Create also requires an algorithm, creating a mutual dependency.)

Depends on D178356

Attachment #9335880 - Attachment description: Bug 1811882 - Part 3: Use NonAsyncInputToReadableStreamAlgorithms for Blob::Stream() r=smaug → Bug 1811882 - Part 4: Use InputToReadableStreamAlgorithms for Blob::Stream() r=smaug
Attachment #9335881 - Attachment description: Bug 1811882 - Part 4: Use NonAsyncInputToReadableStreamAlgorithms for FetchBody::GetBody() r=smaug → Bug 1811882 - Part 5: Use InputToReadableStreamAlgorithms for FetchBody::GetBody() r=smaug
Attachment #9334663 - Attachment description: Bug 1811882 - Part 5: Remove BodyStream in favor of InputToReadableStreamAlgorithms r=smaug → Bug 1811882 - Part 6: Remove BodyStream in favor of InputToReadableStreamAlgorithms r=smaug
Attachment #9334661 - Attachment is obsolete: true
Attachment #9334661 - Attachment is obsolete: false
Attachment #9335880 - Attachment description: Bug 1811882 - Part 4: Use InputToReadableStreamAlgorithms for Blob::Stream() r=smaug → Bug 1811882 - Part 3: Use NonAsyncInputToReadableStreamAlgorithms for Blob::Stream() r=smaug
Attachment #9335881 - Attachment description: Bug 1811882 - Part 5: Use InputToReadableStreamAlgorithms for FetchBody::GetBody() r=smaug → Bug 1811882 - Part 4: Use NonAsyncInputToReadableStreamAlgorithms for FetchBody::GetBody() r=smaug
Attachment #9334663 - Attachment description: Bug 1811882 - Part 6: Remove BodyStream in favor of InputToReadableStreamAlgorithms r=smaug → Bug 1811882 - Part 5: Remove BodyStream in favor of InputToReadableStreamAlgorithms r=smaug
Attachment #9336721 - Attachment is obsolete: true
Attachment #9336722 - Attachment is obsolete: true
Pushed by krosylight@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/dbeb3860cd2b Part 1: Implement NonAsyncInputToReadableStreamAlgorithms r=smaug https://hg.mozilla.org/integration/autoland/rev/745388791f89 Part 2: Implement ReadableStream::MaybeGetInputStreamIfUnread r=smaug https://hg.mozilla.org/integration/autoland/rev/fb42e76c846c Part 3: Use NonAsyncInputToReadableStreamAlgorithms for Blob::Stream() r=smaug https://hg.mozilla.org/integration/autoland/rev/19391f5cd47e Part 4: Use NonAsyncInputToReadableStreamAlgorithms for FetchBody::GetBody() r=smaug https://hg.mozilla.org/integration/autoland/rev/8dc3bd71e12a Part 5: Remove BodyStream in favor of InputToReadableStreamAlgorithms r=smaug

Comment on attachment 9335881 [details]
Bug 1811882 - Part 4: Use NonAsyncInputToReadableStreamAlgorithms for FetchBody::GetBody() r=smaug

ESR Uplift Approval Request

  • If this is not a sec:{high,crit} bug, please state case for ESR consideration: We see some weird behavior that this bug may have fixed.
  • User impact if declined: Not clear, for now this is a speculative request.
  • Fix Landed on Version: 116
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): It's been quite stable in beta and requires no manual change to land in ESR.
Attachment #9335881 - Flags: approval-mozilla-esr115?
Attachment #9334661 - Flags: approval-mozilla-esr115?
Attachment #9334662 - Flags: approval-mozilla-esr115?
Attachment #9334663 - Flags: approval-mozilla-esr115?
Attachment #9335880 - Flags: approval-mozilla-esr115?
See Also: → CVE-2023-3600

Comment on attachment 9334661 [details]
Bug 1811882 - Part 1: Implement NonAsyncInputToReadableStreamAlgorithms r=smaug

Approved for 115.1esr

Attachment #9334661 - Flags: approval-mozilla-esr115? → approval-mozilla-esr115+
Attachment #9334662 - Flags: approval-mozilla-esr115? → approval-mozilla-esr115+
Attachment #9334663 - Flags: approval-mozilla-esr115? → approval-mozilla-esr115+
Attachment #9335880 - Flags: approval-mozilla-esr115? → approval-mozilla-esr115+
Attachment #9335881 - Flags: approval-mozilla-esr115? → approval-mozilla-esr115+

Backed out for causing build bustages in Fetch.cpp

  • Backout link
  • Push with failures
  • Failure Log
  • Failure line: /builds/worker/checkouts/gecko/dom/fetch/Fetch.cpp:1479:28: error: arguments must all be strong refs or caller's parameters when calling a function marked as MOZ_CAN_RUN_SCRIPT (including the implicit object argument). 'DerivedClass()->GetParentObject()' is neither.
Flags: needinfo?(krosylight)

Nominated bug 1819124 for this.

Flags: needinfo?(krosylight)
See Also: CVE-2023-3600
Regressions: 1849860
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: