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

Unified Diff: media/audio/audio_manager.h

Issue 1908423006: Allow content embedders to create AudioManager. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ScopedAudioManagerPtr instead of raw pointer Created 4 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
« no previous file with comments | « media/audio/BUILD.gn ('k') | media/audio/audio_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/audio_manager.h
diff --git a/media/audio/audio_manager.h b/media/audio/audio_manager.h
index c8bc344b58f576be8be1445575412005d325e509..659c1f86afdc5845696be2e406902c19c59bf7e4 100644
--- a/media/audio/audio_manager.h
+++ b/media/audio/audio_manager.h
@@ -25,7 +25,6 @@ namespace media {
class AudioInputStream;
class AudioManager;
-class AudioManagerFactory;
class AudioOutputStream;
class MEDIA_EXPORT AudioManagerDeleter {
@@ -44,16 +43,6 @@ using ScopedAudioManagerPtr =
// logged on Windows (this allows us to report driver hangs to Microsoft).
class MEDIA_EXPORT AudioManager {
public:
- // This provides an alternative to the statically linked factory method used
- // to create AudioManager. This is useful for dynamically-linked third
- // party clients seeking to provide a platform-specific implementation of
- // AudioManager. After this is called, all static AudioManager::Create*
- // methods will return an instance of AudioManager provided by |factory|. This
- // call may be made at most once per process, and before any calls to static
- // AudioManager::Create* methods. This method takes ownership of |factory|,
- // which must not be NULL.
- static void SetFactory(AudioManagerFactory* factory);
-
// Construct the audio manager; only one instance is allowed.
// The returned instance must be deleted on AudioManager::GetTaskRunnner().
//
@@ -70,13 +59,9 @@ class MEDIA_EXPORT AudioManager {
// The manager will use |worker_task_runner| for heavyweight tasks.
// The |worker_task_runner| may be the same as |task_runner|. This same
// task runner is returned by GetWorkerTaskRunner.
- //
- // If |monitor_task_runner| is not NULL, a monitor will be scheduled on
- // |monitor_task_runner| to monitor |task_runner|. See EnableHangMonitor().
static ScopedAudioManagerPtr Create(
scoped_refptr<base::SingleThreadTaskRunner> task_runner,
scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner,
- scoped_refptr<base::SingleThreadTaskRunner> monitor_task_runner,
AudioLogFactory* audio_log_factory);
// A convenience wrapper of AudioManager::Create for testing.
@@ -84,6 +69,13 @@ class MEDIA_EXPORT AudioManager {
static ScopedAudioManagerPtr CreateForTesting(
scoped_refptr<base::SingleThreadTaskRunner> task_runner);
+ // Starts monitoring AudioManager task runner for hangs.
+ // Runs the monitor on the given |task_runner|, which must be different from
+ // AudioManager::GetTaskRunner to be meaningful.
+ // This must be called only after an AudioManager instance is created.
+ static void StartHangMonitor(
+ scoped_refptr<base::SingleThreadTaskRunner> task_runner);
+
// Enables non-crash dumps when audio thread hangs are detected.
// TODO(dalecurtis): There are no callers to this function at present. A list
// of bad drivers has been given to Microsoft. This should be re-enabled in
@@ -100,10 +92,6 @@ class MEDIA_EXPORT AudioManager {
static const std::string& GetGlobalAppName();
#endif
- // Should only be used for testing. Resets a previously-set
- // AudioManagerFactory. The instance of AudioManager is not affected.
- static void ResetFactoryForTesting();
-
// Returns the pointer to the last created instance, or NULL if not yet
// created. This is a utility method for the code outside of media directory,
// like src/chrome.
« no previous file with comments | « media/audio/BUILD.gn ('k') | media/audio/audio_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698