-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Use NativePromise chaining in place of operations queue in SourceBufferPrivate #20516
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
EWS run on previous version of this PR (hash 61a0298) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
optional
and Vector.h
don't appear to be used in the header. Can these be removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
they were used, I added them because compilation broke elsewhere following unified build changes.
We have Vector<PlatformTimeRanges> activeRanges()
method .
and we have std::optional<SeekTarget> m_pendingSeekTarget;
class member
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This pattern is repeated a lot; I assume that -1
will be replaced with a PlatformMediaError
in a future patch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes... The "PR#4" adds PlatformMediaError and those are replaced everywhere
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like this could just be removed entirely.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes indeed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be -1
? (Or it doesn't matter because this will be a PlatformMediaError
in the future.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the optional.h from above needs to move here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like sendWithPromisedReply(...)
should have a variant that doesn't take a lambda, and just creates and returns a GenericPromise
with the result.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sendWithPromisedReply
doesn't take anything, it returns a NativePromise. You don't have to act on the promise
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue is returning the IPC error code; this wasn't handled before, and code always assumed that sending an IPC message was successful. We needed a way to pass that error. Merging the error code with the PlatformMediaError would be nice, but I don't know how that will play for consistency.
sendWithMediaPromisedReply
could do that maybe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto here. For a result that's an optional<>
, it could create or reject based on whether the optional has a value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the result is an Expected<T, U>
The IPC Promise wraps the type set in the messages.in file, and an IPCError as exception.
It forces you to deal with the error if there's one.
61a0298
to
506ce07
Compare
EWS run on current version of this PR (hash 506ce07)
|
EWS run on previous version of this PR (hash 506ce07)
|
506ce07
to
4db2465
Compare
EWS run on previous version of this PR (hash 4db2465)
|
4db2465
to
8a6a086
Compare
EWS run on previous version of this PR (hash 8a6a086)
|
8a6a086
to
9aedfbe
Compare
EWS run on previous version of this PR (hash 9aedfbe)
|
9aedfbe
to
0e53637
Compare
EWS run on previous version of this PR (hash 0e53637)
|
0e53637
to
96a3f81
Compare
EWS run on current version of this PR (hash 96a3f81) |
96a3f81
to
543ec10
Compare
…erPrivate 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
543ec10
to
19836c7
Compare
Committed 270808@main (19836c7): https://commits.webkit.org/270808@main Reviewed commits have been landed. Closing PR #20516 and removing active labels. |
19836c7
96a3f81
🧪 ios-wk2-wpt🧪 mac-AS-debug-wk2