Commit 217aa287 authored by zandobersek@gmail.com's avatar zandobersek@gmail.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):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@162376 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent ed8058ee
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
......@@ -111,7 +111,7 @@ void ConvolverNode::uninitialize()
if (!isInitialized())
return;
m_reverb.reset();
m_reverb = nullptr;
AudioNode::uninitialize();
}
......
......@@ -103,7 +103,7 @@ void DynamicsCompressorNode::uninitialize()
if (!isInitialized())
return;
m_dynamicsCompressor.reset();
m_dynamicsCompressor = nullptr;
AudioNode::uninitialize();
}
......
......@@ -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;
}
{
......
......@@ -154,7 +154,7 @@ void PannerNode::uninitialize()
if (!isInitialized())
return;
m_panner.reset();
m_panner = nullptr;
AudioNode::uninitialize();
}
......
......@@ -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;
......
......@@ -77,7 +77,7 @@ HRTFDatabaseLoader::~HRTFDatabaseLoader()
ASSERT(isMainThread());
waitForLoaderThreadCompletion();
m_hrtfDatabase.reset();
m_hrtfDatabase = nullptr;
// Remove ourself from the map.
loaderMap().remove(m_databaseSampleRate);
......
......@@ -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.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment