[MSE] Remove dead code: sourceBufferPrivateSeekToTime()
authoraboya@igalia.com <aboya@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 19 Dec 2018 11:20:16 +0000 (11:20 +0000)
committeraboya@igalia.com <aboya@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 19 Dec 2018 11:20:16 +0000 (11:20 +0000)
https://bugs.webkit.org/show_bug.cgi?id=192827

Reviewed by Xabier Rodriguez-Calvar.

This patch makes two dead code removal changes in
SourceBufferPrivateClient:

First, sourceBufferPrivateFastSeekTimeForMediaTime() is made pure
virtual in SourceBufferPrivateClient. Since SourceBufferPrivateClient
is only inherited by SourceBuffer, it makes no sense to have default
implementations there (they will never be used), moreso it being a
client interface.

Second, sourceBufferPrivateSeekToTime() is removed entirely. It used
to had an empty implementation, which SourceBuffer did not overwrite,
therefore making any calls to it useless.

All calls to sourceBufferPrivateSeekToTime() have been removed:

SourceBufferPrivateAVFObjC::seekToTime(), which was also dead code
itself, used to call this method. This patch deletes it completely.

MockSourceBufferPrivate::seekToTime(), which only called this empty
method, has also been removed along with its only usage in
MockMediaSourcePrivate::seekToTime().

* platform/graphics/SourceBufferPrivateClient.h:
(WebCore::SourceBufferPrivateClient::sourceBufferPrivateFastSeekTimeForMediaTime): Deleted.
(WebCore::SourceBufferPrivateClient::sourceBufferPrivateSeekToTime): Deleted.
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::seekToTime): Deleted.
* platform/mock/mediasource/MockMediaSourcePrivate.cpp:
(WebCore::MockMediaSourcePrivate::seekToTime):
* platform/mock/mediasource/MockSourceBufferPrivate.cpp:
(WebCore::MockSourceBufferPrivate::seekToTime): Deleted.
* platform/mock/mediasource/MockSourceBufferPrivate.h:

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

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/SourceBufferPrivateClient.h
Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h
Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm
Source/WebCore/platform/mock/mediasource/MockMediaSourcePrivate.cpp
Source/WebCore/platform/mock/mediasource/MockSourceBufferPrivate.cpp
Source/WebCore/platform/mock/mediasource/MockSourceBufferPrivate.h

index af174d4..cbf0ca3 100644 (file)
@@ -1,3 +1,44 @@
+2018-12-19  Alicia Boya GarcĂ­a  <aboya@igalia.com>
+
+        [MSE] Remove dead code: sourceBufferPrivateSeekToTime()
+        https://bugs.webkit.org/show_bug.cgi?id=192827
+
+        Reviewed by Xabier Rodriguez-Calvar.
+
+        This patch makes two dead code removal changes in
+        SourceBufferPrivateClient:
+
+        First, sourceBufferPrivateFastSeekTimeForMediaTime() is made pure
+        virtual in SourceBufferPrivateClient. Since SourceBufferPrivateClient
+        is only inherited by SourceBuffer, it makes no sense to have default
+        implementations there (they will never be used), moreso it being a
+        client interface.
+
+        Second, sourceBufferPrivateSeekToTime() is removed entirely. It used
+        to had an empty implementation, which SourceBuffer did not overwrite,
+        therefore making any calls to it useless.
+
+        All calls to sourceBufferPrivateSeekToTime() have been removed:
+
+        SourceBufferPrivateAVFObjC::seekToTime(), which was also dead code
+        itself, used to call this method. This patch deletes it completely.
+
+        MockSourceBufferPrivate::seekToTime(), which only called this empty
+        method, has also been removed along with its only usage in
+        MockMediaSourcePrivate::seekToTime().
+
+        * platform/graphics/SourceBufferPrivateClient.h:
+        (WebCore::SourceBufferPrivateClient::sourceBufferPrivateFastSeekTimeForMediaTime): Deleted.
+        (WebCore::SourceBufferPrivateClient::sourceBufferPrivateSeekToTime): Deleted.
+        * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
+        * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
+        (WebCore::SourceBufferPrivateAVFObjC::seekToTime): Deleted.
+        * platform/mock/mediasource/MockMediaSourcePrivate.cpp:
+        (WebCore::MockMediaSourcePrivate::seekToTime):
+        * platform/mock/mediasource/MockSourceBufferPrivate.cpp:
+        (WebCore::MockSourceBufferPrivate::seekToTime): Deleted.
+        * platform/mock/mediasource/MockSourceBufferPrivate.h:
+
 2018-12-19  Xabier Rodriguez Calvar  <calvaris@igalia.com>
 
         [EME] MediaKeySystemConfiguration distinctiveIdentifier and persistentState should default to optional
index 11e9a27..0b6adbe 100644 (file)
@@ -71,8 +71,7 @@ public:
     virtual void sourceBufferPrivateReenqueSamples(const AtomicString& trackID) = 0;
     virtual void sourceBufferPrivateDidBecomeReadyForMoreSamples(const AtomicString& trackID) = 0;
 
-    virtual MediaTime sourceBufferPrivateFastSeekTimeForMediaTime(const MediaTime& time, const MediaTime&, const MediaTime&) { return time; }
-    virtual void sourceBufferPrivateSeekToTime(const MediaTime&) { };
+    virtual MediaTime sourceBufferPrivateFastSeekTimeForMediaTime(const MediaTime&, const MediaTime&, const MediaTime&) = 0;
 
     enum AppendResult { AppendSucceeded, ReadStreamFailed, ParsingFailed };
     virtual void sourceBufferPrivateAppendComplete(AppendResult) = 0;
index 8300dc3..2080cf7 100644 (file)
@@ -102,7 +102,6 @@ public:
     void trackDidChangeEnabled(AudioTrackPrivateMediaSourceAVFObjC*);
 
     void willSeek();
-    void seekToTime(const MediaTime&);
     MediaTime fastSeekTimeForMediaTime(const MediaTime&, const MediaTime& negativeThreshold, const MediaTime& positiveThreshold);
     FloatSize naturalSize();
 
index a99feb7..c21c5d2 100644 (file)
@@ -1171,12 +1171,6 @@ void SourceBufferPrivateAVFObjC::willSeek()
     flush();
 }
 
-void SourceBufferPrivateAVFObjC::seekToTime(const MediaTime& time)
-{
-    if (m_client)
-        m_client->sourceBufferPrivateSeekToTime(time);
-}
-
 FloatSize SourceBufferPrivateAVFObjC::naturalSize()
 {
     return m_cachedSize.value_or(FloatSize());
index abc3ba5..ec15367 100644 (file)
@@ -165,9 +165,6 @@ MediaTime MockMediaSourcePrivate::seekToTime(const MediaTime& targetTime, const
             seekTime = sourceSeekTime;
     }
 
-    for (auto& buffer : m_activeSourceBuffers)
-        buffer->seekToTime(seekTime);
-
     return seekTime;
 }
 
index 2a8b24b..1be1ae5 100644 (file)
@@ -289,12 +289,6 @@ MediaTime MockSourceBufferPrivate::fastSeekTimeForMediaTime(const MediaTime& tim
     return time;
 }
 
-void MockSourceBufferPrivate::seekToTime(const MediaTime& time)
-{
-    if (m_client)
-        m_client->sourceBufferPrivateSeekToTime(time);
-}
-
 }
 
 #endif
index b3f8af4..a264fb5 100644 (file)
@@ -49,7 +49,6 @@ public:
     bool hasVideo() const;
     bool hasAudio() const;
 
-    void seekToTime(const MediaTime&);
     MediaTime fastSeekTimeForMediaTime(const MediaTime&, const MediaTime& negativeThreshold, const MediaTime& positiveThreshold);
 
 private: