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

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

Issue 2784433002: Ensures that audio tasks cannot run after AudioManager is deleted. (Closed)
Patch Set: addressed comments 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 virtual void Stop() = 0;
24
25 // Returns the task runner used for audio IO.
o1ka 2017/05/10 15:57:57 State that both methods should always return valid
alokp 2017/05/10 18:04:03 Done.
26 virtual base::SingleThreadTaskRunner* GetTaskRunner() = 0;
27
28 // Heavyweight tasks should use GetWorkerTaskRunner() instead of
29 // GetTaskRunner(). On most platforms they are the same, but some share the
30 // UI loop with the audio IO loop.
o1ka 2017/05/10 15:57:57 Move audio_manager.h l.49 comment here instead? I
alokp 2017/05/10 18:04:03 I do not see a difference in the comments. What ex
o1ka 2017/05/11 13:44:12 The other comment makes more sense, since there is
31 virtual base::SingleThreadTaskRunner* GetWorkerTaskRunner() = 0;
32 };
33
34 } // namespace media
35
36 #endif // MEDIA_AUDIO_AUDIO_THREAD_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698