<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[279186] trunk/Source</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/279186">279186</a></dd>
<dt>Author</dt> <dd>jer.noble@apple.com</dd>
<dt>Date</dt> <dd>2021-06-23 14:21:48 -0700 (Wed, 23 Jun 2021)</dd>
</dl>

<h3>Log Message</h3>
<pre>[Cocoa] Make the hostTime parameter to playSession a Monotonic time
https://bugs.webkit.org/show_bug.cgi?id=226515

Reviewed by Youenn Fablet.

Source/WebCore:

Fire the playSession action handler at approximately the hostTime indicated by the MediaSessionCoordinatorPrivate.

* Modules/mediasession/MediaSessionCoordinator.cpp:
(WebCore::MediaSessionCoordinator::playSession):
* Modules/mediasession/MediaSessionCoordinator.h:
* Modules/mediasession/MediaSessionCoordinatorPrivate.h:
(WebCore::MediaSessionCoordinatorClient::playSession):

Source/WebCore/PAL:

SoftLink CMClockConvertHostTimeToSystemUnits.

* pal/cf/CoreMediaSoftLink.cpp:
* pal/cf/CoreMediaSoftLink.h:

Source/WebKit:

* UIProcess/API/Cocoa/WKWebViewTesting.mm:
(-[WKWebView _createMediaSessionCoordinatorForTesting:completionHandler:]):
(-[WKMediaSessionCoordinatorHelper playSessionWithCompletion:]):
* UIProcess/Media/RemoteMediaSessionCoordinatorProxy.cpp:
(WebKit::RemoteMediaSessionCoordinatorProxy::playSession):
* UIProcess/Media/RemoteMediaSessionCoordinatorProxy.h:
* WebProcess/MediaSession/RemoteMediaSessionCoordinator.cpp:
(WebKit::RemoteMediaSessionCoordinator::playSession):
* WebProcess/MediaSession/RemoteMediaSessionCoordinator.h:
* WebProcess/MediaSession/RemoteMediaSessionCoordinator.messages.in:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesmediasessionMediaSessionCoordinatorcpp">trunk/Source/WebCore/Modules/mediasession/MediaSessionCoordinator.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesmediasessionMediaSessionCoordinatorh">trunk/Source/WebCore/Modules/mediasession/MediaSessionCoordinator.h</a></li>
<li><a href="#trunkSourceWebCoreModulesmediasessionMediaSessionCoordinatorPrivateh">trunk/Source/WebCore/Modules/mediasession/MediaSessionCoordinatorPrivate.h</a></li>
<li><a href="#trunkSourceWebCorePALChangeLog">trunk/Source/WebCore/PAL/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorePALpalcfCoreMediaSoftLinkcpp">trunk/Source/WebCore/PAL/pal/cf/CoreMediaSoftLink.cpp</a></li>
<li><a href="#trunkSourceWebCorePALpalcfCoreMediaSoftLinkh">trunk/Source/WebCore/PAL/pal/cf/CoreMediaSoftLink.h</a></li>
<li><a href="#trunkSourceWebKitChangeLog">trunk/Source/WebKit/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitUIProcessAPICocoaWKWebViewTestingmm">trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewTesting.mm</a></li>
<li><a href="#trunkSourceWebKitUIProcessMediaRemoteMediaSessionCoordinatorProxycpp">trunk/Source/WebKit/UIProcess/Media/RemoteMediaSessionCoordinatorProxy.cpp</a></li>
<li><a href="#trunkSourceWebKitUIProcessMediaRemoteMediaSessionCoordinatorProxyh">trunk/Source/WebKit/UIProcess/Media/RemoteMediaSessionCoordinatorProxy.h</a></li>
<li><a href="#trunkSourceWebKitWebProcessMediaSessionRemoteMediaSessionCoordinatorcpp">trunk/Source/WebKit/WebProcess/MediaSession/RemoteMediaSessionCoordinator.cpp</a></li>
<li><a href="#trunkSourceWebKitWebProcessMediaSessionRemoteMediaSessionCoordinatorh">trunk/Source/WebKit/WebProcess/MediaSession/RemoteMediaSessionCoordinator.h</a></li>
<li><a href="#trunkSourceWebKitWebProcessMediaSessionRemoteMediaSessionCoordinatormessagesin">trunk/Source/WebKit/WebProcess/MediaSession/RemoteMediaSessionCoordinator.messages.in</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (279185 => 279186)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2021-06-23 20:44:00 UTC (rev 279185)
+++ trunk/Source/WebCore/ChangeLog      2021-06-23 21:21:48 UTC (rev 279186)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2021-06-23  Jer Noble  <jer.noble@apple.com>
+
+        [Cocoa] Make the hostTime parameter to playSession a Monotonic time
+        https://bugs.webkit.org/show_bug.cgi?id=226515
+
+        Reviewed by Youenn Fablet.
+
+        Fire the playSession action handler at approximately the hostTime indicated by the MediaSessionCoordinatorPrivate.
+
+        * Modules/mediasession/MediaSessionCoordinator.cpp:
+        (WebCore::MediaSessionCoordinator::playSession):
+        * Modules/mediasession/MediaSessionCoordinator.h:
+        * Modules/mediasession/MediaSessionCoordinatorPrivate.h:
+        (WebCore::MediaSessionCoordinatorClient::playSession):
+
</ins><span class="cx"> 2021-06-23  Mark Lam  <mark.lam@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Remove unneeded explicit exception checks in ScriptModuleLoader::evaluate().
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediasessionMediaSessionCoordinatorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediasession/MediaSessionCoordinator.cpp (279185 => 279186)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediasession/MediaSessionCoordinator.cpp    2021-06-23 20:44:00 UTC (rev 279185)
+++ trunk/Source/WebCore/Modules/mediasession/MediaSessionCoordinator.cpp       2021-06-23 21:21:48 UTC (rev 279186)
</span><span class="lines">@@ -362,10 +362,11 @@
</span><span class="cx">     completionHandler(true);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void MediaSessionCoordinator::playSession(std::optional<double> atTime, std::optional<double> hostTime, CompletionHandler<void(bool)>&& completionHandler)
</del><ins>+void MediaSessionCoordinator::playSession(std::optional<double> atTime, std::optional<MonotonicTime> hostTime, CompletionHandler<void(bool)>&& completionHandler)
</ins><span class="cx"> {
</span><del>-    UNUSED_PARAM(hostTime);
-    ALWAYS_LOG(LOGIDENTIFIER, m_state);
</del><ins>+    auto now = MonotonicTime::now();
+    auto delta = hostTime ? *hostTime - now : Seconds::nan();
+    ALWAYS_LOG(LOGIDENTIFIER, m_state, " time: ", atTime ? *atTime : -1, " hostTime: ", (hostTime ? *hostTime : MonotonicTime::nan()).secondsSinceEpoch().value(), " delta: ", delta.value());
</ins><span class="cx"> 
</span><span class="cx">     if (m_state != MediaSessionCoordinatorState::Joined) {
</span><span class="cx">         completionHandler(false);
</span><span class="lines">@@ -375,8 +376,20 @@
</span><span class="cx">     if (atTime && !currentPositionApproximatelyEqualTo(*atTime))
</span><span class="cx">         m_session->callActionHandler({ .action = MediaSessionAction::Seekto, .seekTime = *atTime });
</span><span class="cx"> 
</span><del>-    m_session->callActionHandler({ .action = MediaSessionAction::Play });
-    completionHandler(true);
</del><ins>+    if (!std::isfinite(delta) || delta <= 0_s) {
+        m_session->callActionHandler({ .action = MediaSessionAction::Play });
+        completionHandler(true);
+        return;
+    }
+
+    RunLoop::main().dispatchAfter(delta, [weakThis = makeWeakPtr(this), completionHandler = WTFMove(completionHandler)] () mutable {
+        if (!weakThis || !weakThis->m_session) {
+            completionHandler(false);
+            return;
+        }
+        weakThis->m_session->callActionHandler({ .action = MediaSessionAction::Play });
+        completionHandler(true);
+    });
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void MediaSessionCoordinator::pauseSession(CompletionHandler<void(bool)>&& completionHandler)
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediasessionMediaSessionCoordinatorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediasession/MediaSessionCoordinator.h (279185 => 279186)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediasession/MediaSessionCoordinator.h      2021-06-23 20:44:00 UTC (rev 279185)
+++ trunk/Source/WebCore/Modules/mediasession/MediaSessionCoordinator.h 2021-06-23 21:21:48 UTC (rev 279186)
</span><span class="lines">@@ -92,7 +92,7 @@
</span><span class="cx"> 
</span><span class="cx">     // MediaSessionCoordinatorClient
</span><span class="cx">     void seekSessionToTime(double, CompletionHandler<void(bool)>&&) final;
</span><del>-    void playSession(std::optional<double> atTime, std::optional<double> hostTime, CompletionHandler<void(bool)>&&) final;
</del><ins>+    void playSession(std::optional<double> atTime, std::optional<MonotonicTime> hostTime, CompletionHandler<void(bool)>&&) final;
</ins><span class="cx">     void pauseSession(CompletionHandler<void(bool)>&&) final;
</span><span class="cx">     void setSessionTrack(const String&, CompletionHandler<void(bool)>&&) final;
</span><span class="cx">     void coordinatorStateChanged(WebCore::MediaSessionCoordinatorState) final;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediasessionMediaSessionCoordinatorPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediasession/MediaSessionCoordinatorPrivate.h (279185 => 279186)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediasession/MediaSessionCoordinatorPrivate.h       2021-06-23 20:44:00 UTC (rev 279185)
+++ trunk/Source/WebCore/Modules/mediasession/MediaSessionCoordinatorPrivate.h  2021-06-23 21:21:48 UTC (rev 279186)
</span><span class="lines">@@ -32,6 +32,8 @@
</span><span class="cx"> #include "MediaSessionCoordinatorState.h"
</span><span class="cx"> #include "MediaSessionPlaybackState.h"
</span><span class="cx"> #include "MediaSessionReadyState.h"
</span><ins>+#include <wtf/MonotonicTime.h>
+#include <wtf/Optional.h>
</ins><span class="cx"> #include <wtf/WeakPtr.h>
</span><span class="cx"> 
</span><span class="cx"> namespace WTF {
</span><span class="lines">@@ -45,7 +47,7 @@
</span><span class="cx">     virtual ~MediaSessionCoordinatorClient() = default;
</span><span class="cx"> 
</span><span class="cx">     virtual void seekSessionToTime(double, CompletionHandler<void(bool)>&&) = 0;
</span><del>-    virtual void playSession(std::optional<double> atTime, std::optional<double> hostTime, CompletionHandler<void(bool)>&&) = 0;
</del><ins>+    virtual void playSession(std::optional<double> atTime, std::optional<MonotonicTime> hostTime, CompletionHandler<void(bool)>&&) = 0;
</ins><span class="cx">     virtual void pauseSession(CompletionHandler<void(bool)>&&) = 0;
</span><span class="cx">     virtual void setSessionTrack(const String&, CompletionHandler<void(bool)>&&) = 0;
</span><span class="cx">     virtual void coordinatorStateChanged(WebCore::MediaSessionCoordinatorState) = 0;
</span></span></pre></div>
<a id="trunkSourceWebCorePALChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/PAL/ChangeLog (279185 => 279186)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/PAL/ChangeLog       2021-06-23 20:44:00 UTC (rev 279185)
+++ trunk/Source/WebCore/PAL/ChangeLog  2021-06-23 21:21:48 UTC (rev 279186)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2021-06-23  Jer Noble  <jer.noble@apple.com>
+
+        [Cocoa] Make the hostTime parameter to playSession a Monotonic time
+        https://bugs.webkit.org/show_bug.cgi?id=226515
+
+        Reviewed by Youenn Fablet.
+
+        SoftLink CMClockConvertHostTimeToSystemUnits.
+
+        * pal/cf/CoreMediaSoftLink.cpp:
+        * pal/cf/CoreMediaSoftLink.h:
+
</ins><span class="cx"> 2021-06-22  Jer Noble  <jer.noble@apple.com>
</span><span class="cx"> 
</span><span class="cx">         [Cocoa] iOS device steals BT headphones from other devices during silent playback
</span></span></pre></div>
<a id="trunkSourceWebCorePALpalcfCoreMediaSoftLinkcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/PAL/pal/cf/CoreMediaSoftLink.cpp (279185 => 279186)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/PAL/pal/cf/CoreMediaSoftLink.cpp    2021-06-23 20:44:00 UTC (rev 279185)
+++ trunk/Source/WebCore/PAL/pal/cf/CoreMediaSoftLink.cpp       2021-06-23 21:21:48 UTC (rev 279186)
</span><span class="lines">@@ -183,6 +183,8 @@
</span><span class="cx"> SOFT_LINK_FUNCTION_FOR_SOURCE_WITH_EXPORT(PAL, CoreMedia, CMAudioFormatDescriptionGetRichestDecodableFormat, const AudioFormatListItem *, (CMAudioFormatDescriptionRef desc), (desc), PAL_EXPORT)
</span><span class="cx"> SOFT_LINK_FUNCTION_FOR_SOURCE_WITH_EXPORT(PAL, CoreMedia, CMClockGetHostTimeClock, CMClockRef, (void), (), PAL_EXPORT)
</span><span class="cx"> SOFT_LINK_FUNCTION_FOR_SOURCE_WITH_EXPORT(PAL, CoreMedia, CMClockGetTime, CMTime, (CMClockRef clock), (clock), PAL_EXPORT)
</span><ins>+SOFT_LINK_FUNCTION_FOR_SOURCE_WITH_EXPORT(PAL, CoreMedia, CMClockConvertHostTimeToSystemUnits, uint64_t, (CMTime hostTime), (hostTime), PAL_EXPORT)
+
</ins><span class="cx"> SOFT_LINK_FUNCTION_FOR_SOURCE_WITH_EXPORT(PAL, CoreMedia, CMSampleBufferCallForEachSample, OSStatus, (CMSampleBufferRef sbuf, OSStatus (* CMSAMPLEBUFFERCALL_NOESCAPE callback)( CMSampleBufferRef sampleBuffer, CMItemCount index, void *refcon), void *refcon), (sbuf, callback, refcon), PAL_EXPORT)
</span><span class="cx"> SOFT_LINK_FUNCTION_FOR_SOURCE_WITH_EXPORT(PAL, CoreMedia, CMSampleBufferCallBlockForEachSample, OSStatus, (CMSampleBufferRef sbuf, OSStatus (^ CMSAMPLEBUFFERCALL_NOESCAPE handler)(CMSampleBufferRef, CMItemCount)), (sbuf, handler), PAL_EXPORT)
</span><span class="cx"> SOFT_LINK_CONSTANT_MAY_FAIL_FOR_SOURCE_WITH_EXPORT(PAL, CoreMedia, kCMFormatDescriptionExtension_ProtectedContentOriginalFormat, CFStringRef, PAL_EXPORT)
</span></span></pre></div>
<a id="trunkSourceWebCorePALpalcfCoreMediaSoftLinkh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/PAL/pal/cf/CoreMediaSoftLink.h (279185 => 279186)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/PAL/pal/cf/CoreMediaSoftLink.h      2021-06-23 20:44:00 UTC (rev 279185)
+++ trunk/Source/WebCore/PAL/pal/cf/CoreMediaSoftLink.h 2021-06-23 21:21:48 UTC (rev 279186)
</span><span class="lines">@@ -322,6 +322,8 @@
</span><span class="cx"> #define CMClockGetHostTimeClock  softLink_CoreMedia_CMClockGetHostTimeClock
</span><span class="cx"> SOFT_LINK_FUNCTION_FOR_HEADER(PAL, CoreMedia, CMClockGetTime, CMTime, (CMClockRef clock), (clock))
</span><span class="cx"> #define CMClockGetTime  softLink_CoreMedia_CMClockGetTime
</span><ins>+SOFT_LINK_FUNCTION_FOR_HEADER(PAL, CoreMedia, CMClockConvertHostTimeToSystemUnits, uint64_t, (CMTime hostTime), (hostTime))
+#define CMClockConvertHostTimeToSystemUnits softLink_CoreMedia_CMClockConvertHostTimeToSystemUnits
</ins><span class="cx"> 
</span><span class="cx"> SOFT_LINK_FUNCTION_FOR_HEADER(PAL, CoreMedia, CMSampleBufferCallForEachSample, OSStatus, (CMSampleBufferRef sbuf, OSStatus (* CMSAMPLEBUFFERCALL_NOESCAPE callback)(CMSampleBufferRef sampleBuffer, CMItemCount index, void *refcon), void *refcon), (sbuf, callback, refcon))
</span><span class="cx"> #define CMSampleBufferCallForEachSample softLink_CoreMedia_CMSampleBufferCallForEachSample
</span></span></pre></div>
<a id="trunkSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ChangeLog (279185 => 279186)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ChangeLog    2021-06-23 20:44:00 UTC (rev 279185)
+++ trunk/Source/WebKit/ChangeLog       2021-06-23 21:21:48 UTC (rev 279186)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2021-06-23  Jer Noble  <jer.noble@apple.com>
+
+        [Cocoa] Make the hostTime parameter to playSession a Monotonic time
+        https://bugs.webkit.org/show_bug.cgi?id=226515
+
+        Reviewed by Youenn Fablet.
+
+        * UIProcess/API/Cocoa/WKWebViewTesting.mm:
+        (-[WKWebView _createMediaSessionCoordinatorForTesting:completionHandler:]):
+        (-[WKMediaSessionCoordinatorHelper playSessionWithCompletion:]):
+        * UIProcess/Media/RemoteMediaSessionCoordinatorProxy.cpp:
+        (WebKit::RemoteMediaSessionCoordinatorProxy::playSession):
+        * UIProcess/Media/RemoteMediaSessionCoordinatorProxy.h:
+        * WebProcess/MediaSession/RemoteMediaSessionCoordinator.cpp:
+        (WebKit::RemoteMediaSessionCoordinator::playSession):
+        * WebProcess/MediaSession/RemoteMediaSessionCoordinator.h:
+        * WebProcess/MediaSession/RemoteMediaSessionCoordinator.messages.in:
+
</ins><span class="cx"> 2021-06-23  Kate Cheney  <katherine_cheney@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Migrate App Privacy Report code from WebKitAdditions
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessAPICocoaWKWebViewTestingmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewTesting.mm (279185 => 279186)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewTesting.mm      2021-06-23 20:44:00 UTC (rev 279185)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewTesting.mm 2021-06-23 21:21:48 UTC (rev 279186)
</span><span class="lines">@@ -421,7 +421,7 @@
</span><span class="cx">                 callback(false);
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        void playSession(std::optional<double> atTime, std::optional<double> hostTime, CompletionHandler<void(bool)>&& callback) final
</del><ins>+        void playSession(std::optional<double> atTime, std::optional<MonotonicTime> hostTime, CompletionHandler<void(bool)>&& callback) final
</ins><span class="cx">         {
</span><span class="cx">             if (auto coordinatorClient = client())
</span><span class="cx">                 coordinatorClient->playSession(WTFMove(atTime), WTFMove(hostTime), WTFMove(callback));
</span><span class="lines">@@ -610,7 +610,7 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)playSessionWithCompletion:(void(^)(BOOL))completionHandler
</span><span class="cx"> {
</span><del>-    m_coordinatorClient->playSession({ }, { }, makeBlockPtr(completionHandler));
</del><ins>+    m_coordinatorClient->playSession({ }, std::optional<MonotonicTime>(), makeBlockPtr(completionHandler));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)pauseSessionWithCompletion:(void(^)(BOOL))completionHandler
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessMediaRemoteMediaSessionCoordinatorProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/Media/RemoteMediaSessionCoordinatorProxy.cpp (279185 => 279186)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/Media/RemoteMediaSessionCoordinatorProxy.cpp       2021-06-23 20:44:00 UTC (rev 279185)
+++ trunk/Source/WebKit/UIProcess/Media/RemoteMediaSessionCoordinatorProxy.cpp  2021-06-23 21:21:48 UTC (rev 279186)
</span><span class="lines">@@ -159,7 +159,7 @@
</span><span class="cx">     m_webPageProxy.sendWithAsyncReply(Messages::RemoteMediaSessionCoordinator::SeekSessionToTime { time }, callback);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RemoteMediaSessionCoordinatorProxy::playSession(std::optional<double> atTime, std::optional<double> hostTime, CompletionHandler<void(bool)>&& callback)
</del><ins>+void RemoteMediaSessionCoordinatorProxy::playSession(std::optional<double> atTime, std::optional<MonotonicTime> hostTime, CompletionHandler<void(bool)>&& callback)
</ins><span class="cx"> {
</span><span class="cx">     m_webPageProxy.sendWithAsyncReply(Messages::RemoteMediaSessionCoordinator::PlaySession { WTFMove(atTime), WTFMove(hostTime) }, callback);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessMediaRemoteMediaSessionCoordinatorProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/Media/RemoteMediaSessionCoordinatorProxy.h (279185 => 279186)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/Media/RemoteMediaSessionCoordinatorProxy.h 2021-06-23 20:44:00 UTC (rev 279185)
+++ trunk/Source/WebKit/UIProcess/Media/RemoteMediaSessionCoordinatorProxy.h    2021-06-23 21:21:48 UTC (rev 279186)
</span><span class="lines">@@ -77,7 +77,7 @@
</span><span class="cx"> 
</span><span class="cx">     // MediaSessionCoordinatorClient
</span><span class="cx">     void seekSessionToTime(double, CompletionHandler<void(bool)>&&) final;
</span><del>-    void playSession(std::optional<double> atTime, std::optional<double> hostTime, CompletionHandler<void(bool)>&&) final;
</del><ins>+    void playSession(std::optional<double> atTime, std::optional<MonotonicTime> hostTime, CompletionHandler<void(bool)>&&) final;
</ins><span class="cx">     void pauseSession(CompletionHandler<void(bool)>&&) final;
</span><span class="cx">     void setSessionTrack(const String&, CompletionHandler<void(bool)>&&) final;
</span><span class="cx">     void coordinatorStateChanged(WebCore::MediaSessionCoordinatorState) final;
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessMediaSessionRemoteMediaSessionCoordinatorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/MediaSession/RemoteMediaSessionCoordinator.cpp (279185 => 279186)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/MediaSession/RemoteMediaSessionCoordinator.cpp    2021-06-23 20:44:00 UTC (rev 279185)
+++ trunk/Source/WebKit/WebProcess/MediaSession/RemoteMediaSessionCoordinator.cpp       2021-06-23 21:21:48 UTC (rev 279186)
</span><span class="lines">@@ -190,7 +190,7 @@
</span><span class="cx">         completionHandler(false);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RemoteMediaSessionCoordinator::playSession(std::optional<double> atTime, std::optional<double> hostTime, CompletionHandler<void(bool)>&& completionHandler)
</del><ins>+void RemoteMediaSessionCoordinator::playSession(std::optional<double> atTime, std::optional<MonotonicTime> hostTime, CompletionHandler<void(bool)>&& completionHandler)
</ins><span class="cx"> {
</span><span class="cx">     ALWAYS_LOG_IF_POSSIBLE(LOGIDENTIFIER);
</span><span class="cx">     if (auto coordinatorClient = client())
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessMediaSessionRemoteMediaSessionCoordinatorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/MediaSession/RemoteMediaSessionCoordinator.h (279185 => 279186)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/MediaSession/RemoteMediaSessionCoordinator.h      2021-06-23 20:44:00 UTC (rev 279185)
+++ trunk/Source/WebKit/WebProcess/MediaSession/RemoteMediaSessionCoordinator.h 2021-06-23 21:21:48 UTC (rev 279186)
</span><span class="lines">@@ -55,7 +55,7 @@
</span><span class="cx"> 
</span><span class="cx">     // MessageReceivers.
</span><span class="cx">     void seekSessionToTime(double, CompletionHandler<void(bool)>&&);
</span><del>-    void playSession(std::optional<double>, std::optional<double>, CompletionHandler<void(bool)>&&);
</del><ins>+    void playSession(std::optional<double>, std::optional<MonotonicTime>, CompletionHandler<void(bool)>&&);
</ins><span class="cx">     void pauseSession(CompletionHandler<void(bool)>&&);
</span><span class="cx">     void setSessionTrack(const String&, CompletionHandler<void(bool)>&&);
</span><span class="cx">     void coordinatorStateChanged(WebCore::MediaSessionCoordinatorState);
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessMediaSessionRemoteMediaSessionCoordinatormessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/MediaSession/RemoteMediaSessionCoordinator.messages.in (279185 => 279186)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/MediaSession/RemoteMediaSessionCoordinator.messages.in    2021-06-23 20:44:00 UTC (rev 279185)
+++ trunk/Source/WebKit/WebProcess/MediaSession/RemoteMediaSessionCoordinator.messages.in       2021-06-23 21:21:48 UTC (rev 279186)
</span><span class="lines">@@ -29,7 +29,7 @@
</span><span class="cx"> 
</span><span class="cx">     SeekSessionToTime(double time) -> (bool result) Async
</span><span class="cx"> 
</span><del>-    PlaySession(std::optional<double> atTime, std::optional<double> hostTime) -> (bool result) Async
</del><ins>+    PlaySession(std::optional<double> atTime, std::optional<MonotonicTime> hostTime) -> (bool result) Async
</ins><span class="cx"> 
</span><span class="cx">     PauseSession() -> (bool result) Async
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>