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

Side by Side Diff: media/audio/audio_input_controller.cc

Issue 4192012: Convert implicit scoped_refptr constructor calls to explicit ones, part 1 (Closed) Base URL: http://git.chromium.org/git/chromium.git
Patch Set: fix presubmit Created 10 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « ipc/file_descriptor_set_posix_unittest.cc ('k') | media/audio/audio_output_controller.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "media/audio/audio_input_controller.h" 5 #include "media/audio/audio_input_controller.h"
6 #include "media/base/limits.h" 6 #include "media/base/limits.h"
7 7
8 namespace { 8 namespace {
9 9
10 const int kMaxInputChannels = 2; 10 const int kMaxInputChannels = 2;
(...skipping 24 matching lines...) Expand all
35 int samples_per_packet) { 35 int samples_per_packet) {
36 if (!params.IsValid() || 36 if (!params.IsValid() ||
37 (params.channels > kMaxInputChannels) || 37 (params.channels > kMaxInputChannels) ||
38 (samples_per_packet > kMaxSamplesPerPacket) || (samples_per_packet < 0)) 38 (samples_per_packet > kMaxSamplesPerPacket) || (samples_per_packet < 0))
39 return NULL; 39 return NULL;
40 40
41 if (factory_) { 41 if (factory_) {
42 return factory_->Create(event_handler, params, samples_per_packet); 42 return factory_->Create(event_handler, params, samples_per_packet);
43 } 43 }
44 44
45 scoped_refptr<AudioInputController> controller = new AudioInputController( 45 scoped_refptr<AudioInputController> controller(new AudioInputController(
46 event_handler); 46 event_handler));
47 47
48 // Start the thread and post a task to create the audio input stream. 48 // Start the thread and post a task to create the audio input stream.
49 controller->thread_.Start(); 49 controller->thread_.Start();
50 controller->thread_.message_loop()->PostTask( 50 controller->thread_.message_loop()->PostTask(
51 FROM_HERE, 51 FROM_HERE,
52 NewRunnableMethod(controller.get(), &AudioInputController::DoCreate, 52 NewRunnableMethod(controller.get(), &AudioInputController::DoCreate,
53 params, samples_per_packet)); 53 params, samples_per_packet));
54 return controller; 54 return controller;
55 } 55 }
56 56
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 } 152 }
153 153
154 void AudioInputController::OnError(AudioInputStream* stream, int code) { 154 void AudioInputController::OnError(AudioInputStream* stream, int code) {
155 // Handle error on the audio controller thread. 155 // Handle error on the audio controller thread.
156 thread_.message_loop()->PostTask( 156 thread_.message_loop()->PostTask(
157 FROM_HERE, 157 FROM_HERE,
158 NewRunnableMethod(this, &AudioInputController::DoReportError, code)); 158 NewRunnableMethod(this, &AudioInputController::DoReportError, code));
159 } 159 }
160 160
161 } // namespace media 161 } // namespace media
OLDNEW
« no previous file with comments | « ipc/file_descriptor_set_posix_unittest.cc ('k') | media/audio/audio_output_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698