Replace uses of std::forward<T>(), std::unique_ptr<T>::clear() that landed in r162368
authorzandobersek@gmail.com <zandobersek@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 20 Jan 2014 22:05:08 +0000 (22:05 +0000)
committerzandobersek@gmail.com <zandobersek@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 20 Jan 2014 22:05:08 +0000 (22:05 +0000)
https://bugs.webkit.org/show_bug.cgi?id=127306

Reviewed by Darin Adler.

Address the post-landing reviews of the r162368 commit that moved WebAudio source code to using std::unique_ptr.
std::move() should be used instead of std::forward<T>() in HRTFKernel::create().
Instead of calling std::unique_ptr<T>::reset(), nullptr should be assigned to that smart pointer to reset it.

* Modules/webaudio/ConvolverNode.cpp:
(WebCore::ConvolverNode::uninitialize):
* Modules/webaudio/DynamicsCompressorNode.cpp:
(WebCore::DynamicsCompressorNode::uninitialize):
* Modules/webaudio/MediaElementAudioSourceNode.cpp:
(WebCore::MediaElementAudioSourceNode::setFormat):
* Modules/webaudio/PannerNode.cpp:
(WebCore::PannerNode::uninitialize):
* platform/audio/AudioChannel.h:
(WebCore::AudioChannel::set):
* platform/audio/HRTFDatabaseLoader.cpp:
(WebCore::HRTFDatabaseLoader::~HRTFDatabaseLoader):
* platform/audio/HRTFKernel.h:
(WebCore::HRTFKernel::create):

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

Source/WebCore/ChangeLog
Source/WebCore/Modules/webaudio/ConvolverNode.cpp
Source/WebCore/Modules/webaudio/DynamicsCompressorNode.cpp
Source/WebCore/Modules/webaudio/MediaElementAudioSourceNode.cpp
Source/WebCore/Modules/webaudio/PannerNode.cpp
Source/WebCore/platform/audio/AudioChannel.h
Source/WebCore/platform/audio/HRTFDatabaseLoader.cpp
Source/WebCore/platform/audio/HRTFKernel.h

index bd5bade..c3368fe 100644 (file)
@@ -1,3 +1,29 @@
+2014-01-20  Zan Dobersek  <zdobersek@igalia.com>
+
+        Replace uses of std::forward<T>(), std::unique_ptr<T>::clear() that landed in r162368
+        https://bugs.webkit.org/show_bug.cgi?id=127306
+
+        Reviewed by Darin Adler.
+
+        Address the post-landing reviews of the r162368 commit that moved WebAudio source code to using std::unique_ptr.
+        std::move() should be used instead of std::forward<T>() in HRTFKernel::create().
+        Instead of calling std::unique_ptr<T>::reset(), nullptr should be assigned to that smart pointer to reset it.
+
+        * Modules/webaudio/ConvolverNode.cpp:
+        (WebCore::ConvolverNode::uninitialize):
+        * Modules/webaudio/DynamicsCompressorNode.cpp:
+        (WebCore::DynamicsCompressorNode::uninitialize):
+        * Modules/webaudio/MediaElementAudioSourceNode.cpp:
+        (WebCore::MediaElementAudioSourceNode::setFormat):
+        * Modules/webaudio/PannerNode.cpp:
+        (WebCore::PannerNode::uninitialize):
+        * platform/audio/AudioChannel.h:
+        (WebCore::AudioChannel::set):
+        * platform/audio/HRTFDatabaseLoader.cpp:
+        (WebCore::HRTFDatabaseLoader::~HRTFDatabaseLoader):
+        * platform/audio/HRTFKernel.h:
+        (WebCore::HRTFKernel::create):
+
 2014-01-20  Joseph Pecoraro  <pecoraro@apple.com>
 
         Modernize WebCore/inspector with nullptr
index ac75ea7..c5ac5ea 100644 (file)
@@ -111,7 +111,7 @@ void ConvolverNode::uninitialize()
     if (!isInitialized())
         return;
 
-    m_reverb.reset();
+    m_reverb = nullptr;
     AudioNode::uninitialize();
 }
 
index 1d5a1b8..7b80242 100644 (file)
@@ -103,7 +103,7 @@ void DynamicsCompressorNode::uninitialize()
     if (!isInitialized())
         return;
 
-    m_dynamicsCompressor.reset();
+    m_dynamicsCompressor = nullptr;
     AudioNode::uninitialize();
 }
 
index a16b5c4..0e50258 100644 (file)
@@ -87,7 +87,7 @@ void MediaElementAudioSourceNode::setFormat(size_t numberOfChannels, float sourc
             m_multiChannelResampler = std::make_unique<MultiChannelResampler>(scaleFactor, numberOfChannels);
         } else {
             // Bypass resampling.
-            m_multiChannelResampler.reset();
+            m_multiChannelResampler = nullptr;
         }
 
         {
index 0cde2d3..17bf130 100644 (file)
@@ -154,7 +154,7 @@ void PannerNode::uninitialize()
     if (!isInitialized())
         return;
         
-    m_panner.reset();
+    m_panner = nullptr;
     AudioNode::uninitialize();
 }
 
index d0cc5d3..50ce0b7 100644 (file)
@@ -70,7 +70,7 @@ public:
     // storage represents external memory not managed by this object.
     void set(float* storage, size_t length)
     {
-        m_memBuffer.reset(); // cleanup managed storage
+        m_memBuffer = nullptr; // cleanup managed storage
         m_rawPointer = storage;
         m_length = length;
         m_silent = false;
index a1775df..af8d695 100644 (file)
@@ -77,7 +77,7 @@ HRTFDatabaseLoader::~HRTFDatabaseLoader()
     ASSERT(isMainThread());
 
     waitForLoaderThreadCompletion();
-    m_hrtfDatabase.reset();
+    m_hrtfDatabase = nullptr;
 
     // Remove ourself from the map.
     loaderMap().remove(m_databaseSampleRate);
index 768b1cb..c226983 100644 (file)
@@ -57,7 +57,7 @@ public:
 
     static PassRefPtr<HRTFKernel> create(std::unique_ptr<FFTFrame> fftFrame, float frameDelay, float sampleRate)
     {
-        return adoptRef(new HRTFKernel(std::forward<std::unique_ptr<FFTFrame>>(fftFrame), frameDelay, sampleRate));
+        return adoptRef(new HRTFKernel(std::move(fftFrame), frameDelay, sampleRate));
     }
 
     // Given two HRTFKernels, and an interpolation factor x: 0 -> 1, returns an interpolated HRTFKernel.