OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "media/audio/test_audio_thread.h" | |
6 | |
7 #include "base/run_loop.h" | |
8 #include "base/threading/thread_task_runner_handle.h" | |
9 | |
10 namespace media { | |
11 | |
12 TestAudioThread::TestAudioThread() | |
13 : task_runner_(base::ThreadTaskRunnerHandle::Get()) {} | |
o1ka
2017/04/28 13:24:20
The purpose of this class needs to be explained in
alokp
2017/04/28 17:31:13
I will add more comments. IMO having this separate
o1ka
2017/05/02 16:16:01
See my comment in audio_system_impl_unittest.cc. A
alokp
2017/05/09 19:06:15
Done.
| |
14 | |
15 TestAudioThread::~TestAudioThread() { | |
16 DCHECK(thread_checker_.CalledOnValidThread()); | |
17 } | |
18 | |
19 void TestAudioThread::Stop() { | |
20 DCHECK(thread_checker_.CalledOnValidThread()); | |
21 base::RunLoop().RunUntilIdle(); | |
22 task_runner_ = nullptr; | |
23 } | |
24 | |
25 base::SingleThreadTaskRunner* TestAudioThread::GetTaskRunner() { | |
26 return task_runner_.get(); | |
27 } | |
28 | |
29 base::SingleThreadTaskRunner* TestAudioThread::GetWorkerTaskRunner() { | |
30 return task_runner_.get(); | |
31 } | |
32 | |
33 } // namespace media | |
OLD | NEW |