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

Side by Side Diff: content/browser/renderer_host/media/audio_input_debug_writer.cc

Issue 1545243002: Convert Pass()→std::move() in //content/browser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/renderer_host/media/audio_input_debug_writer.h" 5 #include "content/browser/renderer_host/media/audio_input_debug_writer.h"
6 6
7 #include <utility>
8
7 #include "content/public/browser/browser_thread.h" 9 #include "content/public/browser/browser_thread.h"
8 #include "media/base/audio_bus.h" 10 #include "media/base/audio_bus.h"
9 11
10 namespace content { 12 namespace content {
11 13
12 AudioInputDebugWriter::AudioInputDebugWriter(base::File file) 14 AudioInputDebugWriter::AudioInputDebugWriter(base::File file)
13 : file_(file.Pass()), 15 : file_(std::move(file)), interleaved_data_size_(0), weak_factory_(this) {}
14 interleaved_data_size_(0),
15 weak_factory_(this) {
16 }
17 16
18 AudioInputDebugWriter::~AudioInputDebugWriter() { 17 AudioInputDebugWriter::~AudioInputDebugWriter() {
19 DCHECK_CURRENTLY_ON(BrowserThread::FILE); 18 DCHECK_CURRENTLY_ON(BrowserThread::FILE);
20 } 19 }
21 20
22 void AudioInputDebugWriter::Write(scoped_ptr<media::AudioBus> data) { 21 void AudioInputDebugWriter::Write(scoped_ptr<media::AudioBus> data) {
23 BrowserThread::PostTask( 22 BrowserThread::PostTask(
24 BrowserThread::FILE, 23 BrowserThread::FILE,
25 FROM_HERE, 24 FROM_HERE,
26 base::Bind(&AudioInputDebugWriter::DoWrite, 25 base::Bind(&AudioInputDebugWriter::DoWrite,
(...skipping 10 matching lines...) Expand all
37 interleaved_data_.reset(new int16_t[data_size]); 36 interleaved_data_.reset(new int16_t[data_size]);
38 interleaved_data_size_ = data_size; 37 interleaved_data_size_ = data_size;
39 } 38 }
40 data->ToInterleaved(data->frames(), sizeof(interleaved_data_[0]), 39 data->ToInterleaved(data->frames(), sizeof(interleaved_data_[0]),
41 interleaved_data_.get()); 40 interleaved_data_.get());
42 file_.WriteAtCurrentPos(reinterpret_cast<char*>(interleaved_data_.get()), 41 file_.WriteAtCurrentPos(reinterpret_cast<char*>(interleaved_data_.get()),
43 data_size * sizeof(interleaved_data_[0])); 42 data_size * sizeof(interleaved_data_[0]));
44 } 43 }
45 44
46 } // namspace content 45 } // namspace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698