Title: [278333] trunk/Source/WebCore
Revision
278333
Author
cdu...@apple.com
Date
2021-06-01 17:14:56 -0700 (Tue, 01 Jun 2021)

Log Message

Drop unused AudioChannel::resizeSmaller()
https://bugs.webkit.org/show_bug.cgi?id=226516

Reviewed by Sam Weinig.

* platform/audio/AudioBus.cpp:
* platform/audio/AudioBus.h:
* platform/audio/AudioChannel.cpp:
* platform/audio/AudioChannel.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (278332 => 278333)


--- trunk/Source/WebCore/ChangeLog	2021-06-01 23:23:21 UTC (rev 278332)
+++ trunk/Source/WebCore/ChangeLog	2021-06-02 00:14:56 UTC (rev 278333)
@@ -1,3 +1,15 @@
+2021-06-01  Chris Dumez  <cdu...@apple.com>
+
+        Drop unused AudioChannel::resizeSmaller()
+        https://bugs.webkit.org/show_bug.cgi?id=226516
+
+        Reviewed by Sam Weinig.
+
+        * platform/audio/AudioBus.cpp:
+        * platform/audio/AudioBus.h:
+        * platform/audio/AudioChannel.cpp:
+        * platform/audio/AudioChannel.h:
+
 2021-06-01  Wenson Hsieh  <wenson_hs...@apple.com>
 
         [macOS] Data detector highlights should appear when hovering inside image overlays

Modified: trunk/Source/WebCore/platform/audio/AudioBus.cpp (278332 => 278333)


--- trunk/Source/WebCore/platform/audio/AudioBus.cpp	2021-06-01 23:23:21 UTC (rev 278332)
+++ trunk/Source/WebCore/platform/audio/AudioBus.cpp	2021-06-02 00:14:56 UTC (rev 278333)
@@ -73,16 +73,6 @@
     }
 }
 
-void AudioBus::resizeSmaller(size_t newLength)
-{
-    ASSERT(newLength <= m_length);
-    if (newLength <= m_length)
-        m_length = newLength;
-
-    for (unsigned i = 0; i < m_channels.size(); ++i)
-        m_channels[i]->resizeSmaller(newLength);
-}
-
 void AudioBus::zero()
 {
     for (unsigned i = 0; i < m_channels.size(); ++i)

Modified: trunk/Source/WebCore/platform/audio/AudioBus.h (278332 => 278333)


--- trunk/Source/WebCore/platform/audio/AudioBus.h	2021-06-01 23:23:21 UTC (rev 278332)
+++ trunk/Source/WebCore/platform/audio/AudioBus.h	2021-06-02 00:14:56 UTC (rev 278333)
@@ -83,10 +83,6 @@
     // Number of sample-frames
     size_t length() const { return m_length; }
 
-    // resizeSmaller() can only be called with a new length <= the current length.
-    // The data stored in the bus will remain undisturbed.
-    void resizeSmaller(size_t newLength);
-
     // Sample-rate : 0.0 if unknown or "don't care"
     float sampleRate() const { return m_sampleRate; }
     void setSampleRate(float sampleRate) { m_sampleRate = sampleRate; }

Modified: trunk/Source/WebCore/platform/audio/AudioChannel.cpp (278332 => 278333)


--- trunk/Source/WebCore/platform/audio/AudioChannel.cpp	2021-06-01 23:23:21 UTC (rev 278332)
+++ trunk/Source/WebCore/platform/audio/AudioChannel.cpp	2021-06-02 00:14:56 UTC (rev 278333)
@@ -38,13 +38,6 @@
 
 namespace WebCore {
 
-void AudioChannel::resizeSmaller(size_t newLength)
-{
-    ASSERT(newLength <= m_length);
-    if (newLength <= m_length)
-        m_length = newLength;
-}
-
 void AudioChannel::scale(float scale)
 {
     if (isSilent())

Modified: trunk/Source/WebCore/platform/audio/AudioChannel.h (278332 => 278333)


--- trunk/Source/WebCore/platform/audio/AudioChannel.h	2021-06-01 23:23:21 UTC (rev 278332)
+++ trunk/Source/WebCore/platform/audio/AudioChannel.h	2021-06-02 00:14:56 UTC (rev 278333)
@@ -44,9 +44,9 @@
     // Memory can be externally referenced, or can be internally allocated with an AudioFloatArray.
 
     // Reference an external buffer.
-    explicit AudioChannel(float* storage, size_t length)
-        : m_length(length)
-        , m_rawPointer(storage)
+    AudioChannel(float* storage, size_t length)
+        : m_rawPointer(storage)
+        , m_length(length)
         , m_silent(false)
     {
     }
@@ -53,9 +53,9 @@
 
     // Manage storage for us.
     explicit AudioChannel(size_t length)
-        : m_length(length)
+        : m_memBuffer(makeUnique<AudioFloatArray>(length))
+        , m_length(length)
     {
-        m_memBuffer = makeUnique<AudioFloatArray>(length);
     }
 
     // A "blank" audio channel -- must call set() before it's useful...
@@ -74,10 +74,6 @@
     // How many sample-frames do we contain?
     size_t length() const { return m_length; }
 
-    // resizeSmaller() can only be called with a new length <= the current length.
-    // The data stored in the bus will remain undisturbed.
-    void resizeSmaller(size_t newLength);
-
     // Direct access to PCM sample data. Non-const accessor clears silent flag.
     float* mutableData()
     {
@@ -122,10 +118,9 @@
     float maxAbsValue() const;
 
 private:
-    size_t m_length { 0 };
-
     float* m_rawPointer { nullptr };
     std::unique_ptr<AudioFloatArray> m_memBuffer;
+    size_t m_length { 0 };
     bool m_silent { true };
 };
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to