Title: [239374] trunk/Source/WebCore
Revision
239374
Author
[email protected]
Date
2018-12-19 03:20:16 -0800 (Wed, 19 Dec 2018)

Log Message

[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:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (239373 => 239374)


--- trunk/Source/WebCore/ChangeLog	2018-12-19 08:55:54 UTC (rev 239373)
+++ trunk/Source/WebCore/ChangeLog	2018-12-19 11:20:16 UTC (rev 239374)
@@ -1,3 +1,44 @@
+2018-12-19  Alicia Boya GarcĂ­a  <[email protected]>
+
+        [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  <[email protected]>
 
         [EME] MediaKeySystemConfiguration distinctiveIdentifier and persistentState should default to optional

Modified: trunk/Source/WebCore/platform/graphics/SourceBufferPrivateClient.h (239373 => 239374)


--- trunk/Source/WebCore/platform/graphics/SourceBufferPrivateClient.h	2018-12-19 08:55:54 UTC (rev 239373)
+++ trunk/Source/WebCore/platform/graphics/SourceBufferPrivateClient.h	2018-12-19 11:20:16 UTC (rev 239374)
@@ -71,8 +71,7 @@
     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;

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h (239373 => 239374)


--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h	2018-12-19 08:55:54 UTC (rev 239373)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h	2018-12-19 11:20:16 UTC (rev 239374)
@@ -102,7 +102,6 @@
     void trackDidChangeEnabled(AudioTrackPrivateMediaSourceAVFObjC*);
 
     void willSeek();
-    void seekToTime(const MediaTime&);
     MediaTime fastSeekTimeForMediaTime(const MediaTime&, const MediaTime& negativeThreshold, const MediaTime& positiveThreshold);
     FloatSize naturalSize();
 

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm (239373 => 239374)


--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm	2018-12-19 08:55:54 UTC (rev 239373)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm	2018-12-19 11:20:16 UTC (rev 239374)
@@ -1171,12 +1171,6 @@
     flush();
 }
 
-void SourceBufferPrivateAVFObjC::seekToTime(const MediaTime& time)
-{
-    if (m_client)
-        m_client->sourceBufferPrivateSeekToTime(time);
-}
-
 FloatSize SourceBufferPrivateAVFObjC::naturalSize()
 {
     return m_cachedSize.value_or(FloatSize());

Modified: trunk/Source/WebCore/platform/mock/mediasource/MockMediaSourcePrivate.cpp (239373 => 239374)


--- trunk/Source/WebCore/platform/mock/mediasource/MockMediaSourcePrivate.cpp	2018-12-19 08:55:54 UTC (rev 239373)
+++ trunk/Source/WebCore/platform/mock/mediasource/MockMediaSourcePrivate.cpp	2018-12-19 11:20:16 UTC (rev 239374)
@@ -165,9 +165,6 @@
             seekTime = sourceSeekTime;
     }
 
-    for (auto& buffer : m_activeSourceBuffers)
-        buffer->seekToTime(seekTime);
-
     return seekTime;
 }
 

Modified: trunk/Source/WebCore/platform/mock/mediasource/MockSourceBufferPrivate.cpp (239373 => 239374)


--- trunk/Source/WebCore/platform/mock/mediasource/MockSourceBufferPrivate.cpp	2018-12-19 08:55:54 UTC (rev 239373)
+++ trunk/Source/WebCore/platform/mock/mediasource/MockSourceBufferPrivate.cpp	2018-12-19 11:20:16 UTC (rev 239374)
@@ -289,13 +289,7 @@
     return time;
 }
 
-void MockSourceBufferPrivate::seekToTime(const MediaTime& time)
-{
-    if (m_client)
-        m_client->sourceBufferPrivateSeekToTime(time);
 }
 
-}
-
 #endif
 

Modified: trunk/Source/WebCore/platform/mock/mediasource/MockSourceBufferPrivate.h (239373 => 239374)


--- trunk/Source/WebCore/platform/mock/mediasource/MockSourceBufferPrivate.h	2018-12-19 08:55:54 UTC (rev 239373)
+++ trunk/Source/WebCore/platform/mock/mediasource/MockSourceBufferPrivate.h	2018-12-19 11:20:16 UTC (rev 239374)
@@ -49,7 +49,6 @@
     bool hasVideo() const;
     bool hasAudio() const;
 
-    void seekToTime(const MediaTime&);
     MediaTime fastSeekTimeForMediaTime(const MediaTime&, const MediaTime& negativeThreshold, const MediaTime& positiveThreshold);
 
 private:
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to