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

Unified Diff: media/audio/test_audio_thread.h

Issue 2784433002: Ensures that audio tasks cannot run after AudioManager is deleted. (Closed)
Patch Set: rebase Created 3 years, 7 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
« no previous file with comments | « media/audio/sounds/sounds_manager_unittest.cc ('k') | media/audio/test_audio_thread.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/test_audio_thread.h
diff --git a/media/audio/test_audio_thread.h b/media/audio/test_audio_thread.h
new file mode 100644
index 0000000000000000000000000000000000000000..eff718ecc3188f94afce03da21b7c01aee8a61a6
--- /dev/null
+++ b/media/audio/test_audio_thread.h
@@ -0,0 +1,36 @@
+// Copyright 2017 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_TEST_AUDIO_THREAD_H_
+#define MEDIA_AUDIO_TEST_AUDIO_THREAD_H_
+
+#include "base/memory/ref_counted.h"
+#include "base/threading/thread.h"
+#include "base/threading/thread_checker.h"
+#include "media/audio/audio_thread.h"
+
+namespace media {
+
+class TestAudioThread : public AudioThread {
+ public:
+ TestAudioThread();
+ explicit TestAudioThread(bool use_real_thread);
+ ~TestAudioThread() override;
+
+ // AudioThread implementation.
+ void Stop() override;
+ base::SingleThreadTaskRunner* GetTaskRunner() override;
+ base::SingleThreadTaskRunner* GetWorkerTaskRunner() override;
+
+ private:
+ std::unique_ptr<base::Thread> thread_;
+ scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
+
+ THREAD_CHECKER(thread_checker_);
+ DISALLOW_COPY_AND_ASSIGN(TestAudioThread);
+};
+
+} // namespace media
+
+#endif // MEDIA_AUDIO_TEST_AUDIO_THREAD_H_
« no previous file with comments | « media/audio/sounds/sounds_manager_unittest.cc ('k') | media/audio/test_audio_thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698