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

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

Issue 819203002: Make callers of CommandLine use it via the base:: namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « media/audio/audio_manager_base.cc ('k') | media/audio/linux/audio_manager_linux.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/fake_audio_input_stream.h" 5 #include "media/audio/fake_audio_input_stream.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/files/file.h" 9 #include "base/files/file.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 } 144 }
145 145
146 FakeAudioInputStream::~FakeAudioInputStream() {} 146 FakeAudioInputStream::~FakeAudioInputStream() {}
147 147
148 bool FakeAudioInputStream::Open() { 148 bool FakeAudioInputStream::Open() {
149 DCHECK(audio_manager_->GetTaskRunner()->BelongsToCurrentThread()); 149 DCHECK(audio_manager_->GetTaskRunner()->BelongsToCurrentThread());
150 buffer_.reset(new uint8[buffer_size_]); 150 buffer_.reset(new uint8[buffer_size_]);
151 memset(buffer_.get(), 0, buffer_size_); 151 memset(buffer_.get(), 0, buffer_size_);
152 audio_bus_->Zero(); 152 audio_bus_->Zero();
153 153
154 if (CommandLine::ForCurrentProcess()->HasSwitch( 154 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
155 switches::kUseFileForFakeAudioCapture)) { 155 switches::kUseFileForFakeAudioCapture)) {
156 OpenInFileMode(CommandLine::ForCurrentProcess()->GetSwitchValuePath( 156 OpenInFileMode(base::CommandLine::ForCurrentProcess()->GetSwitchValuePath(
157 switches::kUseFileForFakeAudioCapture)); 157 switches::kUseFileForFakeAudioCapture));
158 } 158 }
159 159
160 return true; 160 return true;
161 } 161 }
162 162
163 void FakeAudioInputStream::Start(AudioInputCallback* callback) { 163 void FakeAudioInputStream::Start(AudioInputCallback* callback) {
164 DCHECK(audio_manager_->GetTaskRunner()->BelongsToCurrentThread()); 164 DCHECK(audio_manager_->GetTaskRunner()->BelongsToCurrentThread());
165 DCHECK(!callback_); 165 DCHECK(!callback_);
166 callback_ = callback; 166 callback_ = callback;
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 return false; 315 return false;
316 } 316 }
317 317
318 // static 318 // static
319 void FakeAudioInputStream::BeepOnce() { 319 void FakeAudioInputStream::BeepOnce() {
320 BeepContext* beep_context = g_beep_context.Pointer(); 320 BeepContext* beep_context = g_beep_context.Pointer();
321 beep_context->SetBeepOnce(true); 321 beep_context->SetBeepOnce(true);
322 } 322 }
323 323
324 } // namespace media 324 } // namespace media
OLDNEW
« no previous file with comments | « media/audio/audio_manager_base.cc ('k') | media/audio/linux/audio_manager_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698