Replace scoped_ptr with unique_ptr in webrtc/modules/audio_processing/

BUG=webrtc:5520

Review URL: https://codereview.webrtc.org/1710483002

Cr-Commit-Position: refs/heads/master@{#11684}
This commit is contained in:
kwiberg
2016-02-19 07:04:49 -08:00
committed by Commit bot
parent df88460372
commit 88788adcfd
28 changed files with 111 additions and 95 deletions

View File

@ -12,11 +12,11 @@
#define WEBRTC_MODULES_AUDIO_PROCESSING_AUDIO_PROCESSING_IMPL_H_
#include <list>
#include <memory>
#include <string>
#include <vector>
#include "webrtc/base/criticalsection.h"
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/base/thread_annotations.h"
#include "webrtc/modules/audio_processing/audio_buffer.h"
#include "webrtc/modules/audio_processing/include/audio_processing.h"
@ -137,7 +137,7 @@ class AudioProcessingImpl : public AudioProcessing {
// State for the debug dump.
struct ApmDebugDumpThreadState {
ApmDebugDumpThreadState() : event_msg(new audioproc::Event()) {}
rtc::scoped_ptr<audioproc::Event> event_msg; // Protobuf message.
std::unique_ptr<audioproc::Event> event_msg; // Protobuf message.
std::string event_str; // Memory for protobuf serialization.
// Serialized string of last saved APM configuration.
@ -149,7 +149,7 @@ class AudioProcessingImpl : public AudioProcessing {
// Number of bytes that can still be written to the log before the maximum
// size is reached. A value of <= 0 indicates that no limit is used.
int64_t num_bytes_left_for_log_ = -1;
rtc::scoped_ptr<FileWrapper> debug_file;
std::unique_ptr<FileWrapper> debug_file;
ApmDebugDumpThreadState render;
ApmDebugDumpThreadState capture;
};
@ -250,8 +250,8 @@ class AudioProcessingImpl : public AudioProcessing {
rtc::CriticalSection crit_capture_;
// Structs containing the pointers to the submodules.
rtc::scoped_ptr<ApmPublicSubmodules> public_submodules_;
rtc::scoped_ptr<ApmPrivateSubmodules> private_submodules_
std::unique_ptr<ApmPublicSubmodules> public_submodules_;
std::unique_ptr<ApmPrivateSubmodules> private_submodules_
GUARDED_BY(crit_capture_);
// State that is written to while holding both the render and capture locks
@ -313,7 +313,7 @@ class AudioProcessingImpl : public AudioProcessing {
bool transient_suppressor_enabled;
std::vector<Point> array_geometry;
SphericalPointf target_direction;
rtc::scoped_ptr<AudioBuffer> capture_audio;
std::unique_ptr<AudioBuffer> capture_audio;
// Only the rate and samples fields of fwd_proc_format_ are used because the
// forward processing number of channels is mutable and is tracked by the
// capture_audio_.
@ -337,8 +337,8 @@ class AudioProcessingImpl : public AudioProcessing {
} capture_nonlocked_;
struct ApmRenderState {
rtc::scoped_ptr<AudioConverter> render_converter;
rtc::scoped_ptr<AudioBuffer> render_audio;
std::unique_ptr<AudioConverter> render_converter;
std::unique_ptr<AudioBuffer> render_audio;
} render_ GUARDED_BY(crit_render_);
};