diff options
author | dalecurtis <dalecurtis@chromium.org> | 2015-03-25 17:37:44 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-03-26 00:38:28 +0000 |
commit | fecee0475788ffe261a233d1cc6d2d885ef7269e (patch) | |
tree | 34a07618440115d3450483b50edc4904d77ca1ee /media/audio/audio_manager.h | |
parent | 36152635213bc6633b030275f0cf34d2d04dff99 (diff) | |
download | chromium_src-fecee0475788ffe261a233d1cc6d2d885ef7269e.zip chromium_src-fecee0475788ffe261a233d1cc6d2d885ef7269e.tar.gz chromium_src-fecee0475788ffe261a233d1cc6d2d885ef7269e.tar.bz2 |
Add a hang monitor for the audio thread.
We've seen a bunch of reports in the field that the audio thread is
getting hung for significant (perhaps indefinite) amounts of time;
to help debug these reports, add a hang monitor which will crash the
browser process and ensure we get a thread dump of what's going on.
The hang timer is set extremely conservatively right now, at 1 minute,
which is insanely long for audio tasks. I'll monitor crash reports and
adjust it as necessary to find culprits.
The hang monitor uses the browser I/O thread for hang checks, which is
similar to what other hung task monitors seem to do. To do this I had
to move AudioManager and MidiManager creation to after the browser
threads have been spun up. Which shouldn't be an issue...
BUG=422522, 469827
TEST=hang time exceeded ==> crash.
Review URL: https://codereview.chromium.org/1036703002
Cr-Commit-Position: refs/heads/master@{#322276}
Diffstat (limited to 'media/audio/audio_manager.h')
-rw-r--r-- | media/audio/audio_manager.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/media/audio/audio_manager.h b/media/audio/audio_manager.h index 7705cdb..5e49b8b 100644 --- a/media/audio/audio_manager.h +++ b/media/audio/audio_manager.h @@ -34,6 +34,13 @@ class MEDIA_EXPORT AudioManager { // such |audio_log_factory| must outlive the AudioManager. static AudioManager* Create(AudioLogFactory* audio_log_factory); + // Similar to Create() except also schedules a monitor on the given task + // runner to ensure the audio thread is not stuck for more than 60 seconds; if + // a hang is detected, the process will be crashed. + static AudioManager* CreateWithHangTimer( + AudioLogFactory* audio_log_factory, + const scoped_refptr<base::SingleThreadTaskRunner>& monitor_task_runner); + // Similar to Create() except uses a FakeAudioLogFactory for testing. static AudioManager* CreateForTesting(); |