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

Unified Diff: media/base/audio_bus.cc

Issue 1906423005: Replace scoped_ptr with std::unique_ptr in //media/base. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: scopedptr-media-base: android Created 4 years, 8 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
« no previous file with comments | « media/base/audio_bus.h ('k') | media/base/audio_bus_perftest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/audio_bus.cc
diff --git a/media/base/audio_bus.cc b/media/base/audio_bus.cc
index 587df8037656d7ca297cd85c3800c43398135276..8b7fa3dde87589dc5188791d58e6868778b3c901 100644
--- a/media/base/audio_bus.cc
+++ b/media/base/audio_bus.cc
@@ -10,6 +10,7 @@
#include <limits>
#include "base/logging.h"
+#include "base/memory/ptr_util.h"
#include "base/numerics/safe_conversions.h"
#include "media/base/audio_parameters.h"
#include "media/base/limits.h"
@@ -153,39 +154,41 @@ AudioBus::AudioBus(int channels)
AudioBus::~AudioBus() {}
-scoped_ptr<AudioBus> AudioBus::Create(int channels, int frames) {
- return scoped_ptr<AudioBus>(new AudioBus(channels, frames));
+std::unique_ptr<AudioBus> AudioBus::Create(int channels, int frames) {
+ return base::WrapUnique(new AudioBus(channels, frames));
}
-scoped_ptr<AudioBus> AudioBus::Create(const AudioParameters& params) {
- return scoped_ptr<AudioBus>(new AudioBus(
- params.channels(), params.frames_per_buffer()));
+std::unique_ptr<AudioBus> AudioBus::Create(const AudioParameters& params) {
+ return base::WrapUnique(
+ new AudioBus(params.channels(), params.frames_per_buffer()));
}
-scoped_ptr<AudioBus> AudioBus::CreateWrapper(int channels) {
- return scoped_ptr<AudioBus>(new AudioBus(channels));
+std::unique_ptr<AudioBus> AudioBus::CreateWrapper(int channels) {
+ return base::WrapUnique(new AudioBus(channels));
}
-scoped_ptr<AudioBus> AudioBus::WrapVector(
- int frames, const std::vector<float*>& channel_data) {
- return scoped_ptr<AudioBus>(new AudioBus(frames, channel_data));
+std::unique_ptr<AudioBus> AudioBus::WrapVector(
+ int frames,
+ const std::vector<float*>& channel_data) {
+ return base::WrapUnique(new AudioBus(frames, channel_data));
}
-scoped_ptr<AudioBus> AudioBus::WrapMemory(int channels, int frames,
- void* data) {
+std::unique_ptr<AudioBus> AudioBus::WrapMemory(int channels,
+ int frames,
+ void* data) {
// |data| must be aligned by AudioBus::kChannelAlignment.
CHECK(IsAligned(data));
- return scoped_ptr<AudioBus>(new AudioBus(
- channels, frames, static_cast<float*>(data)));
+ return base::WrapUnique(
+ new AudioBus(channels, frames, static_cast<float*>(data)));
}
-scoped_ptr<AudioBus> AudioBus::WrapMemory(const AudioParameters& params,
- void* data) {
+std::unique_ptr<AudioBus> AudioBus::WrapMemory(const AudioParameters& params,
+ void* data) {
// |data| must be aligned by AudioBus::kChannelAlignment.
CHECK(IsAligned(data));
- return scoped_ptr<AudioBus>(new AudioBus(
- params.channels(), params.frames_per_buffer(),
- static_cast<float*>(data)));
+ return base::WrapUnique(new AudioBus(params.channels(),
+ params.frames_per_buffer(),
+ static_cast<float*>(data)));
}
void AudioBus::SetChannelData(int channel, float* data) {
« no previous file with comments | « media/base/audio_bus.h ('k') | media/base/audio_bus_perftest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698