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

Unified Diff: third_party/WebKit/Source/platform/audio/AudioBus.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/AudioBus.cpp
diff --git a/third_party/WebKit/Source/platform/audio/AudioBus.cpp b/third_party/WebKit/Source/platform/audio/AudioBus.cpp
index 91483ad6bd9ae7b2b8ca0502df483fdf0be62d5f..2c8d4f42bddcaf86b2a1d78f8d9048f363e7cce1 100644
--- a/third_party/WebKit/Source/platform/audio/AudioBus.cpp
+++ b/third_party/WebKit/Source/platform/audio/AudioBus.cpp
@@ -33,11 +33,10 @@
#include "platform/audio/VectorMath.h"
#include "public/platform/Platform.h"
#include "public/platform/WebAudioBus.h"
-#include "wtf/PtrUtil.h"
-#include <algorithm>
+#include "wtf/OwnPtr.h"
#include <assert.h>
#include <math.h>
-#include <memory>
+#include <algorithm>
namespace blink {
@@ -63,7 +62,7 @@ AudioBus::AudioBus(unsigned numberOfChannels, size_t length, bool allocate)
m_channels.reserveInitialCapacity(numberOfChannels);
for (unsigned i = 0; i < numberOfChannels; ++i) {
- std::unique_ptr<AudioChannel> channel = allocate ? wrapUnique(new AudioChannel(length)) : wrapUnique(new AudioChannel(0, length));
+ PassOwnPtr<AudioChannel> channel = allocate ? adoptPtr(new AudioChannel(length)) : adoptPtr(new AudioChannel(0, length));
m_channels.append(std::move(channel));
}
@@ -490,7 +489,7 @@ void AudioBus::copyWithGainFrom(const AudioBus &sourceBus, float* lastMixGain, f
if (framesToDezipper) {
if (!m_dezipperGainValues.get() || m_dezipperGainValues->size() < framesToDezipper)
- m_dezipperGainValues = wrapUnique(new AudioFloatArray(framesToDezipper));
+ m_dezipperGainValues = adoptPtr(new AudioFloatArray(framesToDezipper));
float* gainValues = m_dezipperGainValues->data();
for (unsigned i = 0; i < framesToDezipper; ++i) {
« no previous file with comments | « third_party/WebKit/Source/platform/audio/AudioBus.h ('k') | third_party/WebKit/Source/platform/audio/AudioChannel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698