RESOLVED FIXED226515
[Cocoa] Make the hostTime parameter to playSession a Monotonic time
https://bugs.webkit.org/show_bug.cgi?id=226515
Summary [Cocoa] Make the hostTime parameter to playSession a Monotonic time
Jer Noble
Reported 2021-06-01 14:45:30 PDT
[Cocoa] Make the hostTime parameter to playSession a Monotonic time
Attachments
Patch (16.80 KB, patch)
2021-06-01 22:14 PDT, Jer Noble
youennf: review+
Patch for landing (16.55 KB, patch)
2021-06-23 09:42 PDT, Jer Noble
no flags
Patch for landing (16.55 KB, patch)
2021-06-23 10:00 PDT, Jer Noble
no flags
Jer Noble
Comment 1 2021-06-01 22:14:37 PDT
youenn fablet
Comment 2 2021-06-02 07:11:19 PDT
Comment on attachment 430317 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=430317&action=review > Source/WebCore/Modules/mediasession/MediaSessionCoordinator.cpp:355 > + if (!std::isfinite(delta) || delta <= 0.5_s) { Why delta <= 0.5_s, it seems we could use dispatchAfter? Maybe a name for 0.5_s would help understanding. > Source/WebCore/Modules/mediasession/MediaSessionCoordinatorPrivate.h:53 > + } Is it needed to keep it? Can we just move all call sites to use MonotonicTime? Not sure we need WTFMove(atTime), especially since we are passing by value anyway. > Source/WebKit/UIProcess/API/Cocoa/WKWebViewTesting.mm:606 > + m_coordinatorClient->playSession({ }, std::optional<MonotonicTime>(), makeBlockPtr(completionHandler)); I guess the change would not be needed if we would keep only one variant of playSession.
Radar WebKit Bug Importer
Comment 3 2021-06-08 14:46:19 PDT
Jer Noble
Comment 4 2021-06-22 16:20:51 PDT
(In reply to youenn fablet from comment #2) > Comment on attachment 430317 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=430317&action=review > > > Source/WebCore/Modules/mediasession/MediaSessionCoordinator.cpp:355 > > + if (!std::isfinite(delta) || delta <= 0.5_s) { > > Why delta <= 0.5_s, it seems we could use dispatchAfter? > Maybe a name for 0.5_s would help understanding. Sure, it'll take some time to pre-roll the decoder; so giving a half second head start is just a magic number. I have an idea how to get rid of this in a future patch, but for now, I'll make it a named constant. > > Source/WebCore/Modules/mediasession/MediaSessionCoordinatorPrivate.h:53 > > + } > > Is it needed to keep it? Can we just move all call sites to use > MonotonicTime? > Not sure we need WTFMove(atTime), especially since we are passing by value > anyway. Now that we've upstreamed, we can get rid of this. > > Source/WebKit/UIProcess/API/Cocoa/WKWebViewTesting.mm:606 > > + m_coordinatorClient->playSession({ }, std::optional<MonotonicTime>(), makeBlockPtr(completionHandler)); > > I guess the change would not be needed if we would keep only one variant of > playSession. Yep!
Jer Noble
Comment 5 2021-06-23 09:42:51 PDT
Created attachment 432061 [details] Patch for landing
Jer Noble
Comment 6 2021-06-23 10:00:37 PDT
Created attachment 432063 [details] Patch for landing
EWS
Comment 7 2021-06-23 14:21:58 PDT
Committed r279186 (239081@main): <https://commits.webkit.org/239081@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 432063 [details].
Darin Adler
Comment 8 2021-06-23 18:05:49 PDT
Comment on attachment 432063 [details] Patch for landing View in context: https://bugs.webkit.org/attachment.cgi?id=432063&action=review > Source/WebCore/Modules/mediasession/MediaSessionCoordinatorPrivate.h:36 > +#include <wtf/Optional.h> Oops! This is wrong!
Note You need to log in before you can comment on or make changes to this bug.