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

Side by Side Diff: media/audio/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 unified diff | Download patch
« no previous file with comments | « media/audio/audio_system_impl_unittest.cc ('k') | media/audio/audio_thread_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2017 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 MEDIA_AUDIO_AUDIO_THREAD_H_
6 #define MEDIA_AUDIO_AUDIO_THREAD_H_
7
8 #include "media/base/media_export.h"
9
10 namespace base {
11 class SingleThreadTaskRunner;
12 } // namespace base
13
14 namespace media {
15
16 // This class encapulates the logic for the thread and task runners that the
17 // AudioManager and related classes run on.
18 class MEDIA_EXPORT AudioThread {
19 public:
20 virtual ~AudioThread() {}
21
22 // Synchronously stops all underlying threads.
23 virtual void Stop() = 0;
24
25 // Returns the task runner used for audio IO.
26 // It always returns a non-null task runner (even after Stop has been called).
27 virtual base::SingleThreadTaskRunner* GetTaskRunner() = 0;
28
29 // Heavyweight tasks should use GetWorkerTaskRunner() instead of
30 // GetTaskRunner(). On most platforms they are the same, but some share the
31 // UI loop with the audio IO loop.
32 // It always returns a non-null task runner (even after Stop has been called).
33 virtual base::SingleThreadTaskRunner* GetWorkerTaskRunner() = 0;
34 };
35
36 } // namespace media
37
38 #endif // MEDIA_AUDIO_AUDIO_THREAD_H_
OLDNEW
« no previous file with comments | « media/audio/audio_system_impl_unittest.cc ('k') | media/audio/audio_thread_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698