[webkit-changes] [WebKit/WebKit] 19836c: Use NativePromise chaining in place of operations ...

Jean-Yves Avenard noreply at github.com
Wed Nov 15 22:15:36 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 19836c74aa9f0c3783d5c3f3e9b8b9e3b415afd6
      https://github.com/WebKit/WebKit/commit/19836c74aa9f0c3783d5c3f3e9b8b9e3b415afd6
  Author: Jean-Yves Avenard <jya at apple.com>
  Date:   2023-11-15 (Wed, 15 Nov 2023)

  Changed paths:
    M Source/WebCore/platform/graphics/SourceBufferPrivate.cpp
    M Source/WebCore/platform/graphics/SourceBufferPrivate.h
    M Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h
    M Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm
    M Source/WebCore/platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp
    M Source/WebCore/platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h

  Log Message:
  -----------
  Use NativePromise chaining in place of operations queue in SourceBufferPrivate
https://bugs.webkit.org/show_bug.cgi?id=264854
rdar://118429088

Reviewed by Jer Noble.

By using promise chaining we can remove the need for an operations queue to serialise the tasks.
It also makes the code easier to read/follow as the entire appendBuffer operation is now available at a
glance.
This will simplify making SourceBufferPrivate::append/removeCodedFrames be made asynchronous and use
NativePromise.

* Source/WebCore/platform/graphics/SourceBufferPrivate.cpp:
(WebCore::SourceBufferPrivate::didReceiveInitializationSegment):
(WebCore::SourceBufferPrivate::didUpdateFormatDescriptionForTrackId):
(WebCore::SourceBufferPrivate::didReceiveSample):
(WebCore::SourceBufferPrivate::append):
(WebCore::SourceBufferPrivate::processPendingMediaSamples):
(WebCore::SourceBufferPrivate::processMediaSample):
(WebCore::SourceBufferPrivate::resetParserState):
(WebCore::SourceBufferPrivate::memoryPressure):
(WebCore::SourceBufferPrivate::~SourceBufferPrivate): Deleted.
(WebCore::SourceBufferPrivate::advanceOperationState): Deleted.
(WebCore::SourceBufferPrivate::rewindOperationState): Deleted.
(WebCore::SourceBufferPrivate::processAppendCompletedOperation): Deleted.
(WebCore::SourceBufferPrivate::queueOperation): Deleted.
(WebCore::SourceBufferPrivate::processPendingOperations): Deleted.
(WebCore::SourceBufferPrivate::abortPendingOperations): Deleted.
(WebCore::SourceBufferPrivate::processError): Deleted.
(WebCore::SourceBufferPrivate::processInitOperation): Deleted.
(WebCore::SourceBufferPrivate::processMediaSamplesOperation): Deleted.
* Source/WebCore/platform/graphics/SourceBufferPrivate.h:
* Source/WebCore/platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp:
(WebCore::SourceBufferPrivateGStreamer::didReceiveAllPendingSamples): Test that the promise wasn't previously resolved.
fallout from bug 264847.
(WebCore::SourceBufferPrivateGStreamer::appendParsingFailed):

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




More information about the webkit-changes mailing list