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

Side by Side Diff: media/audio/audio_thread.h

Issue 2784433002: Ensures that audio tasks cannot run after AudioManager is deleted. (Closed)
Patch Set: cleanup 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
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 // Both - GetTaskRunner and GetWorkerTaskRunner - will return null after this
o1ka 2017/04/28 13:24:20 Should AudioManager check for null?
alokp 2017/05/09 19:06:15 Removed comment. Now we continue to return a task
24 // function is called.
25 virtual void Stop() = 0;
26
27 // Returns the task runner used for audio IO.
28 virtual base::SingleThreadTaskRunner* GetTaskRunner() = 0;
29
30 // Heavyweight tasks should use GetWorkerTaskRunner() instead of
31 // GetTaskRunner(). On most platforms they are the same, but some share the
32 // UI loop with the audio IO loop.
33 virtual base::SingleThreadTaskRunner* GetWorkerTaskRunner() = 0;
34 };
35
36 } // namespace media
37
38 #endif // MEDIA_AUDIO_AUDIO_THREAD_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698