Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: e32b8c5a53c2ad1e2ce1891e21c47db1030df247
      
https://github.com/WebKit/WebKit/commit/e32b8c5a53c2ad1e2ce1891e21c47db1030df247
  Author: Youenn Fablet <[email protected]>
  Date:   2024-10-15 (Tue, 15 Oct 2024)

  Changed paths:
    M Source/WebCore/Modules/webcodecs/WebCodecsAudioDecoder.cpp
    M Source/WebCore/Modules/webcodecs/WebCodecsAudioEncoder.cpp
    M Source/WebCore/Modules/webcodecs/WebCodecsVideoEncoder.cpp
    M Source/WebCore/WebCore.xcodeproj/project.pbxproj
    M Source/WebCore/dom/ScriptExecutionContext.cpp
    M Source/WebCore/dom/ScriptExecutionContext.h
    M Source/WebCore/platform/AudioDecoder.cpp
    M Source/WebCore/platform/AudioDecoder.h
    M Source/WebCore/platform/AudioEncoder.cpp
    M Source/WebCore/platform/AudioEncoder.h

  Log Message:
  -----------
  Use NativePromise for AudioDecoder and AudioEncoder create methods
rdar://137865295
https://bugs.webkit.org/show_bug.cgi?id=281417

Reviewed by Jean-Yves Avenard.

Make VideoDecoder::create and VideoEncoder::create return promises instead of 
taking a create callback.
Update the client code accordingly, which makes code more readable.

This notably simplifies the isConfigSupported methods since we can use 
ScriptExecutionContext::enqueueTaskWhenSettled,
which allows to capture the DeferredPromise object in the native promise 
handler.

We can also remove ScriptExecutionContext 
addDeferredPromise/takeDeferredPromise since they can now be captured in the 
task given to ScriptExecutionContext::enqueueTaskWhenSettled.

* Source/WebCore/Modules/webcodecs/WebCodecsAudioDecoder.cpp:
(WebCore::WebCodecsAudioDecoder::configure):
(WebCore::WebCodecsAudioDecoder::isConfigSupported):
* Source/WebCore/Modules/webcodecs/WebCodecsAudioEncoder.cpp:
(WebCore::WebCodecsAudioEncoder::configure):
(WebCore::WebCodecsAudioEncoder::isConfigSupported):
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::stopActiveDOMObjects):
(WebCore::ScriptExecutionContext::addDeferredPromise): Deleted.
(WebCore::ScriptExecutionContext::takeDeferredPromise): Deleted.
* Source/WebCore/dom/ScriptExecutionContext.h:
* Source/WebCore/platform/AudioDecoder.cpp:
(WebCore::AudioDecoder::create):
* Source/WebCore/platform/AudioDecoder.h:
* Source/WebCore/platform/AudioEncoder.cpp:
(WebCore::AudioEncoder::create):
* Source/WebCore/platform/AudioEncoder.h:

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to