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_manager.h

Issue 1105083004: Switch audio hang monitor to default-off. Enable for non-beta,stable. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 5 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 | « chrome/browser/chrome_browser_main.cc ('k') | media/audio/audio_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MEDIA_AUDIO_AUDIO_MANAGER_H_ 5 #ifndef MEDIA_AUDIO_AUDIO_MANAGER_H_
6 #define MEDIA_AUDIO_AUDIO_MANAGER_H_ 6 #define MEDIA_AUDIO_AUDIO_MANAGER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 29 matching lines...) Expand all
40 // which must not be NULL. 40 // which must not be NULL.
41 static void SetFactory(AudioManagerFactory* factory); 41 static void SetFactory(AudioManagerFactory* factory);
42 42
43 // Construct the audio manager; only one instance is allowed. The manager 43 // Construct the audio manager; only one instance is allowed. The manager
44 // will forward CreateAudioLog() calls to the provided AudioLogFactory; as 44 // will forward CreateAudioLog() calls to the provided AudioLogFactory; as
45 // such |audio_log_factory| must outlive the AudioManager. 45 // such |audio_log_factory| must outlive the AudioManager.
46 static AudioManager* Create(AudioLogFactory* audio_log_factory); 46 static AudioManager* Create(AudioLogFactory* audio_log_factory);
47 47
48 // Similar to Create() except also schedules a monitor on the given task 48 // Similar to Create() except also schedules a monitor on the given task
49 // runner to ensure the audio thread is not stuck for more than 60 seconds; if 49 // runner to ensure the audio thread is not stuck for more than 60 seconds; if
50 // a hang is detected, the process will be crashed. 50 // a hang is detected, the process will be crashed. See EnableHangMonitor().
51 static AudioManager* CreateWithHangTimer( 51 static AudioManager* CreateWithHangTimer(
52 AudioLogFactory* audio_log_factory, 52 AudioLogFactory* audio_log_factory,
53 const scoped_refptr<base::SingleThreadTaskRunner>& monitor_task_runner); 53 const scoped_refptr<base::SingleThreadTaskRunner>& monitor_task_runner);
54 54
55 // Similar to Create() except uses a FakeAudioLogFactory for testing. 55 // Similar to Create() except uses a FakeAudioLogFactory for testing.
56 static AudioManager* CreateForTesting(); 56 static AudioManager* CreateForTesting();
57 57
58 // Enables the hang monitor for the AudioManager once it's created. Must be
59 // called before the AudioManager is created. CreateWithHangTimer() requires
60 // either switches::kEnableAudioHangMonitor to be present or this to have been
61 // called previously to start the hang monitor. Does nothing on OSX.
62 static void EnableHangMonitor();
63
58 // Should only be used for testing. Resets a previously-set 64 // Should only be used for testing. Resets a previously-set
59 // AudioManagerFactory. The instance of AudioManager is not affected. 65 // AudioManagerFactory. The instance of AudioManager is not affected.
60 static void ResetFactoryForTesting(); 66 static void ResetFactoryForTesting();
61 67
62 // Returns the pointer to the last created instance, or NULL if not yet 68 // Returns the pointer to the last created instance, or NULL if not yet
63 // created. This is a utility method for the code outside of media directory, 69 // created. This is a utility method for the code outside of media directory,
64 // like src/chrome. 70 // like src/chrome.
65 static AudioManager* Get(); 71 static AudioManager* Get();
66 72
67 // Returns true if the OS reports existence of audio devices. This does not 73 // Returns true if the OS reports existence of audio devices. This does not
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 protected: 214 protected:
209 AudioManager(); 215 AudioManager();
210 216
211 private: 217 private:
212 DISALLOW_COPY_AND_ASSIGN(AudioManager); 218 DISALLOW_COPY_AND_ASSIGN(AudioManager);
213 }; 219 };
214 220
215 } // namespace media 221 } // namespace media
216 222
217 #endif // MEDIA_AUDIO_AUDIO_MANAGER_H_ 223 #endif // MEDIA_AUDIO_AUDIO_MANAGER_H_
OLDNEW
« no previous file with comments | « chrome/browser/chrome_browser_main.cc ('k') | media/audio/audio_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698