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

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

Issue 2885173002: Make AudioDebugFileWriter create its own file worker thread. (Closed)
Patch Set: Make AudioDebugFileWriter create its own file thread. 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 unified diff | Download patch
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/audio_manager.h" 5 #include "media/audio/audio_manager.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 } else { 274 } else {
275 // We create multiple instances of AudioManager only when testing. 275 // We create multiple instances of AudioManager only when testing.
276 // We should not encounter this case in production. 276 // We should not encounter this case in production.
277 LOG(WARNING) << "Multiple instances of AudioManager detected"; 277 LOG(WARNING) << "Multiple instances of AudioManager detected";
278 } 278 }
279 } 279 }
280 280
281 // static 281 // static
282 std::unique_ptr<AudioManager> AudioManager::Create( 282 std::unique_ptr<AudioManager> AudioManager::Create(
283 std::unique_ptr<AudioThread> audio_thread, 283 std::unique_ptr<AudioThread> audio_thread,
284 scoped_refptr<base::SingleThreadTaskRunner> file_task_runner, 284 scoped_refptr<base::SingleThreadTaskRunner> file_task_runner,
gab 2017/05/18 16:10:10 Remove param
Sébastien Marchand 2017/05/20 00:28:22 Done.
285 AudioLogFactory* audio_log_factory) { 285 AudioLogFactory* audio_log_factory) {
286 std::unique_ptr<AudioManager> manager = 286 std::unique_ptr<AudioManager> manager =
287 CreateAudioManager(std::move(audio_thread), audio_log_factory); 287 CreateAudioManager(std::move(audio_thread), audio_log_factory);
288 #if BUILDFLAG(ENABLE_WEBRTC) 288 #if BUILDFLAG(ENABLE_WEBRTC)
289 manager->InitializeOutputDebugRecording(std::move(file_task_runner)); 289 manager->InitializeOutputDebugRecording();
290 #endif 290 #endif
291 return manager; 291 return manager;
292 } 292 }
293 293
294 // static 294 // static
295 std::unique_ptr<AudioManager> AudioManager::CreateForTesting( 295 std::unique_ptr<AudioManager> AudioManager::CreateForTesting(
296 std::unique_ptr<AudioThread> audio_thread) { 296 std::unique_ptr<AudioThread> audio_thread) {
297 #if defined(OS_WIN) 297 #if defined(OS_WIN)
298 GetHelper()->InitializeCOMForTesting(); 298 GetHelper()->InitializeCOMForTesting();
299 #endif 299 #endif
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 } else { 343 } else {
344 audio_thread_->GetTaskRunner()->PostTask( 344 audio_thread_->GetTaskRunner()->PostTask(
345 FROM_HERE, base::Bind(&AudioManager::ShutdownOnAudioThread, 345 FROM_HERE, base::Bind(&AudioManager::ShutdownOnAudioThread,
346 base::Unretained(this))); 346 base::Unretained(this)));
347 } 347 }
348 audio_thread_->Stop(); 348 audio_thread_->Stop();
349 shutdown_ = true; 349 shutdown_ = true;
350 } 350 }
351 351
352 } // namespace media 352 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698