Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1870)

Unified Diff: third_party/WebKit/Source/platform/audio/AudioDestination.cpp

Issue 2080623002: Revert "Remove OwnPtr from Blink." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 145baa8b1b0396b055be770e83030af229c93c1a..53c329f641c17533c2589b3cd08de38e5b39b820 100644
--- a/third_party/WebKit/Source/platform/audio/AudioDestination.cpp
+++ b/third_party/WebKit/Source/platform/audio/AudioDestination.cpp
@@ -33,8 +33,6 @@
#include "platform/audio/AudioPullFIFO.h"
#include "public/platform/Platform.h"
#include "public/platform/WebSecurityOrigin.h"
-#include "wtf/PtrUtil.h"
-#include <memory>
namespace blink {
@@ -45,9 +43,9 @@ const unsigned renderBufferSize = 128;
const size_t fifoSize = 8192;
// Factory method: Chromium-implementation
-std::unique_ptr<AudioDestination> AudioDestination::create(AudioIOCallback& callback, const String& inputDeviceId, unsigned numberOfInputChannels, unsigned numberOfOutputChannels, float sampleRate, const PassRefPtr<SecurityOrigin>& securityOrigin)
+PassOwnPtr<AudioDestination> AudioDestination::create(AudioIOCallback& callback, const String& inputDeviceId, unsigned numberOfInputChannels, unsigned numberOfOutputChannels, float sampleRate, const PassRefPtr<SecurityOrigin>& securityOrigin)
{
- return wrapUnique(new AudioDestination(callback, inputDeviceId, numberOfInputChannels, numberOfOutputChannels, sampleRate, securityOrigin));
+ return adoptPtr(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)
@@ -91,7 +89,7 @@ AudioDestination::AudioDestination(AudioIOCallback& callback, const String& inpu
if (m_callbackBufferSize + renderBufferSize > fifoSize)
return;
- m_audioDevice = wrapUnique(Platform::current()->createAudioDevice(m_callbackBufferSize, numberOfInputChannels, numberOfOutputChannels, sampleRate, this, inputDeviceId, securityOrigin));
+ m_audioDevice = adoptPtr(Platform::current()->createAudioDevice(m_callbackBufferSize, numberOfInputChannels, numberOfOutputChannels, sampleRate, this, inputDeviceId, securityOrigin));
ASSERT(m_audioDevice);
// Record the sizes if we successfully created an output device.
@@ -103,10 +101,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 = wrapUnique(new AudioPullFIFO(*this, numberOfOutputChannels, fifoSize, renderBufferSize));
+ m_fifo = adoptPtr(new AudioPullFIFO(*this, numberOfOutputChannels, fifoSize, renderBufferSize));
// Input buffering.
- m_inputFifo = wrapUnique(new AudioFIFO(numberOfInputChannels, fifoSize));
+ m_inputFifo = adoptPtr(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.
« no previous file with comments | « third_party/WebKit/Source/platform/audio/AudioDestination.h ('k') | third_party/WebKit/Source/platform/audio/AudioResampler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698