Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: bbf1903f026b71822e0230b6a602c9a7a5c1db59
      
https://github.com/WebKit/WebKit/commit/bbf1903f026b71822e0230b6a602c9a7a5c1db59
  Author: Youenn Fablet <[email protected]>
  Date:   2025-11-18 (Tue, 18 Nov 2025)

  Changed paths:
    M LayoutTests/platform/mac-wk2/TestExpectations
    M Source/WebCore/Modules/fetch/FetchBodyOwner.cpp
    M Source/WebCore/Modules/streams/ReadableByteStreamController.h
    M Source/WebCore/Modules/streams/ReadableStream.cpp
    M Source/WebCore/Modules/streams/ReadableStream.h
    M Source/WebCore/Modules/streams/ReadableStreamBYOBReader.cpp
    M Source/WebCore/Modules/streams/ReadableStreamBYOBReader.h
    M Source/WebCore/Modules/streams/ReadableStreamBYOBReader.idl
    M Source/WebCore/Modules/streams/ReadableStreamDefaultReader.cpp
    M Source/WebCore/Modules/streams/ReadableStreamDefaultReader.h
    M Source/WebCore/Modules/streams/ReadableStreamDefaultReader.idl
    M Source/WebCore/Modules/streams/StreamTeeUtilities.cpp
    M Source/WebCore/fileapi/Blob.cpp

  Log Message:
  -----------
  REGRESSION(302787@main): [macOS Release wk2] 
fast/files/blob-stream-error.html is a flaky timeout
rdar://164935746
https://bugs.webkit.org/show_bug.cgi?id=302685

Reviewed by Chris Dumez.

When blob is loaded, the stream reader could be GCed.
This lead to read promises to never resolve.

To prevent this, we introduce a byte stream option to 
ReadableStream::createByteStream which marks the stream as reachable from 
opaque roots if pulling.
We do a refactoring to ReadableStream::createByteStream to pass a struct of 
options instead of individual parameters to improve code readability.

The ReadableStream reader (default or byob) implements a custom GC check by 
asking whether its ReadableStream is reachable from opaque roots.

We apply this strategy to Blob and FetchBodySource.
Covered by test no longer being flaky and existing stream tests.

We also align the blob stream source and fetch stream source by keeping the 
byte controller as a WeaKPtr instead of a RefPtr.
This model is better as it removes potential ref cycle (that was broken when 
blob loading finishes or fails previously).
The memory  model is now: ReadableStream reader -> ReadableStream -> 
ReadableStream controller and ReadableStream source.

Canonical link: https://commits.webkit.org/303180@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to