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

Unified Diff: media/audio/audio_input_device.cc

Issue 2867443002: Remove ScopedVector from media/audio/ (Closed)
Patch Set: Addressed review comments Created 3 years, 7 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 | « no previous file | media/audio/audio_manager_base.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/audio_input_device.cc
diff --git a/media/audio/audio_input_device.cc b/media/audio/audio_input_device.cc
index 07b966cba0ce817139cc6696953e1113459af23c..3b83deb10e3475b9aee2c1415b73a0e00e7f718a 100644
--- a/media/audio/audio_input_device.cc
+++ b/media/audio/audio_input_device.cc
@@ -9,7 +9,6 @@
#include "base/bind.h"
#include "base/macros.h"
-#include "base/memory/scoped_vector.h"
#include "base/strings/stringprintf.h"
#include "base/threading/thread_restrictions.h"
#include "base/time/time.h"
@@ -47,7 +46,7 @@ class AudioInputDevice::AudioThreadCallback
const double bytes_per_ms_;
int current_segment_id_;
uint32_t last_buffer_id_;
- ScopedVector<media::AudioBus> audio_buses_;
+ std::vector<std::unique_ptr<media::AudioBus>> audio_buses_;
CaptureCallback* capture_callback_;
DISALLOW_COPY_AND_ASSIGN(AudioThreadCallback);
@@ -297,9 +296,8 @@ void AudioInputDevice::AudioThreadCallback::MapSharedMemory() {
for (int i = 0; i < total_segments_; ++i) {
media::AudioInputBuffer* buffer =
reinterpret_cast<media::AudioInputBuffer*>(ptr);
- std::unique_ptr<media::AudioBus> audio_bus =
- media::AudioBus::WrapMemory(audio_parameters_, buffer->audio);
- audio_buses_.push_back(std::move(audio_bus));
+ audio_buses_.push_back(
+ media::AudioBus::WrapMemory(audio_parameters_, buffer->audio));
ptr += segment_length_;
}
@@ -341,7 +339,7 @@ void AudioInputDevice::AudioThreadCallback::Process(uint32_t pending_data) {
last_buffer_id_ = buffer->params.id;
// Use pre-allocated audio bus wrapping existing block of shared memory.
- media::AudioBus* audio_bus = audio_buses_[current_segment_id_];
+ media::AudioBus* audio_bus = audio_buses_[current_segment_id_].get();
// Deliver captured data to the client in floating point format and update
// the audio delay measurement.
« no previous file with comments | « no previous file | media/audio/audio_manager_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698