| OLD | NEW |
| (Empty) |
| 1 // Copyright 2016 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 #ifndef CONTENT_BROWSER_AUDIO_DEVICE_THREAD_H_ | |
| 6 #define CONTENT_BROWSER_AUDIO_DEVICE_THREAD_H_ | |
| 7 | |
| 8 #include "base/threading/thread.h" | |
| 9 #include "content/common/content_export.h" | |
| 10 | |
| 11 namespace content { | |
| 12 | |
| 13 // This class encapulates the logic for the thread and task runners that the | |
| 14 // AudioManager and related classes run on. audio_task_runner and | |
| 15 // worker_task_runner should be called on the same thread as the | |
| 16 // AudioDeviceThread was constructed on. | |
| 17 class CONTENT_EXPORT AudioDeviceThread { | |
| 18 public: | |
| 19 // Constructs and starts the thread. | |
| 20 AudioDeviceThread(); | |
| 21 | |
| 22 scoped_refptr<base::SingleThreadTaskRunner> GetTaskRunner(); | |
| 23 | |
| 24 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner() { | |
| 25 return thread_.task_runner(); | |
| 26 } | |
| 27 | |
| 28 private: | |
| 29 base::Thread thread_; | |
| 30 | |
| 31 DISALLOW_COPY_AND_ASSIGN(AudioDeviceThread); | |
| 32 }; | |
| 33 | |
| 34 } // namespace content | |
| 35 | |
| 36 #endif // CONTENT_BROWSER_AUDIO_DEVICE_THREAD_H_ | |
| OLD | NEW |