haikuwebkit/Source/WebCore/Modules/mediacapabilities
Chris Dumez 71d6b8214c Drop legacy MainThreadTaskQueue & EventLoopTaskQueue classes
https://bugs.webkit.org/show_bug.cgi?id=226734

Reviewed by Ryosuke Niwa.

Source/WebCore:

Drop legacy MainThreadTaskQueue & EventLoopTaskQueue classes. Code that was using MainThreadTaskQueue
is now calling callOnMainThread() directly. Call that was using EventLoopTaskQueue is now using the
HTML event loop directly. If said code needed to cancel tasks or check if a previously scheduled task
is still pending, it now relies on WTF::CancellableTask / WTF::TaskCancellationGroup to do so.

* Headers.cmake:
* Modules/encryptedmedia/MediaKeySystemAccess.cpp:
* WebCore.xcodeproj/project.pbxproj:
* animation/DocumentTimelinesController.cpp:
(WebCore::DocumentTimelinesController::cacheCurrentTime):
(WebCore::DocumentTimelinesController::maybeClearCachedCurrentTime):
* animation/DocumentTimelinesController.h:
* dom/ActiveDOMObject.h:
* dom/Document.h:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::HTMLMediaElement):
(WebCore::HTMLMediaElement::~HTMLMediaElement):
(WebCore::HTMLMediaElement::scheduleNextSourceChild):
(WebCore::HTMLMediaElement::scheduleCheckPlaybackTargetCompatability):
(WebCore::HTMLMediaElement::seekWithTolerance):
(WebCore::HTMLMediaElement::setVolume):
(WebCore::HTMLMediaElement::scheduleConfigureTextTracks):
(WebCore::HTMLMediaElement::scheduleMediaEngineWasUpdated):
(WebCore::HTMLMediaElement::scheduleUpdatePlayState):
(WebCore::HTMLMediaElement::cancelPendingTasks):
(WebCore::HTMLMediaElement::clearMediaPlayer):
(WebCore::HTMLMediaElement::closeTaskQueues):
(WebCore::HTMLMediaElement::suspend):
(WebCore::HTMLMediaElement::resume):
(WebCore::HTMLMediaElement::virtualHasPendingActivity const):
(WebCore::HTMLMediaElement::markCaptionAndSubtitleTracksAsUnconfigured):
(WebCore::HTMLMediaElement::mediaPlayerBufferedTimeRangesChanged):
(WebCore::HTMLMediaElement::scheduleUpdateMediaState):
(WebCore::HTMLMediaElement::playbackControlsManagerBehaviorRestrictionsTimerFired):
* html/HTMLMediaElement.h:
* platform/GenericTaskQueue.h: Removed.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(-[WebCoreAVFMovieObserver metadataLoaded]):
(-[WebCoreAVFMovieObserver didEnd:]):
(-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
(-[WebCoreAVFMovieObserver legibleOutput:didOutputAttributedStrings:nativeSampleBuffers:forItemTime:]):
(-[WebCoreAVFMovieObserver outputSequenceWasFlushed:]):
(-[WebCoreAVFMovieObserver metadataOutput:didOutputTimedMetadataGroups:fromPlayerItemTrack:]):
(-[WebCoreAVFMovieObserver metadataCollector:didCollectDateRangeMetadataGroups:indexesOfNewGroups:indexesOfModifiedGroups:]):
(-[WebCoreAVFLoaderDelegate resourceLoader:shouldWaitForLoadingOfRequestedResource:]):
(-[WebCoreAVFLoaderDelegate resourceLoader:didCancelLoadingRequest:]):
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::~SourceBufferPrivateAVFObjC):
(WebCore::SourceBufferPrivateAVFObjC::didParseInitializationData):
(WebCore::SourceBufferPrivateAVFObjC::abort):
* platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.h:

Source/WTF:

We recently introduced the WTF::CancellableTask in order to be able to cancel
a pending task in the event loop, and/or check if the task is still pending.
It worked great as a replacement for EventLoopDeferrableTask. However, it was
insufficient as a replacement for task queues (such as MainThreadTaskQueue &
EventLoopTaskQueue) since there was no convenient way to cancel a group of
tasks. To address this, I am introducing WTF::TaskCancellationGroup. Whenever one
needs to create a CancellableTask, it now needs to provide a TaskCancellationGroup.
Several CancellableTask objects can share the same TaskCancellationGroup. Code now
now schedule one or more CancellableTasks on the event loop and hold on
to a TaskCancellationGroup. If they need to cancel those tasks, they can simply
call cancel() on the TaskCancellationGroup. They can also check if previously
scheduled tasks are still pending via TaskCancellationGroup::hasPendingTask().

* wtf/CancellableTask.h:
(WTF::TaskCancellationGroup::TaskCancellationGroup):
(WTF::TaskCancellationGroup::cancel):
(WTF::TaskCancellationGroup::hasPendingTask const):
(WTF::TaskCancellationGroup::Impl::cancel):
(WTF::TaskCancellationGroup::Impl::hasPendingTask const):
(WTF::TaskCancellationGroup::Handle::isCancelled const):
(WTF::TaskCancellationGroup::Handle::Handle):
(WTF::TaskCancellationGroup::createHandle):
(WTF::CancellableTask::CancellableTask):
(WTF::CancellableTask::operator()):
* wtf/WeakPtr.h:
(WTF::WeakPtrFactory::weakPtrCount const):


Canonical link: https://commits.webkit.org/238574@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278580 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-08 00:29:50 +00:00
..
AudioConfiguration.idl Add support for AudioConfiguration.spatialRendering 2020-11-10 19:10:31 +00:00
ColorGamut.idl
HdrMetadataType.idl
MediaCapabilities.cpp Drop legacy MainThreadTaskQueue & EventLoopTaskQueue classes 2021-06-08 00:29:50 +00:00
MediaCapabilities.h Port MediaKeySystemAccess & MediaCapabilities to the HTML event loop 2021-06-04 19:11:56 +00:00
MediaCapabilities.idl Port MediaKeySystemAccess & MediaCapabilities to the HTML event loop 2021-06-04 19:11:56 +00:00
MediaCapabilitiesDecodingInfo.idl
MediaCapabilitiesEncodingInfo.idl
MediaCapabilitiesInfo.idl
MediaConfiguration.idl
MediaDecodingConfiguration.idl
MediaDecodingType.idl
MediaEncodingConfiguration.idl
MediaEncodingType.idl
Navigator+MediaCapabilities.idl
NavigatorMediaCapabilities.cpp
NavigatorMediaCapabilities.h
TransferFunction.idl
VideoConfiguration.idl