Remove MediaPlayerPrivate::supportsMuting()
authoryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 24 Jul 2019 23:51:24 +0000 (23:51 +0000)
committeryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 24 Jul 2019 23:51:24 +0000 (23:51 +0000)
https://bugs.webkit.org/show_bug.cgi?id=200005

Reviewed by Eric Carlson.

Remove no longer needed interface method.
No change of behavior.

* WebCore.order:
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::setVolume):
(WebCore::MediaPlayer::setMuted):
* platform/graphics/MediaPlayerPrivate.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
* platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
* platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@247800 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/WebCore.order
Source/WebCore/platform/graphics/MediaPlayer.cpp
Source/WebCore/platform/graphics/MediaPlayerPrivate.h
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h
Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h
Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp
Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.h

index 6b31726..0ff137f 100644 (file)
@@ -1,3 +1,25 @@
+2019-07-24  Youenn Fablet  <youenn@apple.com>
+
+        Remove MediaPlayerPrivate::supportsMuting()
+        https://bugs.webkit.org/show_bug.cgi?id=200005
+
+        Reviewed by Eric Carlson.
+
+        Remove no longer needed interface method.
+        No change of behavior.
+
+        * WebCore.order:
+        * platform/graphics/MediaPlayer.cpp:
+        (WebCore::MediaPlayer::setVolume):
+        (WebCore::MediaPlayer::setMuted):
+        * platform/graphics/MediaPlayerPrivate.h:
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
+        * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
+        * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
+
 2019-07-24  Tim Horton  <timothy_horton@apple.com>
 
         Daring Fireball long press highlights are unnecessarily inflated due to false illegibility
index e8a6ca3..37d245e 100644 (file)
@@ -15119,7 +15119,6 @@ __ZN7WebCore27MediaPlayerPrivateInterface10setPreloadENS_11MediaPlayer7PreloadE
 __ZN7WebCore11MediaPlayer17setPreservesPitchEb
 __ZN7WebCore22NullMediaPlayerPrivate17setPreservesPitchEb
 __ZN7WebCore11MediaPlayer8setMutedEb
-__ZNK7WebCore22NullMediaPlayerPrivate14supportsMutingEv
 __ZN7WebCore27MediaPlayerPrivateInterface9setVolumeEf
 __ZN7WebCore11MediaPlayer9setVolumeEd
 __ZN7WebCore22NullMediaPlayerPrivate15setVolumeDoubleEd
@@ -15865,7 +15864,6 @@ __ZN7WebCore11MediaPlayer7setRateEd
 __ZN7WebCore27MediaPlayerPrivateInterface13setRateDoubleEd
 __ZN7WebCore30MediaPlayerPrivateAVFoundation7setRateEf
 __ZN7WebCore34MediaPlayerPrivateAVFoundationObjC10updateRateEv
-__ZNK7WebCore27MediaPlayerPrivateInterface14supportsMutingEv
 __ZN7WebCore34MediaPlayerPrivateAVFoundationObjC9setVolumeEf
 __ZN7WebCore11MediaPlayer4playEv
 __ZN7WebCore30MediaPlayerPrivateAVFoundation4playEv
index 01149c4..757f095 100644 (file)
@@ -100,71 +100,70 @@ static RefPtr<Logger>& nullLogger()
 
 // a null player to make MediaPlayer logic simpler
 
-class NullMediaPlayerPrivate : public MediaPlayerPrivateInterface {
+class NullMediaPlayerPrivate final : public MediaPlayerPrivateInterface {
 public:
     explicit NullMediaPlayerPrivate(MediaPlayer*) { }
 
-    void load(const String&) override { }
+    void load(const String&) final { }
 #if ENABLE(MEDIA_SOURCE)
-    void load(const String&, MediaSourcePrivateClient*) override { }
+    void load(const String&, MediaSourcePrivateClient*) final { }
 #endif
 #if ENABLE(MEDIA_STREAM)
-    void load(MediaStreamPrivate&) override { }
+    void load(MediaStreamPrivate&) final { }
 #endif
-    void cancelLoad() override { }
+    void cancelLoad() final { }
 
-    void prepareToPlay() override { }
-    void play() override { }
-    void pause() override { }
+    void prepareToPlay() final { }
+    void play() final { }
+    void pause() final { }
 
-    PlatformLayer* platformLayer() const override { return 0; }
+    PlatformLayer* platformLayer() const final { return 0; }
 
-    FloatSize naturalSize() const override { return FloatSize(); }
+    FloatSize naturalSize() const final { return FloatSize(); }
 
-    bool hasVideo() const override { return false; }
-    bool hasAudio() const override { return false; }
+    bool hasVideo() const final { return false; }
+    bool hasAudio() const final { return false; }
 
-    void setVisible(bool) override { }
+    void setVisible(bool) final { }
 
-    double durationDouble() const override { return 0; }
+    double durationDouble() const final { return 0; }
 
-    double currentTimeDouble() const override { return 0; }
-    void seekDouble(double) override { }
-    bool seeking() const override { return false; }
+    double currentTimeDouble() const final { return 0; }
+    void seekDouble(double) final { }
+    bool seeking() const final { return false; }
 
-    void setRateDouble(double) override { }
-    void setPreservesPitch(bool) override { }
-    bool paused() const override { return true; }
+    void setRateDouble(double) final { }
+    void setPreservesPitch(bool) final { }
+    bool paused() const final { return true; }
 
-    void setVolumeDouble(double) override { }
+    void setVolumeDouble(double) final { }
 
-    bool supportsMuting() const override { return false; }
-    void setMuted(bool) override { }
+    void setMuted(bool) final { }
 
-    bool hasClosedCaptions() const override { return false; }
-    void setClosedCaptionsVisible(bool) override { };
+    bool hasClosedCaptions() const final { return false; }
+    void setClosedCaptionsVisible(bool) final { };
 
-    MediaPlayer::NetworkState networkState() const override { return MediaPlayer::Empty; }
-    MediaPlayer::ReadyState readyState() const override { return MediaPlayer::HaveNothing; }
+    MediaPlayer::NetworkState networkState() const final { return MediaPlayer::Empty; }
+    MediaPlayer::ReadyState readyState() const final { return MediaPlayer::HaveNothing; }
 
-    float maxTimeSeekable() const override { return 0; }
-    double minTimeSeekable() const override { return 0; }
-    std::unique_ptr<PlatformTimeRanges> buffered() const override { return std::make_unique<PlatformTimeRanges>(); }
+    float maxTimeSeekable() const final { return 0; }
+    double minTimeSeekable() const final { return 0; }
+    std::unique_ptr<PlatformTimeRanges> buffered() const final { return std::make_unique<PlatformTimeRanges>(); }
 
-    double seekableTimeRangesLastModifiedTime() const override { return 0; }
-    double liveUpdateInterval() const override { return 0; }
+    double seekableTimeRangesLastModifiedTime() const final { return 0; }
+    double liveUpdateInterval() const final { return 0; }
 
-    unsigned long long totalBytes() const override { return 0; }
-    bool didLoadingProgress() const override { return false; }
+    unsigned long long totalBytes() const final { return 0; }
+    bool didLoadingProgress() const final { return false; }
 
-    void setSize(const IntSize&) override { }
+    void setSize(const IntSize&) final { }
 
-    void paint(GraphicsContext&, const FloatRect&) override { }
+    void paint(GraphicsContext&, const FloatRect&) final { }
 
-    bool canLoadPoster() const override { return false; }
-    void setPoster(const String&) override { }
+    bool canLoadPoster() const final { return false; }
+    void setPoster(const String&) final { }
 
-    bool hasSingleSecurityOrigin() const override { return true; }
+    bool hasSingleSecurityOrigin() const final { return true; }
 };
 
 class NullMediaPlayerClient : public MediaPlayerClient {
@@ -777,9 +776,7 @@ double MediaPlayer::volume() const
 void MediaPlayer::setVolume(double volume)
 {
     m_volume = volume;
-
-    if (m_private->supportsMuting() || !m_muted)
-        m_private->setVolumeDouble(volume);
+    m_private->setVolumeDouble(volume);
 }
 
 bool MediaPlayer::muted() const
@@ -791,10 +788,7 @@ void MediaPlayer::setMuted(bool muted)
 {
     m_muted = muted;
 
-    if (m_private->supportsMuting())
-        m_private->setMuted(muted);
-    else
-        m_private->setVolume(muted ? 0 : m_volume);
+    m_private->setMuted(muted);
 }
 
 bool MediaPlayer::hasClosedCaptions() const
index c79d480..00d85a4 100644 (file)
@@ -118,7 +118,6 @@ public:
     virtual float volume() const { return 1; }
 #endif
 
-    virtual bool supportsMuting() const { return false; }
     virtual void setMuted(bool) { }
 
     virtual bool hasClosedCaptions() const { return false; }    
index 7e6220c..5b59961 100644 (file)
@@ -171,7 +171,6 @@ private:
     bool platformPaused() const override;
     MediaTime currentMediaTime() const override;
     void setVolume(float) override;
-    bool supportsMuting() const override { return true; }
     void setMuted(bool) override;
     void setClosedCaptionsVisible(bool) override;
     void paint(GraphicsContext&, const FloatRect&) override;
index d0210a4..7396e5b 100644 (file)
@@ -189,7 +189,6 @@ private:
     bool paused() const override;
 
     void setVolume(float volume) override;
-    bool supportsMuting() const override { return true; }
     void setMuted(bool) override;
 
     bool supportsScanning() const override;
index ebdaeec..c5f260a 100644 (file)
@@ -121,7 +121,6 @@ private:
 
     void setVolume(float) override;
     void setMuted(bool) override;
-    bool supportsMuting() const override { return true; }
 
     bool supportsScanning() const override { return false; }
 
index f62ced5..ed92f78 100644 (file)
@@ -112,7 +112,6 @@ public:
     bool ensureGstGLContext();
     GstContext* requestGLContext(const char* contextType);
 #endif
-    bool supportsMuting() const override { return true; }
     void setMuted(bool) override;
     bool muted() const;
 
index cbd01e0..5838ec1 100644 (file)
@@ -279,11 +279,6 @@ void MediaPlayerPrivateMediaFoundation::setVolume(float volume)
         m_volume = volume;
 }
 
-bool MediaPlayerPrivateMediaFoundation::supportsMuting() const
-{
-    return true;
-}
-
 void MediaPlayerPrivateMediaFoundation::setMuted(bool muted)
 {
     setAllChannelVolumes(muted ? 0.0 : m_volume);
index 2d83f97..90e9b72 100644 (file)
@@ -46,7 +46,7 @@
 
 namespace WebCore {
 
-class MediaPlayerPrivateMediaFoundation : public MediaPlayerPrivateInterface, public CanMakeWeakPtr<MediaPlayerPrivateMediaFoundation> {
+class MediaPlayerPrivateMediaFoundation final : public MediaPlayerPrivateInterface, public CanMakeWeakPtr<MediaPlayerPrivateMediaFoundation> {
 public:
     explicit MediaPlayerPrivateMediaFoundation(MediaPlayer*);
     ~MediaPlayerPrivateMediaFoundation();
@@ -56,49 +56,48 @@ public:
     static MediaPlayer::SupportsType supportsType(const MediaEngineSupportParameters&);
     static bool isAvailable();
 
-    void load(const String& url) override;
-    void cancelLoad() override;
+    void load(const String& url) final;
+    void cancelLoad() final;
 
-    void play() override;
-    void pause() override;
+    void play() final;
+    void pause() final;
 
-    bool supportsFullscreen() const override;
+    bool supportsFullscreen() const final;
 
-    FloatSize naturalSize() const override;
+    FloatSize naturalSize() const final;
 
-    bool hasVideo() const override;
-    bool hasAudio() const override;
+    bool hasVideo() const final;
+    bool hasAudio() const final;
 
-    void setVisible(bool) override;
+    void setVisible(bool) final;
 
-    bool seeking() const override;
-    void seek(float) override;
+    bool seeking() const final;
+    void seek(float) final;
 
-    void setRate(float) override;
+    void setRate(float) final;
 
-    float duration() const override;
+    float duration() const final;
 
-    float currentTime() const override;
+    float currentTime() const final;
 
-    bool paused() const override;
+    bool paused() const final;
 
-    void setVolume(float) override;
+    void setVolume(float) final;
 
-    bool supportsMuting() const override;
-    void setMuted(bool) override;
+    void setMuted(bool) final;
 
-    MediaPlayer::NetworkState networkState() const override;
-    MediaPlayer::ReadyState readyState() const override;
+    MediaPlayer::NetworkState networkState() const final;
+    MediaPlayer::ReadyState readyState() const final;
 
-    float maxTimeSeekable() const override;
+    float maxTimeSeekable() const final;
 
-    std::unique_ptr<PlatformTimeRanges> buffered() const override;
+    std::unique_ptr<PlatformTimeRanges> buffered() const final;
 
-    bool didLoadingProgress() const override;
+    bool didLoadingProgress() const final;
 
-    void setSize(const IntSize&) override;
+    void setSize(const IntSize&) final;
 
-    void paint(GraphicsContext&, const FloatRect&) override;
+    void paint(GraphicsContext&, const FloatRect&) final;
 
 private:
     WeakPtr<MediaPlayerPrivateMediaFoundation> m_weakThis;