Title: [218757] trunk/Source
Revision
218757
Author
[email protected]
Date
2017-06-23 12:32:18 -0700 (Fri, 23 Jun 2017)

Log Message

[WK2] Support -[WebAVPlayerController setMuted:]
https://bugs.webkit.org/show_bug.cgi?id=173777

Reviewed by Eric Carlson.

Source/WebCore:

Have -[WebAVPlayerController setMuted:] pass the request to its delegate (the model)
rather than just storing the value.

* platform/cocoa/WebPlaybackSessionModel.h:
* platform/cocoa/WebPlaybackSessionModelMediaElement.h:
* platform/cocoa/WebPlaybackSessionModelMediaElement.mm:
(WebCore::WebPlaybackSessionModelMediaElement::toggleMuted):
(WebCore::WebPlaybackSessionModelMediaElement::setMuted):
* platform/ios/WebAVPlayerController.h:
* platform/ios/WebAVPlayerController.mm:
(-[WebAVPlayerController isMuted]):
(-[WebAVPlayerController setMuted:]):
* platform/ios/WebVideoFullscreenControllerAVKit.mm:
(WebVideoFullscreenControllerContext::setMuted):

Source/WebKit2:

Add a SetMuted message to WebPlaybackSessionManager.

Drive-by refactoring: Because the new setMuted() method conflicts with the existing setMuted()
notification, do a giant rename of the notificiation methods from set(Value) -> (value)Changed.

* UIProcess/Cocoa/WebPlaybackSessionManagerProxy.h:
* UIProcess/Cocoa/WebPlaybackSessionManagerProxy.messages.in:
* UIProcess/Cocoa/WebPlaybackSessionManagerProxy.mm:
(WebKit::WebPlaybackSessionModelContext::setMuted):
(WebKit::WebPlaybackSessionModelContext::playbackStartedTimeChanged):
(WebKit::WebPlaybackSessionModelContext::durationChanged):
(WebKit::WebPlaybackSessionModelContext::currentTimeChanged):
(WebKit::WebPlaybackSessionModelContext::bufferedTimeChanged):
(WebKit::WebPlaybackSessionModelContext::rateChanged):
(WebKit::WebPlaybackSessionModelContext::seekableRangesChanged):
(WebKit::WebPlaybackSessionModelContext::canPlayFastReverseChanged):
(WebKit::WebPlaybackSessionModelContext::audioMediaSelectionOptionsChanged):
(WebKit::WebPlaybackSessionModelContext::legibleMediaSelectionOptionsChanged):
(WebKit::WebPlaybackSessionModelContext::audioMediaSelectionIndexChanged):
(WebKit::WebPlaybackSessionModelContext::legibleMediaSelectionIndexChanged):
(WebKit::WebPlaybackSessionModelContext::externalPlaybackChanged):
(WebKit::WebPlaybackSessionModelContext::wirelessVideoPlaybackDisabledChanged):
(WebKit::WebPlaybackSessionModelContext::mutedChanged):
(WebKit::WebPlaybackSessionManagerProxy::currentTimeChanged):
(WebKit::WebPlaybackSessionManagerProxy::bufferedTimeChanged):
(WebKit::WebPlaybackSessionManagerProxy::seekableRangesVectorChanged):
(WebKit::WebPlaybackSessionManagerProxy::canPlayFastReverseChanged):
(WebKit::WebPlaybackSessionManagerProxy::audioMediaSelectionOptionsChanged):
(WebKit::WebPlaybackSessionManagerProxy::legibleMediaSelectionOptionsChanged):
(WebKit::WebPlaybackSessionManagerProxy::audioMediaSelectionIndexChanged):
(WebKit::WebPlaybackSessionManagerProxy::legibleMediaSelectionIndexChanged):
(WebKit::WebPlaybackSessionManagerProxy::externalPlaybackPropertiesChanged):
(WebKit::WebPlaybackSessionManagerProxy::wirelessVideoPlaybackDisabledChanged):
(WebKit::WebPlaybackSessionManagerProxy::mutedChanged):
(WebKit::WebPlaybackSessionManagerProxy::durationChanged):
(WebKit::WebPlaybackSessionManagerProxy::playbackStartedTimeChanged):
(WebKit::WebPlaybackSessionManagerProxy::rateChanged):
(WebKit::WebPlaybackSessionManagerProxy::setMuted):
(WebKit::WebPlaybackSessionManagerProxy::controlsManagerInterface):
(WebKit::WebPlaybackSessionModelContext::setPlaybackStartedTime): Deleted.
(WebKit::WebPlaybackSessionModelContext::setDuration): Deleted.
(WebKit::WebPlaybackSessionModelContext::setCurrentTime): Deleted.
(WebKit::WebPlaybackSessionModelContext::setBufferedTime): Deleted.
(WebKit::WebPlaybackSessionModelContext::setRate): Deleted.
(WebKit::WebPlaybackSessionModelContext::setSeekableRanges): Deleted.
(WebKit::WebPlaybackSessionModelContext::setCanPlayFastReverse): Deleted.
(WebKit::WebPlaybackSessionModelContext::setAudioMediaSelectionOptions): Deleted.
(WebKit::WebPlaybackSessionModelContext::setLegibleMediaSelectionOptions): Deleted.
(WebKit::WebPlaybackSessionModelContext::setAudioMediaSelectionIndex): Deleted.
(WebKit::WebPlaybackSessionModelContext::setLegibleMediaSelectionIndex): Deleted.
(WebKit::WebPlaybackSessionModelContext::setExternalPlayback): Deleted.
(WebKit::WebPlaybackSessionModelContext::setWirelessVideoPlaybackDisabled): Deleted.
(WebKit::WebPlaybackSessionManagerProxy::setCurrentTime): Deleted.
(WebKit::WebPlaybackSessionManagerProxy::setBufferedTime): Deleted.
(WebKit::WebPlaybackSessionManagerProxy::setSeekableRangesVector): Deleted.
(WebKit::WebPlaybackSessionManagerProxy::setCanPlayFastReverse): Deleted.
(WebKit::WebPlaybackSessionManagerProxy::setAudioMediaSelectionOptions): Deleted.
(WebKit::WebPlaybackSessionManagerProxy::setLegibleMediaSelectionOptions): Deleted.
(WebKit::WebPlaybackSessionManagerProxy::setAudioMediaSelectionIndex): Deleted.
(WebKit::WebPlaybackSessionManagerProxy::setLegibleMediaSelectionIndex): Deleted.
(WebKit::WebPlaybackSessionManagerProxy::setExternalPlaybackProperties): Deleted.
(WebKit::WebPlaybackSessionManagerProxy::setWirelessVideoPlaybackDisabled): Deleted.
(WebKit::WebPlaybackSessionManagerProxy::setDuration): Deleted.
(WebKit::WebPlaybackSessionManagerProxy::setPlaybackStartedTime): Deleted.
(WebKit::WebPlaybackSessionManagerProxy::setRate): Deleted.
* WebProcess/cocoa/WebPlaybackSessionManager.h:
* WebProcess/cocoa/WebPlaybackSessionManager.messages.in:
* WebProcess/cocoa/WebPlaybackSessionManager.mm:
(WebKit::WebPlaybackSessionManager::durationChanged):
(WebKit::WebPlaybackSessionManager::currentTimeChanged):
(WebKit::WebPlaybackSessionManager::bufferedTimeChanged):
(WebKit::WebPlaybackSessionManager::playbackStartedTimeChanged):
(WebKit::WebPlaybackSessionManager::rateChanged):
(WebKit::WebPlaybackSessionManager::seekableRangesChanged):
(WebKit::WebPlaybackSessionManager::canPlayFastReverseChanged):
(WebKit::WebPlaybackSessionManager::audioMediaSelectionOptionsChanged):
(WebKit::WebPlaybackSessionManager::legibleMediaSelectionOptionsChanged):
(WebKit::WebPlaybackSessionManager::externalPlaybackChanged):
(WebKit::WebPlaybackSessionManager::audioMediaSelectionIndexChanged):
(WebKit::WebPlaybackSessionManager::legibleMediaSelectionIndexChanged):
(WebKit::WebPlaybackSessionManager::wirelessVideoPlaybackDisabledChanged):
(WebKit::WebPlaybackSessionManager::mutedChanged):
(WebKit::WebPlaybackSessionManager::setMuted):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (218756 => 218757)


--- trunk/Source/WebCore/ChangeLog	2017-06-23 19:13:41 UTC (rev 218756)
+++ trunk/Source/WebCore/ChangeLog	2017-06-23 19:32:18 UTC (rev 218757)
@@ -1,3 +1,25 @@
+2017-06-23  Jer Noble  <[email protected]>
+
+        [WK2] Support -[WebAVPlayerController setMuted:]
+        https://bugs.webkit.org/show_bug.cgi?id=173777
+
+        Reviewed by Eric Carlson.
+
+        Have -[WebAVPlayerController setMuted:] pass the request to its delegate (the model)
+        rather than just storing the value.
+
+        * platform/cocoa/WebPlaybackSessionModel.h:
+        * platform/cocoa/WebPlaybackSessionModelMediaElement.h:
+        * platform/cocoa/WebPlaybackSessionModelMediaElement.mm:
+        (WebCore::WebPlaybackSessionModelMediaElement::toggleMuted):
+        (WebCore::WebPlaybackSessionModelMediaElement::setMuted):
+        * platform/ios/WebAVPlayerController.h:
+        * platform/ios/WebAVPlayerController.mm:
+        (-[WebAVPlayerController isMuted]):
+        (-[WebAVPlayerController setMuted:]):
+        * platform/ios/WebVideoFullscreenControllerAVKit.mm:
+        (WebVideoFullscreenControllerContext::setMuted):
+
 2017-06-23  Frederic Wang  <[email protected]>
 
         Make RenderLayer::handleTouchEvent use usesAcceleratedScrolling()

Modified: trunk/Source/WebCore/platform/cocoa/WebPlaybackSessionModel.h (218756 => 218757)


--- trunk/Source/WebCore/platform/cocoa/WebPlaybackSessionModel.h	2017-06-23 19:13:41 UTC (rev 218756)
+++ trunk/Source/WebCore/platform/cocoa/WebPlaybackSessionModel.h	2017-06-23 19:32:18 UTC (rev 218757)
@@ -57,6 +57,7 @@
     virtual void selectLegibleMediaOption(uint64_t index) = 0;
     virtual void togglePictureInPicture() = 0;
     virtual void toggleMuted() = 0;
+    virtual void setMuted(bool) = 0;
 
     enum ExternalPlaybackTargetType { TargetTypeNone, TargetTypeAirPlay, TargetTypeTVOut };
 

Modified: trunk/Source/WebCore/platform/cocoa/WebPlaybackSessionModelMediaElement.h (218756 => 218757)


--- trunk/Source/WebCore/platform/cocoa/WebPlaybackSessionModelMediaElement.h	2017-06-23 19:13:41 UTC (rev 218756)
+++ trunk/Source/WebCore/platform/cocoa/WebPlaybackSessionModelMediaElement.h	2017-06-23 19:32:18 UTC (rev 218757)
@@ -71,6 +71,7 @@
     WEBCORE_EXPORT void selectLegibleMediaOption(uint64_t index) final;
     WEBCORE_EXPORT void togglePictureInPicture() final;
     WEBCORE_EXPORT void toggleMuted() final;
+    WEBCORE_EXPORT void setMuted(bool) final;
 
     double duration() const final;
     double currentTime() const final;

Modified: trunk/Source/WebCore/platform/cocoa/WebPlaybackSessionModelMediaElement.mm (218756 => 218757)


--- trunk/Source/WebCore/platform/cocoa/WebPlaybackSessionModelMediaElement.mm	2017-06-23 19:13:41 UTC (rev 218756)
+++ trunk/Source/WebCore/platform/cocoa/WebPlaybackSessionModelMediaElement.mm	2017-06-23 19:32:18 UTC (rev 218757)
@@ -281,8 +281,13 @@
 
 void WebPlaybackSessionModelMediaElement::toggleMuted()
 {
+    setMuted(!isMuted());
+}
+
+void WebPlaybackSessionModelMediaElement::setMuted(bool muted)
+{
     if (m_mediaElement)
-        m_mediaElement->setMuted(!m_mediaElement->muted());
+        m_mediaElement->setMuted(muted);
 }
 
 void WebPlaybackSessionModelMediaElement::updateMediaSelectionOptions()

Modified: trunk/Source/WebCore/platform/ios/WebAVPlayerController.h (218756 => 218757)


--- trunk/Source/WebCore/platform/ios/WebAVPlayerController.h	2017-06-23 19:13:41 UTC (rev 218756)
+++ trunk/Source/WebCore/platform/ios/WebAVPlayerController.h	2017-06-23 19:32:18 UTC (rev 218757)
@@ -40,6 +40,7 @@
     WebAVMediaSelectionOption *_currentAudioMediaSelectionOption;
     WebAVMediaSelectionOption *_currentLegibleMediaSelectionOption;
     BOOL _pictureInPictureInterrupted;
+    BOOL _muted;
 }
 
 @property (retain) AVPlayerController* playerControllerProxy;

Modified: trunk/Source/WebCore/platform/ios/WebAVPlayerController.mm (218756 => 218757)


--- trunk/Source/WebCore/platform/ios/WebAVPlayerController.mm	2017-06-23 19:13:41 UTC (rev 218756)
+++ trunk/Source/WebCore/platform/ios/WebAVPlayerController.mm	2017-06-23 19:32:18 UTC (rev 218757)
@@ -465,6 +465,21 @@
     }
 }
 
+- (BOOL)isMuted
+{
+    return _muted;
+}
+
+- (void)setMuted:(BOOL)muted
+{
+    if (_muted == muted)
+        return;
+    _muted = muted;
+
+    if (self.delegate)
+        self.delegate->setMuted(muted);
+}
+
 - (void)toggleMuted:(id)sender
 {
     UNUSED_PARAM(sender);

Modified: trunk/Source/WebCore/platform/ios/WebVideoFullscreenControllerAVKit.mm (218756 => 218757)


--- trunk/Source/WebCore/platform/ios/WebVideoFullscreenControllerAVKit.mm	2017-06-23 19:13:41 UTC (rev 218756)
+++ trunk/Source/WebCore/platform/ios/WebVideoFullscreenControllerAVKit.mm	2017-06-23 19:32:18 UTC (rev 218757)
@@ -168,6 +168,7 @@
     bool wirelessVideoPlaybackDisabled() const override;
     void togglePictureInPicture() override { }
     void toggleMuted() override;
+    void setMuted(bool) final;
 
     // WebPlaybackSessionModelClient
     void durationChanged(double) override;
@@ -605,6 +606,15 @@
     });
 }
 
+void WebVideoFullscreenControllerContext::setMuted(bool muted)
+{
+    ASSERT(isUIThread());
+    WebThreadRun([protectedThis = makeRefPtr(this), this, muted] {
+        if (m_playbackModel)
+            m_playbackModel->setMuted(muted);
+    });
+}
+
 void WebVideoFullscreenControllerContext::beginScrubbing()
 {
     ASSERT(isUIThread());

Modified: trunk/Source/WebKit2/ChangeLog (218756 => 218757)


--- trunk/Source/WebKit2/ChangeLog	2017-06-23 19:13:41 UTC (rev 218756)
+++ trunk/Source/WebKit2/ChangeLog	2017-06-23 19:32:18 UTC (rev 218757)
@@ -1,3 +1,94 @@
+2017-06-23  Jer Noble  <[email protected]>
+
+        [WK2] Support -[WebAVPlayerController setMuted:]
+        https://bugs.webkit.org/show_bug.cgi?id=173777
+
+        Reviewed by Eric Carlson.
+
+        Add a SetMuted message to WebPlaybackSessionManager.
+
+        Drive-by refactoring: Because the new setMuted() method conflicts with the existing setMuted()
+        notification, do a giant rename of the notificiation methods from set(Value) -> (value)Changed.
+
+        * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.h:
+        * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.messages.in:
+        * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.mm:
+        (WebKit::WebPlaybackSessionModelContext::setMuted):
+        (WebKit::WebPlaybackSessionModelContext::playbackStartedTimeChanged):
+        (WebKit::WebPlaybackSessionModelContext::durationChanged):
+        (WebKit::WebPlaybackSessionModelContext::currentTimeChanged):
+        (WebKit::WebPlaybackSessionModelContext::bufferedTimeChanged):
+        (WebKit::WebPlaybackSessionModelContext::rateChanged):
+        (WebKit::WebPlaybackSessionModelContext::seekableRangesChanged):
+        (WebKit::WebPlaybackSessionModelContext::canPlayFastReverseChanged):
+        (WebKit::WebPlaybackSessionModelContext::audioMediaSelectionOptionsChanged):
+        (WebKit::WebPlaybackSessionModelContext::legibleMediaSelectionOptionsChanged):
+        (WebKit::WebPlaybackSessionModelContext::audioMediaSelectionIndexChanged):
+        (WebKit::WebPlaybackSessionModelContext::legibleMediaSelectionIndexChanged):
+        (WebKit::WebPlaybackSessionModelContext::externalPlaybackChanged):
+        (WebKit::WebPlaybackSessionModelContext::wirelessVideoPlaybackDisabledChanged):
+        (WebKit::WebPlaybackSessionModelContext::mutedChanged):
+        (WebKit::WebPlaybackSessionManagerProxy::currentTimeChanged):
+        (WebKit::WebPlaybackSessionManagerProxy::bufferedTimeChanged):
+        (WebKit::WebPlaybackSessionManagerProxy::seekableRangesVectorChanged):
+        (WebKit::WebPlaybackSessionManagerProxy::canPlayFastReverseChanged):
+        (WebKit::WebPlaybackSessionManagerProxy::audioMediaSelectionOptionsChanged):
+        (WebKit::WebPlaybackSessionManagerProxy::legibleMediaSelectionOptionsChanged):
+        (WebKit::WebPlaybackSessionManagerProxy::audioMediaSelectionIndexChanged):
+        (WebKit::WebPlaybackSessionManagerProxy::legibleMediaSelectionIndexChanged):
+        (WebKit::WebPlaybackSessionManagerProxy::externalPlaybackPropertiesChanged):
+        (WebKit::WebPlaybackSessionManagerProxy::wirelessVideoPlaybackDisabledChanged):
+        (WebKit::WebPlaybackSessionManagerProxy::mutedChanged):
+        (WebKit::WebPlaybackSessionManagerProxy::durationChanged):
+        (WebKit::WebPlaybackSessionManagerProxy::playbackStartedTimeChanged):
+        (WebKit::WebPlaybackSessionManagerProxy::rateChanged):
+        (WebKit::WebPlaybackSessionManagerProxy::setMuted):
+        (WebKit::WebPlaybackSessionManagerProxy::controlsManagerInterface):
+        (WebKit::WebPlaybackSessionModelContext::setPlaybackStartedTime): Deleted.
+        (WebKit::WebPlaybackSessionModelContext::setDuration): Deleted.
+        (WebKit::WebPlaybackSessionModelContext::setCurrentTime): Deleted.
+        (WebKit::WebPlaybackSessionModelContext::setBufferedTime): Deleted.
+        (WebKit::WebPlaybackSessionModelContext::setRate): Deleted.
+        (WebKit::WebPlaybackSessionModelContext::setSeekableRanges): Deleted.
+        (WebKit::WebPlaybackSessionModelContext::setCanPlayFastReverse): Deleted.
+        (WebKit::WebPlaybackSessionModelContext::setAudioMediaSelectionOptions): Deleted.
+        (WebKit::WebPlaybackSessionModelContext::setLegibleMediaSelectionOptions): Deleted.
+        (WebKit::WebPlaybackSessionModelContext::setAudioMediaSelectionIndex): Deleted.
+        (WebKit::WebPlaybackSessionModelContext::setLegibleMediaSelectionIndex): Deleted.
+        (WebKit::WebPlaybackSessionModelContext::setExternalPlayback): Deleted.
+        (WebKit::WebPlaybackSessionModelContext::setWirelessVideoPlaybackDisabled): Deleted.
+        (WebKit::WebPlaybackSessionManagerProxy::setCurrentTime): Deleted.
+        (WebKit::WebPlaybackSessionManagerProxy::setBufferedTime): Deleted.
+        (WebKit::WebPlaybackSessionManagerProxy::setSeekableRangesVector): Deleted.
+        (WebKit::WebPlaybackSessionManagerProxy::setCanPlayFastReverse): Deleted.
+        (WebKit::WebPlaybackSessionManagerProxy::setAudioMediaSelectionOptions): Deleted.
+        (WebKit::WebPlaybackSessionManagerProxy::setLegibleMediaSelectionOptions): Deleted.
+        (WebKit::WebPlaybackSessionManagerProxy::setAudioMediaSelectionIndex): Deleted.
+        (WebKit::WebPlaybackSessionManagerProxy::setLegibleMediaSelectionIndex): Deleted.
+        (WebKit::WebPlaybackSessionManagerProxy::setExternalPlaybackProperties): Deleted.
+        (WebKit::WebPlaybackSessionManagerProxy::setWirelessVideoPlaybackDisabled): Deleted.
+        (WebKit::WebPlaybackSessionManagerProxy::setDuration): Deleted.
+        (WebKit::WebPlaybackSessionManagerProxy::setPlaybackStartedTime): Deleted.
+        (WebKit::WebPlaybackSessionManagerProxy::setRate): Deleted.
+        * WebProcess/cocoa/WebPlaybackSessionManager.h:
+        * WebProcess/cocoa/WebPlaybackSessionManager.messages.in:
+        * WebProcess/cocoa/WebPlaybackSessionManager.mm:
+        (WebKit::WebPlaybackSessionManager::durationChanged):
+        (WebKit::WebPlaybackSessionManager::currentTimeChanged):
+        (WebKit::WebPlaybackSessionManager::bufferedTimeChanged):
+        (WebKit::WebPlaybackSessionManager::playbackStartedTimeChanged):
+        (WebKit::WebPlaybackSessionManager::rateChanged):
+        (WebKit::WebPlaybackSessionManager::seekableRangesChanged):
+        (WebKit::WebPlaybackSessionManager::canPlayFastReverseChanged):
+        (WebKit::WebPlaybackSessionManager::audioMediaSelectionOptionsChanged):
+        (WebKit::WebPlaybackSessionManager::legibleMediaSelectionOptionsChanged):
+        (WebKit::WebPlaybackSessionManager::externalPlaybackChanged):
+        (WebKit::WebPlaybackSessionManager::audioMediaSelectionIndexChanged):
+        (WebKit::WebPlaybackSessionManager::legibleMediaSelectionIndexChanged):
+        (WebKit::WebPlaybackSessionManager::wirelessVideoPlaybackDisabledChanged):
+        (WebKit::WebPlaybackSessionManager::mutedChanged):
+        (WebKit::WebPlaybackSessionManager::setMuted):
+
 2017-06-23  Frederic Wang  <[email protected]>
 
         Use window.internals instead of overridePreference to set WebCore settings in tests

Modified: trunk/Source/WebKit2/UIProcess/Cocoa/WebPlaybackSessionManagerProxy.h (218756 => 218757)


--- trunk/Source/WebKit2/UIProcess/Cocoa/WebPlaybackSessionManagerProxy.h	2017-06-23 19:13:41 UTC (rev 218756)
+++ trunk/Source/WebKit2/UIProcess/Cocoa/WebPlaybackSessionManagerProxy.h	2017-06-23 19:32:18 UTC (rev 218757)
@@ -70,20 +70,20 @@
     void addClient(WebCore::WebPlaybackSessionModelClient&) final;
     void removeClient(WebCore::WebPlaybackSessionModelClient&)final;
 
-    void setDuration(double);
-    void setCurrentTime(double);
-    void setBufferedTime(double);
-    void setPlaybackStartedTime(double);
-    void setRate(bool isPlaying, float playbackRate);
-    void setSeekableRanges(WebCore::TimeRanges&, double lastModifiedTime, double liveUpdateInterval);
-    void setCanPlayFastReverse(bool);
-    void setAudioMediaSelectionOptions(const Vector<WebCore::MediaSelectionOption>& options, uint64_t index);
-    void setLegibleMediaSelectionOptions(const Vector<WebCore::MediaSelectionOption>& options, uint64_t index);
-    void setAudioMediaSelectionIndex(uint64_t selectedIndex);
-    void setLegibleMediaSelectionIndex(uint64_t selectedIndex);
-    void setExternalPlayback(bool, WebPlaybackSessionModel::ExternalPlaybackTargetType, const String&);
-    void setWirelessVideoPlaybackDisabled(bool);
-    void setMuted(bool);
+    void durationChanged(double);
+    void currentTimeChanged(double);
+    void bufferedTimeChanged(double);
+    void playbackStartedTimeChanged(double);
+    void rateChanged(bool isPlaying, float playbackRate);
+    void seekableRangesChanged(WebCore::TimeRanges&, double lastModifiedTime, double liveUpdateInterval);
+    void canPlayFastReverseChanged(bool);
+    void audioMediaSelectionOptionsChanged(const Vector<WebCore::MediaSelectionOption>& options, uint64_t index);
+    void legibleMediaSelectionOptionsChanged(const Vector<WebCore::MediaSelectionOption>& options, uint64_t index);
+    void audioMediaSelectionIndexChanged(uint64_t selectedIndex);
+    void legibleMediaSelectionIndexChanged(uint64_t selectedIndex);
+    void externalPlaybackChanged(bool, WebPlaybackSessionModel::ExternalPlaybackTargetType, const String&);
+    void wirelessVideoPlaybackDisabledChanged(bool);
+    void mutedChanged(bool);
 
 private:
     friend class WebVideoFullscreenModelContext;
@@ -109,6 +109,7 @@
     void selectLegibleMediaOption(uint64_t) final;
     void togglePictureInPicture() final;
     void toggleMuted() final;
+    void setMuted(bool) final;
 
     double playbackStartedTime() const final { return m_playbackStartedTime; }
     double duration() const final { return m_duration; }
@@ -186,21 +187,21 @@
     void setUpPlaybackControlsManagerWithID(uint64_t contextId);
     void clearPlaybackControlsManager();
     void resetMediaState(uint64_t contextId);
-    void setCurrentTime(uint64_t contextId, double currentTime, double hostTime);
-    void setBufferedTime(uint64_t contextId, double bufferedTime);
-    void setSeekableRangesVector(uint64_t contextId, Vector<std::pair<double, double>> ranges, double lastModifiedTime, double liveUpdateInterval);
-    void setCanPlayFastReverse(uint64_t contextId, bool value);
-    void setAudioMediaSelectionOptions(uint64_t contextId, Vector<WebCore::MediaSelectionOption> options, uint64_t selectedIndex);
-    void setLegibleMediaSelectionOptions(uint64_t contextId, Vector<WebCore::MediaSelectionOption> options, uint64_t selectedIndex);
-    void setAudioMediaSelectionIndex(uint64_t contextId, uint64_t selectedIndex);
-    void setLegibleMediaSelectionIndex(uint64_t contextId, uint64_t selectedIndex);
-    void setExternalPlaybackProperties(uint64_t contextId, bool enabled, uint32_t targetType, String localizedDeviceName);
-    void setWirelessVideoPlaybackDisabled(uint64_t contextId, bool);
-    void setDuration(uint64_t contextId, double duration);
-    void setPlaybackStartedTime(uint64_t contextId, double playbackStartedTime);
-    void setRate(uint64_t contextId, bool isPlaying, double rate);
+    void currentTimeChanged(uint64_t contextId, double currentTime, double hostTime);
+    void bufferedTimeChanged(uint64_t contextId, double bufferedTime);
+    void seekableRangesVectorChanged(uint64_t contextId, Vector<std::pair<double, double>> ranges, double lastModifiedTime, double liveUpdateInterval);
+    void canPlayFastReverseChanged(uint64_t contextId, bool value);
+    void audioMediaSelectionOptionsChanged(uint64_t contextId, Vector<WebCore::MediaSelectionOption> options, uint64_t selectedIndex);
+    void legibleMediaSelectionOptionsChanged(uint64_t contextId, Vector<WebCore::MediaSelectionOption> options, uint64_t selectedIndex);
+    void audioMediaSelectionIndexChanged(uint64_t contextId, uint64_t selectedIndex);
+    void legibleMediaSelectionIndexChanged(uint64_t contextId, uint64_t selectedIndex);
+    void externalPlaybackPropertiesChanged(uint64_t contextId, bool enabled, uint32_t targetType, String localizedDeviceName);
+    void wirelessVideoPlaybackDisabledChanged(uint64_t contextId, bool);
+    void durationChanged(uint64_t contextId, double duration);
+    void playbackStartedTimeChanged(uint64_t contextId, double playbackStartedTime);
+    void rateChanged(uint64_t contextId, bool isPlaying, double rate);
     void handleControlledElementIDResponse(uint64_t, String) const;
-    void setMuted(uint64_t contextId, bool muted);
+    void mutedChanged(uint64_t contextId, bool muted);
 
     // Messages to WebPlaybackSessionManager
     void play(uint64_t contextId);
@@ -217,6 +218,7 @@
     void selectLegibleMediaOption(uint64_t contextId, uint64_t index);
     void togglePictureInPicture(uint64_t contextId);
     void toggleMuted(uint64_t contextId);
+    void setMuted(uint64_t contextId, bool);
 
     WebPageProxy* m_page;
     HashMap<uint64_t, ModelInterfaceTuple> m_contextMap;

Modified: trunk/Source/WebKit2/UIProcess/Cocoa/WebPlaybackSessionManagerProxy.messages.in (218756 => 218757)


--- trunk/Source/WebKit2/UIProcess/Cocoa/WebPlaybackSessionManagerProxy.messages.in	2017-06-23 19:13:41 UTC (rev 218756)
+++ trunk/Source/WebKit2/UIProcess/Cocoa/WebPlaybackSessionManagerProxy.messages.in	2017-06-23 19:32:18 UTC (rev 218757)
@@ -23,20 +23,20 @@
 #if PLATFORM(IOS) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
 messages -> WebPlaybackSessionManagerProxy {
     ResetMediaState(uint64_t contextId)
-    SetCurrentTime(uint64_t contextId, double currentTime, double hostTime)
-    SetBufferedTime(uint64_t contextId, double bufferedTime)
-    SetSeekableRangesVector(uint64_t contextId, Vector<std::pair<double, double>> ranges, double lastModifiedTime, double liveUpdateInterval)
-    SetCanPlayFastReverse(uint64_t contextId, bool value)
-    SetAudioMediaSelectionOptions(uint64_t contextId, Vector<WebCore::MediaSelectionOption> options, uint64_t selectedIndex)
-    SetLegibleMediaSelectionOptions(uint64_t contextId, Vector<WebCore::MediaSelectionOption> options, uint64_t selectedIndex)
-    SetAudioMediaSelectionIndex(uint64_t contextId, uint64_t selectedIndex)
-    SetLegibleMediaSelectionIndex(uint64_t contextId, uint64_t selectedIndex)
-    SetExternalPlaybackProperties(uint64_t contextId, bool enabled, uint32_t targetType, String localizedDeviceName)
-    SetWirelessVideoPlaybackDisabled(uint64_t contextId, bool disabled)
-    SetDuration(uint64_t contextId, double duration)
-    SetPlaybackStartedTime(uint64_t contextId, double playbackStartedTime)
-    SetRate(uint64_t contextId, bool isPlaying, double rate)
-    SetMuted(uint64_t contextId, bool muted);
+    CurrentTimeChanged(uint64_t contextId, double currentTime, double hostTime)
+    BufferedTimeChanged(uint64_t contextId, double bufferedTime)
+    SeekableRangesVectorChanged(uint64_t contextId, Vector<std::pair<double, double>> ranges, double lastModifiedTime, double liveUpdateInterval)
+    CanPlayFastReverseChanged(uint64_t contextId, bool value)
+    AudioMediaSelectionOptionsChanged(uint64_t contextId, Vector<WebCore::MediaSelectionOption> options, uint64_t selectedIndex)
+    LegibleMediaSelectionOptionsChanged(uint64_t contextId, Vector<WebCore::MediaSelectionOption> options, uint64_t selectedIndex)
+    AudioMediaSelectionIndexChanged(uint64_t contextId, uint64_t selectedIndex)
+    LegibleMediaSelectionIndexChanged(uint64_t contextId, uint64_t selectedIndex)
+    ExternalPlaybackPropertiesChanged(uint64_t contextId, bool enabled, uint32_t targetType, String localizedDeviceName)
+    WirelessVideoPlaybackDisabledChanged(uint64_t contextId, bool disabled)
+    DurationChanged(uint64_t contextId, double duration)
+    PlaybackStartedTimeChanged(uint64_t contextId, double playbackStartedTime)
+    RateChanged(uint64_t contextId, bool isPlaying, double rate)
+    MutedChanged(uint64_t contextId, bool muted);
     SetUpPlaybackControlsManagerWithID(uint64_t contextId)
     ClearPlaybackControlsManager()
 

Modified: trunk/Source/WebKit2/UIProcess/Cocoa/WebPlaybackSessionManagerProxy.mm (218756 => 218757)


--- trunk/Source/WebKit2/UIProcess/Cocoa/WebPlaybackSessionManagerProxy.mm	2017-06-23 19:13:41 UTC (rev 218756)
+++ trunk/Source/WebKit2/UIProcess/Cocoa/WebPlaybackSessionManagerProxy.mm	2017-06-23 19:32:18 UTC (rev 218757)
@@ -141,13 +141,19 @@
         m_manager->toggleMuted(m_contextId);
 }
 
-void WebPlaybackSessionModelContext::setPlaybackStartedTime(double playbackStartedTime)
+void WebPlaybackSessionModelContext::setMuted(bool muted)
 {
+    if (m_manager)
+        m_manager->setMuted(m_contextId, muted);
+}
+
+void WebPlaybackSessionModelContext::playbackStartedTimeChanged(double playbackStartedTime)
+{
     m_playbackStartedTime = playbackStartedTime;
     m_playbackStartedTimeNeedsUpdate = false;
 }
 
-void WebPlaybackSessionModelContext::setDuration(double duration)
+void WebPlaybackSessionModelContext::durationChanged(double duration)
 {
     m_duration = duration;
     for (auto* client : m_clients)
@@ -154,18 +160,18 @@
         client->durationChanged(duration);
 }
 
-void WebPlaybackSessionModelContext::setCurrentTime(double currentTime)
+void WebPlaybackSessionModelContext::currentTimeChanged(double currentTime)
 {
     m_currentTime = currentTime;
     auto anchorTime = [[NSProcessInfo processInfo] systemUptime];
     if (m_playbackStartedTimeNeedsUpdate)
-        setPlaybackStartedTime(currentTime);
+        playbackStartedTimeChanged(currentTime);
 
     for (auto* client : m_clients)
         client->currentTimeChanged(currentTime, anchorTime);
 }
 
-void WebPlaybackSessionModelContext::setBufferedTime(double bufferedTime)
+void WebPlaybackSessionModelContext::bufferedTimeChanged(double bufferedTime)
 {
     m_bufferedTime = bufferedTime;
     for (auto* client : m_clients)
@@ -172,7 +178,7 @@
         client->bufferedTimeChanged(bufferedTime);
 }
 
-void WebPlaybackSessionModelContext::setRate(bool isPlaying, float playbackRate)
+void WebPlaybackSessionModelContext::rateChanged(bool isPlaying, float playbackRate)
 {
     m_isPlaying = isPlaying;
     m_playbackRate = playbackRate;
@@ -180,7 +186,7 @@
         client->rateChanged(isPlaying, playbackRate);
 }
 
-void WebPlaybackSessionModelContext::setSeekableRanges(WebCore::TimeRanges& seekableRanges, double lastModifiedTime, double liveUpdateInterval)
+void WebPlaybackSessionModelContext::seekableRangesChanged(WebCore::TimeRanges& seekableRanges, double lastModifiedTime, double liveUpdateInterval)
 {
     m_seekableRanges = seekableRanges;
     m_seekableTimeRangesLastModifiedTime = lastModifiedTime;
@@ -189,7 +195,7 @@
         client->seekableRangesChanged(seekableRanges, lastModifiedTime, liveUpdateInterval);
 }
 
-void WebPlaybackSessionModelContext::setCanPlayFastReverse(bool canPlayFastReverse)
+void WebPlaybackSessionModelContext::canPlayFastReverseChanged(bool canPlayFastReverse)
 {
     m_canPlayFastReverse = canPlayFastReverse;
     for (auto* client : m_clients)
@@ -196,7 +202,7 @@
         client->canPlayFastReverseChanged(canPlayFastReverse);
 }
 
-void WebPlaybackSessionModelContext::setAudioMediaSelectionOptions(const Vector<MediaSelectionOption>& audioMediaSelectionOptions, uint64_t audioMediaSelectedIndex)
+void WebPlaybackSessionModelContext::audioMediaSelectionOptionsChanged(const Vector<MediaSelectionOption>& audioMediaSelectionOptions, uint64_t audioMediaSelectedIndex)
 {
     m_audioMediaSelectionOptions = audioMediaSelectionOptions;
     m_audioMediaSelectedIndex = audioMediaSelectedIndex;
@@ -204,7 +210,7 @@
         client->audioMediaSelectionOptionsChanged(audioMediaSelectionOptions, audioMediaSelectedIndex);
 }
 
-void WebPlaybackSessionModelContext::setLegibleMediaSelectionOptions(const Vector<MediaSelectionOption>& legibleMediaSelectionOptions, uint64_t legibleMediaSelectedIndex)
+void WebPlaybackSessionModelContext::legibleMediaSelectionOptionsChanged(const Vector<MediaSelectionOption>& legibleMediaSelectionOptions, uint64_t legibleMediaSelectedIndex)
 {
     m_legibleMediaSelectionOptions = legibleMediaSelectionOptions;
     m_legibleMediaSelectedIndex = legibleMediaSelectedIndex;
@@ -213,7 +219,7 @@
         client->legibleMediaSelectionOptionsChanged(legibleMediaSelectionOptions, legibleMediaSelectedIndex);
 }
 
-void WebPlaybackSessionModelContext::setAudioMediaSelectionIndex(uint64_t selectedIndex)
+void WebPlaybackSessionModelContext::audioMediaSelectionIndexChanged(uint64_t selectedIndex)
 {
     m_audioMediaSelectedIndex = selectedIndex;
 
@@ -221,7 +227,7 @@
         client->audioMediaSelectionIndexChanged(selectedIndex);
 }
 
-void WebPlaybackSessionModelContext::setLegibleMediaSelectionIndex(uint64_t selectedIndex)
+void WebPlaybackSessionModelContext::legibleMediaSelectionIndexChanged(uint64_t selectedIndex)
 {
     m_legibleMediaSelectedIndex = selectedIndex;
 
@@ -229,7 +235,7 @@
         client->legibleMediaSelectionIndexChanged(selectedIndex);
 }
 
-void WebPlaybackSessionModelContext::setExternalPlayback(bool enabled, WebPlaybackSessionModel::ExternalPlaybackTargetType type, const String& localizedName)
+void WebPlaybackSessionModelContext::externalPlaybackChanged(bool enabled, WebPlaybackSessionModel::ExternalPlaybackTargetType type, const String& localizedName)
 {
     m_externalPlaybackEnabled = enabled;
     m_externalPlaybackTargetType = type;
@@ -239,7 +245,7 @@
         client->externalPlaybackChanged(enabled, type, localizedName);
 }
 
-void WebPlaybackSessionModelContext::setWirelessVideoPlaybackDisabled(bool wirelessVideoPlaybackDisabled)
+void WebPlaybackSessionModelContext::wirelessVideoPlaybackDisabledChanged(bool wirelessVideoPlaybackDisabled)
 {
     m_wirelessVideoPlaybackDisabled = wirelessVideoPlaybackDisabled;
     for (auto* client : m_clients)
@@ -246,7 +252,7 @@
         client->wirelessVideoPlaybackDisabledChanged(wirelessVideoPlaybackDisabled);
 }
 
-void WebPlaybackSessionModelContext::setMuted(bool muted)
+void WebPlaybackSessionModelContext::mutedChanged(bool muted)
 {
     m_muted = muted;
     for (auto* client : m_clients)
@@ -368,17 +374,17 @@
     ensureInterface(contextId).resetMediaState();
 }
 
-void WebPlaybackSessionManagerProxy::setCurrentTime(uint64_t contextId, double currentTime, double hostTime)
+void WebPlaybackSessionManagerProxy::currentTimeChanged(uint64_t contextId, double currentTime, double hostTime)
 {
-    ensureModel(contextId).setCurrentTime(currentTime);
+    ensureModel(contextId).currentTimeChanged(currentTime);
 }
 
-void WebPlaybackSessionManagerProxy::setBufferedTime(uint64_t contextId, double bufferedTime)
+void WebPlaybackSessionManagerProxy::bufferedTimeChanged(uint64_t contextId, double bufferedTime)
 {
-    ensureModel(contextId).setBufferedTime(bufferedTime);
+    ensureModel(contextId).bufferedTimeChanged(bufferedTime);
 }
 
-void WebPlaybackSessionManagerProxy::setSeekableRangesVector(uint64_t contextId, Vector<std::pair<double, double>> ranges, double lastModifiedTime, double liveUpdateInterval)
+void WebPlaybackSessionManagerProxy::seekableRangesVectorChanged(uint64_t contextId, Vector<std::pair<double, double>> ranges, double lastModifiedTime, double liveUpdateInterval)
 {
     Ref<TimeRanges> timeRanges = TimeRanges::create();
     for (const auto& range : ranges) {
@@ -388,65 +394,65 @@
         timeRanges->add(range.first, range.second);
     }
 
-    ensureModel(contextId).setSeekableRanges(timeRanges, lastModifiedTime, liveUpdateInterval);
+    ensureModel(contextId).seekableRangesChanged(timeRanges, lastModifiedTime, liveUpdateInterval);
 }
 
-void WebPlaybackSessionManagerProxy::setCanPlayFastReverse(uint64_t contextId, bool value)
+void WebPlaybackSessionManagerProxy::canPlayFastReverseChanged(uint64_t contextId, bool value)
 {
-    ensureModel(contextId).setCanPlayFastReverse(value);
+    ensureModel(contextId).canPlayFastReverseChanged(value);
 }
 
-void WebPlaybackSessionManagerProxy::setAudioMediaSelectionOptions(uint64_t contextId, Vector<MediaSelectionOption> options, uint64_t selectedIndex)
+void WebPlaybackSessionManagerProxy::audioMediaSelectionOptionsChanged(uint64_t contextId, Vector<MediaSelectionOption> options, uint64_t selectedIndex)
 {
-    ensureModel(contextId).setAudioMediaSelectionOptions(options, selectedIndex);
+    ensureModel(contextId).audioMediaSelectionOptionsChanged(options, selectedIndex);
 }
 
-void WebPlaybackSessionManagerProxy::setLegibleMediaSelectionOptions(uint64_t contextId, Vector<MediaSelectionOption> options, uint64_t selectedIndex)
+void WebPlaybackSessionManagerProxy::legibleMediaSelectionOptionsChanged(uint64_t contextId, Vector<MediaSelectionOption> options, uint64_t selectedIndex)
 {
-    ensureModel(contextId).setLegibleMediaSelectionOptions(options, selectedIndex);
+    ensureModel(contextId).legibleMediaSelectionOptionsChanged(options, selectedIndex);
 }
 
-void WebPlaybackSessionManagerProxy::setAudioMediaSelectionIndex(uint64_t contextId, uint64_t selectedIndex)
+void WebPlaybackSessionManagerProxy::audioMediaSelectionIndexChanged(uint64_t contextId, uint64_t selectedIndex)
 {
-    ensureModel(contextId).setAudioMediaSelectionIndex(selectedIndex);
+    ensureModel(contextId).audioMediaSelectionIndexChanged(selectedIndex);
 }
 
-void WebPlaybackSessionManagerProxy::setLegibleMediaSelectionIndex(uint64_t contextId, uint64_t selectedIndex)
+void WebPlaybackSessionManagerProxy::legibleMediaSelectionIndexChanged(uint64_t contextId, uint64_t selectedIndex)
 {
-    ensureModel(contextId).setLegibleMediaSelectionIndex(selectedIndex);
+    ensureModel(contextId).legibleMediaSelectionIndexChanged(selectedIndex);
 }
 
-void WebPlaybackSessionManagerProxy::setExternalPlaybackProperties(uint64_t contextId, bool enabled, uint32_t targetType, String localizedDeviceName)
+void WebPlaybackSessionManagerProxy::externalPlaybackPropertiesChanged(uint64_t contextId, bool enabled, uint32_t targetType, String localizedDeviceName)
 {
     WebPlaybackSessionModel::ExternalPlaybackTargetType type = static_cast<WebPlaybackSessionModel::ExternalPlaybackTargetType>(targetType);
     ASSERT(type == WebPlaybackSessionModel::TargetTypeAirPlay || type == WebPlaybackSessionModel::TargetTypeTVOut || type == WebPlaybackSessionModel::TargetTypeNone);
 
-    ensureModel(contextId).setExternalPlayback(enabled, type, localizedDeviceName);
+    ensureModel(contextId).externalPlaybackChanged(enabled, type, localizedDeviceName);
 }
 
-void WebPlaybackSessionManagerProxy::setWirelessVideoPlaybackDisabled(uint64_t contextId, bool disabled)
+void WebPlaybackSessionManagerProxy::wirelessVideoPlaybackDisabledChanged(uint64_t contextId, bool disabled)
 {
-    ensureModel(contextId).setWirelessVideoPlaybackDisabled(disabled);
+    ensureModel(contextId).wirelessVideoPlaybackDisabledChanged(disabled);
 }
 
-void WebPlaybackSessionManagerProxy::setMuted(uint64_t contextId, bool muted)
+void WebPlaybackSessionManagerProxy::mutedChanged(uint64_t contextId, bool muted)
 {
-    ensureModel(contextId).setMuted(muted);
+    ensureModel(contextId).mutedChanged(muted);
 }
 
-void WebPlaybackSessionManagerProxy::setDuration(uint64_t contextId, double duration)
+void WebPlaybackSessionManagerProxy::durationChanged(uint64_t contextId, double duration)
 {
-    ensureModel(contextId).setDuration(duration);
+    ensureModel(contextId).mutedChanged(duration);
 }
 
-void WebPlaybackSessionManagerProxy::setPlaybackStartedTime(uint64_t contextId, double playbackStartedTime)
+void WebPlaybackSessionManagerProxy::playbackStartedTimeChanged(uint64_t contextId, double playbackStartedTime)
 {
-    ensureModel(contextId).setPlaybackStartedTime(playbackStartedTime);
+    ensureModel(contextId).playbackStartedTimeChanged(playbackStartedTime);
 }
 
-void WebPlaybackSessionManagerProxy::setRate(uint64_t contextId, bool isPlaying, double rate)
+void WebPlaybackSessionManagerProxy::rateChanged(uint64_t contextId, bool isPlaying, double rate)
 {
-    ensureModel(contextId).setRate(isPlaying, rate);
+    ensureModel(contextId).rateChanged(isPlaying, rate);
 }
 
 
@@ -534,6 +540,11 @@
     m_page->send(Messages::WebPlaybackSessionManager::ToggleMuted(contextId), m_page->pageID());
 }
 
+void WebPlaybackSessionManagerProxy::setMuted(uint64_t contextId, bool muted)
+{
+    m_page->send(Messages::WebPlaybackSessionManager::SetMuted(contextId, muted), m_page->pageID());
+}
+
 void WebPlaybackSessionManagerProxy::requestControlledElementID()
 {
     if (m_controlsManagerContextId)
@@ -544,7 +555,7 @@
 {
     if (!m_controlsManagerContextId)
         return nullptr;
-    
+
     auto& interface = ensureInterface(m_controlsManagerContextId);
     return &interface;
 }

Modified: trunk/Source/WebKit2/WebProcess/cocoa/WebPlaybackSessionManager.h (218756 => 218757)


--- trunk/Source/WebKit2/WebProcess/cocoa/WebPlaybackSessionManager.h	2017-06-23 19:13:41 UTC (rev 218756)
+++ trunk/Source/WebKit2/WebProcess/cocoa/WebPlaybackSessionManager.h	2017-06-23 19:32:18 UTC (rev 218757)
@@ -154,6 +154,7 @@
     void handleControlledElementIDRequest(uint64_t contextId);
     void togglePictureInPicture(uint64_t contextId);
     void toggleMuted(uint64_t contextId);
+    void setMuted(uint64_t contextId, bool muted);
 
     WebPage* m_page;
     HashMap<WebCore::HTMLMediaElement*, uint64_t> m_mediaElements;

Modified: trunk/Source/WebKit2/WebProcess/cocoa/WebPlaybackSessionManager.messages.in (218756 => 218757)


--- trunk/Source/WebKit2/WebProcess/cocoa/WebPlaybackSessionManager.messages.in	2017-06-23 19:13:41 UTC (rev 218756)
+++ trunk/Source/WebKit2/WebProcess/cocoa/WebPlaybackSessionManager.messages.in	2017-06-23 19:32:18 UTC (rev 218757)
@@ -38,5 +38,6 @@
     HandleControlledElementIDRequest(uint64_t contextId)
     TogglePictureInPicture(uint64_t contextId)
     ToggleMuted(uint64_t contextId)
+    SetMuted(uint64_t contextId, bool muted)
 }
 #endif

Modified: trunk/Source/WebKit2/WebProcess/cocoa/WebPlaybackSessionManager.mm (218756 => 218757)


--- trunk/Source/WebKit2/WebProcess/cocoa/WebPlaybackSessionManager.mm	2017-06-23 19:13:41 UTC (rev 218756)
+++ trunk/Source/WebKit2/WebProcess/cocoa/WebPlaybackSessionManager.mm	2017-06-23 19:32:18 UTC (rev 218757)
@@ -295,27 +295,27 @@
 
 void WebPlaybackSessionManager::durationChanged(uint64_t contextId, double duration)
 {
-    m_page->send(Messages::WebPlaybackSessionManagerProxy::SetDuration(contextId, duration), m_page->pageID());
+    m_page->send(Messages::WebPlaybackSessionManagerProxy::DurationChanged(contextId, duration), m_page->pageID());
 }
 
 void WebPlaybackSessionManager::currentTimeChanged(uint64_t contextId, double currentTime, double anchorTime)
 {
-    m_page->send(Messages::WebPlaybackSessionManagerProxy::SetCurrentTime(contextId, currentTime, anchorTime), m_page->pageID());
+    m_page->send(Messages::WebPlaybackSessionManagerProxy::CurrentTimeChanged(contextId, currentTime, anchorTime), m_page->pageID());
 }
 
 void WebPlaybackSessionManager::bufferedTimeChanged(uint64_t contextId, double bufferedTime)
 {
-    m_page->send(Messages::WebPlaybackSessionManagerProxy::SetBufferedTime(contextId, bufferedTime), m_page->pageID());
+    m_page->send(Messages::WebPlaybackSessionManagerProxy::BufferedTimeChanged(contextId, bufferedTime), m_page->pageID());
 }
 
 void WebPlaybackSessionManager::playbackStartedTimeChanged(uint64_t contextId, double playbackStartedTime)
 {
-    m_page->send(Messages::WebPlaybackSessionManagerProxy::SetPlaybackStartedTime(contextId, playbackStartedTime), m_page->pageID());
+    m_page->send(Messages::WebPlaybackSessionManagerProxy::PlaybackStartedTimeChanged(contextId, playbackStartedTime), m_page->pageID());
 }
 
 void WebPlaybackSessionManager::rateChanged(uint64_t contextId, bool isPlaying, float playbackRate)
 {
-    m_page->send(Messages::WebPlaybackSessionManagerProxy::SetRate(contextId, isPlaying, playbackRate), m_page->pageID());
+    m_page->send(Messages::WebPlaybackSessionManagerProxy::RateChanged(contextId, isPlaying, playbackRate), m_page->pageID());
 }
 
 void WebPlaybackSessionManager::seekableRangesChanged(uint64_t contextId, const WebCore::TimeRanges& timeRanges, double lastModifiedTime, double liveUpdateInterval)
@@ -326,47 +326,47 @@
         double end = timeRanges.ranges().end(i).toDouble();
         rangesVector.append({ start, end });
     }
-    m_page->send(Messages::WebPlaybackSessionManagerProxy::SetSeekableRangesVector(contextId, WTFMove(rangesVector), lastModifiedTime, liveUpdateInterval), m_page->pageID());
+    m_page->send(Messages::WebPlaybackSessionManagerProxy::SeekableRangesVectorChanged(contextId, WTFMove(rangesVector), lastModifiedTime, liveUpdateInterval), m_page->pageID());
 }
 
 void WebPlaybackSessionManager::canPlayFastReverseChanged(uint64_t contextId, bool value)
 {
-    m_page->send(Messages::WebPlaybackSessionManagerProxy::SetCanPlayFastReverse(contextId, value), m_page->pageID());
+    m_page->send(Messages::WebPlaybackSessionManagerProxy::CanPlayFastReverseChanged(contextId, value), m_page->pageID());
 }
 
 void WebPlaybackSessionManager::audioMediaSelectionOptionsChanged(uint64_t contextId, const Vector<MediaSelectionOption>& options, uint64_t selectedIndex)
 {
-    m_page->send(Messages::WebPlaybackSessionManagerProxy::SetAudioMediaSelectionOptions(contextId, options, selectedIndex), m_page->pageID());
+    m_page->send(Messages::WebPlaybackSessionManagerProxy::AudioMediaSelectionOptionsChanged(contextId, options, selectedIndex), m_page->pageID());
 }
 
 void WebPlaybackSessionManager::legibleMediaSelectionOptionsChanged(uint64_t contextId, const Vector<MediaSelectionOption>& options, uint64_t selectedIndex)
 {
-    m_page->send(Messages::WebPlaybackSessionManagerProxy::SetLegibleMediaSelectionOptions(contextId, options, selectedIndex), m_page->pageID());
+    m_page->send(Messages::WebPlaybackSessionManagerProxy::LegibleMediaSelectionOptionsChanged(contextId, options, selectedIndex), m_page->pageID());
 }
 
 void WebPlaybackSessionManager::externalPlaybackChanged(uint64_t contextId, bool enabled, WebPlaybackSessionModel::ExternalPlaybackTargetType targetType, String localizedDeviceName)
 {
-    m_page->send(Messages::WebPlaybackSessionManagerProxy::SetExternalPlaybackProperties(contextId, enabled, static_cast<uint32_t>(targetType), localizedDeviceName), m_page->pageID());
+    m_page->send(Messages::WebPlaybackSessionManagerProxy::ExternalPlaybackPropertiesChanged(contextId, enabled, static_cast<uint32_t>(targetType), localizedDeviceName), m_page->pageID());
 }
 
 void WebPlaybackSessionManager::audioMediaSelectionIndexChanged(uint64_t contextId, uint64_t selectedIndex)
 {
-    m_page->send(Messages::WebPlaybackSessionManagerProxy::SetAudioMediaSelectionIndex(contextId, selectedIndex), m_page->pageID());
+    m_page->send(Messages::WebPlaybackSessionManagerProxy::AudioMediaSelectionIndexChanged(contextId, selectedIndex), m_page->pageID());
 }
 
 void WebPlaybackSessionManager::legibleMediaSelectionIndexChanged(uint64_t contextId, uint64_t selectedIndex)
 {
-    m_page->send(Messages::WebPlaybackSessionManagerProxy::SetLegibleMediaSelectionIndex(contextId, selectedIndex), m_page->pageID());
+    m_page->send(Messages::WebPlaybackSessionManagerProxy::LegibleMediaSelectionIndexChanged(contextId, selectedIndex), m_page->pageID());
 }
 
 void WebPlaybackSessionManager::wirelessVideoPlaybackDisabledChanged(uint64_t contextId, bool disabled)
 {
-    m_page->send(Messages::WebPlaybackSessionManagerProxy::SetWirelessVideoPlaybackDisabled(contextId, disabled));
+    m_page->send(Messages::WebPlaybackSessionManagerProxy::WirelessVideoPlaybackDisabledChanged(contextId, disabled));
 }
 
 void WebPlaybackSessionManager::mutedChanged(uint64_t contextId, bool muted)
 {
-    m_page->send(Messages::WebPlaybackSessionManagerProxy::SetMuted(contextId, muted));
+    m_page->send(Messages::WebPlaybackSessionManagerProxy::MutedChanged(contextId, muted));
 }
 
 #pragma mark Messages from WebPlaybackSessionManagerProxy:
@@ -462,6 +462,12 @@
     ensureModel(contextId).toggleMuted();
 }
 
+void WebPlaybackSessionManager::setMuted(uint64_t contextId, bool muted)
+{
+    UserGestureIndicator indicator(ProcessingUserGesture);
+    ensureModel(contextId).setMuted(muted);
+}
+
 } // namespace WebKit
 
 #endif // PLATFORM(IOS) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to