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

Unified Diff: content/browser/audio_device_thread.h

Issue 2558303004: Cleanup AudioDeviceThread to avoid accidental misuse. (Closed)
Patch Set: Created 4 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/browser/audio_device_thread.cc » ('j') | content/browser/audio_device_thread.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
};
« no previous file with comments | « no previous file | content/browser/audio_device_thread.cc » ('j') | content/browser/audio_device_thread.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698