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

Unified Diff: media/audio/audio_thread_impl.h

Issue 2784433002: Ensures that audio tasks cannot run after AudioManager is deleted. (Closed)
Patch Set: cleanup Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: media/audio/audio_thread_impl.h
diff --git a/media/audio/audio_thread_impl.h b/media/audio/audio_thread_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..c236e3d243245b339cb994237960455ae1a27e28
--- /dev/null
+++ b/media/audio/audio_thread_impl.h
@@ -0,0 +1,33 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MEDIA_AUDIO_AUDIO_THREAD_IMPL_H_
+#define MEDIA_AUDIO_AUDIO_THREAD_IMPL_H_
+
+#include "base/threading/thread.h"
+#include "media/audio/audio_thread.h"
+
+namespace media {
+
+class MEDIA_EXPORT AudioThreadImpl : public AudioThread {
+ public:
+ AudioThreadImpl();
+ ~AudioThreadImpl() override;
+
+ // AudioThread implementation.
+ void Stop() override;
+ base::SingleThreadTaskRunner* GetTaskRunner() override;
+ base::SingleThreadTaskRunner* GetWorkerTaskRunner() override;
+
+ private:
+ base::Thread thread_;
+ scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
+ scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner_;
+
+ DISALLOW_COPY_AND_ASSIGN(AudioThreadImpl);
+};
+
+} // namespace content
+
+#endif // MEDIA_AUDIO_AUDIO_THREAD_IMPL_H_

Powered by Google App Engine
This is Rietveld 408576698