[webkit-changes] [WebKit/WebKit] 787ad7: Refactor ReadableStream like done for WritableStream

youennf noreply at github.com
Wed Nov 30 02:06:51 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 787ad7f7407a09a5c9ce390b3dfcf1b2337ef087
      https://github.com/WebKit/WebKit/commit/787ad7f7407a09a5c9ce390b3dfcf1b2337ef087
  Author: Youenn Fablet <youennf at gmail.com>
  Date:   2022-11-30 (Wed, 30 Nov 2022)

  Changed paths:
    M LayoutTests/imported/w3c/web-platform-tests/streams/idlharness.any-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/streams/idlharness.any.serviceworker-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/streams/idlharness.any.worker-expected.txt
    M Source/WebCore/CMakeLists.txt
    M Source/WebCore/DerivedSources.make
    M Source/WebCore/Modules/fetch/FetchBody.cpp
    M Source/WebCore/Modules/fetch/FetchBodyOwner.cpp
    M Source/WebCore/Modules/mediastream/RTCRtpSFrameTransform.cpp
    A Source/WebCore/Modules/streams/ReadableStream.cpp
    A Source/WebCore/Modules/streams/ReadableStream.h
    M Source/WebCore/Modules/streams/ReadableStream.idl
    R Source/WebCore/Modules/streams/ReadableStream.js
    M Source/WebCore/Modules/streams/ReadableStreamBYOBReader.js
    M Source/WebCore/Modules/streams/ReadableStreamDefaultReader.js
    M Source/WebCore/Modules/streams/ReadableStreamInternals.js
    M Source/WebCore/Modules/streams/TransformStreamDefaultController.js
    M Source/WebCore/Modules/streams/TransformStreamInternals.js
    M Source/WebCore/Modules/streams/WritableStream.idl
    M Source/WebCore/Sources.txt
    M Source/WebCore/WebCore.xcodeproj/project.pbxproj
    A Source/WebCore/bindings/js/InternalReadableStream.cpp
    A Source/WebCore/bindings/js/InternalReadableStream.h
    M Source/WebCore/bindings/js/JSDOMGlobalObject.cpp
    R Source/WebCore/bindings/js/ReadableStream.cpp
    R Source/WebCore/bindings/js/ReadableStream.h
    M Source/WebCore/bindings/js/WebCoreBuiltinNames.h
    M Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
    M Source/WebCore/fileapi/Blob.cpp
    M Source/WebCore/testing/Internals.cpp
    M Source/WebCore/testing/Internals.h
    M Source/WebCore/testing/Internals.idl

  Log Message:
  -----------
  Refactor ReadableStream like done for WritableStream
https://bugs.webkit.org/show_bug.cgi?id=248307
rdar://problem/102648417

Reviewed by Alex Christensen.

This improves consistency between the two code paths and allows to reuse more of the binding generator.
A future step will be to add async iterable to ReadableStream.

* LayoutTests/imported/w3c/web-platform-tests/streams/idlharness.any-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/streams/idlharness.any.serviceworker-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/streams/idlharness.any.worker-expected.txt:
* Source/WebCore/CMakeLists.txt:
* Source/WebCore/DerivedSources.make:
* Source/WebCore/Modules/fetch/FetchBody.cpp:
(WebCore::FetchBody::extract):
(WebCore::FetchBody::clone):
* Source/WebCore/Modules/fetch/FetchBodyOwner.cpp:
(WebCore::FetchBodyOwner::isDisturbed const):
(WebCore::FetchBodyOwner::isDisturbedOrLocked const):
(WebCore::FetchBodyOwner::createReadableStream):
* Source/WebCore/Modules/mediastream/RTCRtpSFrameTransform.cpp:
(WebCore::RTCRtpSFrameTransform::isAttached const):
(WebCore::RTCRtpSFrameTransform::createStreams):
* Source/WebCore/Modules/streams/ReadableStream.cpp: Added.
(WebCore::ReadableStream::create):
(WebCore::ReadableStream::createFromJSValues):
(WebCore::ReadableStream::ReadableStream):
(WebCore::ReadableStream::tee):
(WebCore::JSReadableStream::cancel):
(WebCore::JSReadableStream::getReader):
(WebCore::JSReadableStream::pipeTo):
(WebCore::JSReadableStream::pipeThrough):
* Source/WebCore/Modules/streams/ReadableStream.h: Copied from Source/WebCore/Modules/streams/WritableStream.h.
(WebCore::ReadableStream::lock):
(WebCore::ReadableStream::locked const):
(WebCore::ReadableStream::disturbed const):
(WebCore::ReadableStream::cancel):
(WebCore::ReadableStream::pipeTo):
(WebCore::ReadableStream::internalReadableStream):
* Source/WebCore/Modules/streams/ReadableStream.idl:
* Source/WebCore/Modules/streams/ReadableStream.js: Removed.
* Source/WebCore/Modules/streams/ReadableStreamBYOBReader.js:
(initializeReadableStreamBYOBReader):
* Source/WebCore/Modules/streams/ReadableStreamInternals.js:
(createInternalReadableStreamFromUnderlyingSource):
(readableStreamGetReaderForBindings):
(readableStreamCancelForBindings):
(readableStreamPipeThroughForBindings):
(readableStreamPipeToForBindings):
(readableStreamTee):
* Source/WebCore/Modules/streams/TransformStreamDefaultController.js:
(getter.desiredSize):
* Source/WebCore/Modules/streams/TransformStreamInternals.js:
(initializeTransformStream):
(transformStreamError):
(transformStreamDefaultControllerEnqueue):
(transformStreamDefaultControllerTerminate):
(transformStreamDefaultSinkCloseAlgorithm):
* Source/WebCore/Modules/streams/WritableStream.h:
* Source/WebCore/Modules/streams/WritableStream.idl:
* Source/WebCore/Sources.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/bindings/js/InternalReadableStream.cpp: Added.
(WebCore::invokeReadableStreamFunction):
(WebCore::InternalReadableStream::createFromUnderlyingSource):
(WebCore::InternalReadableStream::fromObject):
(WebCore::InternalReadableStream::locked const):
(WebCore::InternalReadableStream::disturbed const):
(WebCore::InternalReadableStream::cancel):
(WebCore::InternalReadableStream::lock):
(WebCore::InternalReadableStream::pipeTo):
(WebCore::InternalReadableStream::tee):
(WebCore::InternalReadableStream::getReader):
(WebCore::InternalReadableStream::pipeThrough):
* Source/WebCore/bindings/js/InternalReadableStream.h: Added.
* Source/WebCore/bindings/js/JSDOMGlobalObject.cpp:
(WebCore::JSC_DEFINE_HOST_FUNCTION):
(WebCore::JSDOMGlobalObject::addBuiltinGlobals):
* Source/WebCore/bindings/js/ReadableStream.cpp: Removed.
* Source/WebCore/bindings/js/ReadableStream.h: Removed.
* Source/WebCore/bindings/js/WebCoreBuiltinNames.h:
* Source/WebCore/bindings/scripts/CodeGeneratorJS.pm:
(AddToIncludesForIDLType):
* Source/WebCore/fileapi/Blob.cpp:
(WebCore::Blob::stream):
* Source/WebCore/testing/Internals.cpp:
(WebCore::Internals::isReadableStreamDisturbed):
* Source/WebCore/testing/Internals.h:
* Source/WebCore/testing/Internals.idl:

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




More information about the webkit-changes mailing list