Chromium Code Reviews| Index: content/browser/audio_device_thread.h |
| diff --git a/content/browser/audio_device_thread.h b/content/browser/audio_device_thread.h |
| index 1547686e1d6e6f1fcb415e212ccbc99cbee0143d..cd4b52c7c4220c36c41f03869208d2495c125c67 100644 |
| --- a/content/browser/audio_device_thread.h |
| +++ b/content/browser/audio_device_thread.h |
| @@ -5,6 +5,7 @@ |
| #ifndef CONTENT_BROWSER_AUDIO_DEVICE_THREAD_H_ |
| #define CONTENT_BROWSER_AUDIO_DEVICE_THREAD_H_ |
| +#include "base/memory/ref_counted.h" |
| #include "base/threading/thread.h" |
| #include "content/common/content_export.h" |
| @@ -16,18 +17,28 @@ namespace content { |
| // AudioDeviceThread was constructed on. |
| class CONTENT_EXPORT AudioDeviceThread { |
| public: |
| - // Constructs and starts the thread. |
| + // Constructs and starts a thread. On all platforms except for OSX, the |
|
Avi (use Gerrit)
2016/12/13 01:36:11
"OSX" isn't really a thing any more. Say "the Mac"
DaleCurtis
2016/12/13 01:55:39
Done.
|
| + // started thread becomes the audio task runner. However, on OSX, the task |
| + // runner this object is constructed on will become the audio thread and the |
| + // thread is only used for high complexity tasks which can't be run on the |
| + // main thread (typically the UI thread). |
| AudioDeviceThread(); |
| + ~AudioDeviceThread(); |
| - scoped_refptr<base::SingleThreadTaskRunner> GetTaskRunner(); |
| + scoped_refptr<base::SingleThreadTaskRunner> task_runner() const { |
| + return task_runner_; |
| + }; |
| - scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner() { |
| + scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner() const { |
| return thread_.task_runner(); |
| } |
| private: |
| base::Thread thread_; |
| + // Task runner to run audio control calls on. |
| + scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(AudioDeviceThread); |
| }; |