Index: third_party/WebKit/Source/platform/audio/AudioDestination.cpp |
diff --git a/third_party/WebKit/Source/platform/audio/AudioDestination.cpp b/third_party/WebKit/Source/platform/audio/AudioDestination.cpp |
index 53c329f641c17533c2589b3cd08de38e5b39b820..145baa8b1b0396b055be770e83030af229c93c1a 100644 |
--- a/third_party/WebKit/Source/platform/audio/AudioDestination.cpp |
+++ b/third_party/WebKit/Source/platform/audio/AudioDestination.cpp |
@@ -33,6 +33,8 @@ |
#include "platform/audio/AudioPullFIFO.h" |
#include "public/platform/Platform.h" |
#include "public/platform/WebSecurityOrigin.h" |
+#include "wtf/PtrUtil.h" |
+#include <memory> |
namespace blink { |
@@ -43,9 +45,9 @@ const unsigned renderBufferSize = 128; |
const size_t fifoSize = 8192; |
// Factory method: Chromium-implementation |
-PassOwnPtr<AudioDestination> AudioDestination::create(AudioIOCallback& callback, const String& inputDeviceId, unsigned numberOfInputChannels, unsigned numberOfOutputChannels, float sampleRate, const PassRefPtr<SecurityOrigin>& securityOrigin) |
+std::unique_ptr<AudioDestination> AudioDestination::create(AudioIOCallback& callback, const String& inputDeviceId, unsigned numberOfInputChannels, unsigned numberOfOutputChannels, float sampleRate, const PassRefPtr<SecurityOrigin>& securityOrigin) |
{ |
- return adoptPtr(new AudioDestination(callback, inputDeviceId, numberOfInputChannels, numberOfOutputChannels, sampleRate, securityOrigin)); |
+ return wrapUnique(new AudioDestination(callback, inputDeviceId, numberOfInputChannels, numberOfOutputChannels, sampleRate, securityOrigin)); |
} |
AudioDestination::AudioDestination(AudioIOCallback& callback, const String& inputDeviceId, unsigned numberOfInputChannels, unsigned numberOfOutputChannels, float sampleRate, const PassRefPtr<SecurityOrigin>& securityOrigin) |
@@ -89,7 +91,7 @@ AudioDestination::AudioDestination(AudioIOCallback& callback, const String& inpu |
if (m_callbackBufferSize + renderBufferSize > fifoSize) |
return; |
- m_audioDevice = adoptPtr(Platform::current()->createAudioDevice(m_callbackBufferSize, numberOfInputChannels, numberOfOutputChannels, sampleRate, this, inputDeviceId, securityOrigin)); |
+ m_audioDevice = wrapUnique(Platform::current()->createAudioDevice(m_callbackBufferSize, numberOfInputChannels, numberOfOutputChannels, sampleRate, this, inputDeviceId, securityOrigin)); |
ASSERT(m_audioDevice); |
// Record the sizes if we successfully created an output device. |
@@ -101,10 +103,10 @@ AudioDestination::AudioDestination(AudioIOCallback& callback, const String& inpu |
// contains enough data, the data will be provided directly. |
// Otherwise, the FIFO will call the provider enough times to |
// satisfy the request for data. |
- m_fifo = adoptPtr(new AudioPullFIFO(*this, numberOfOutputChannels, fifoSize, renderBufferSize)); |
+ m_fifo = wrapUnique(new AudioPullFIFO(*this, numberOfOutputChannels, fifoSize, renderBufferSize)); |
// Input buffering. |
- m_inputFifo = adoptPtr(new AudioFIFO(numberOfInputChannels, fifoSize)); |
+ m_inputFifo = wrapUnique(new AudioFIFO(numberOfInputChannels, fifoSize)); |
// If the callback size does not match the render size, then we need to buffer some |
// extra silence for the input. Otherwise, we can over-consume the input FIFO. |