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

Unified Diff: media/audio/audio_input_controller.h

Issue 7129057: Fix bug when unplugging an audio input device whilst using speech input. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Removed unnecessary includes Created 9 years, 6 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 | « no previous file | media/audio/audio_input_controller.cc » ('j') | media/audio/audio_input_controller.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/audio_input_controller.h
diff --git a/media/audio/audio_input_controller.h b/media/audio/audio_input_controller.h
index b21eabadaf2fce91bdfbb5f02a32b54b9a3c4a4a..8c53d654c0de72bbfe91ae02d65c2704d90b4e62 100644
--- a/media/audio/audio_input_controller.h
+++ b/media/audio/audio_input_controller.h
@@ -9,6 +9,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/synchronization/lock.h"
#include "base/threading/thread.h"
+#include "base/timer.h"
#include "media/audio/audio_io.h"
#include "media/audio/audio_manager.h"
@@ -100,6 +101,7 @@ class AudioInputController
// AudioInputController being created directly.
#if defined(UNIT_TEST)
static void set_factory(Factory* factory) { factory_ = factory; }
+ AudioInputStream* stream() { return stream_; }
#endif
// Starts recording in this audio input stream.
@@ -138,10 +140,18 @@ class AudioInputController
void DoRecord();
void DoClose();
void DoReportError(int code);
+ void DoReportTimeoutError();
+ void DoTimerReset();
EventHandler* handler_;
AudioInputStream* stream_;
+ // |timer_| is used to call DoReportTimeoutError when we stop receiving
+ // OnData calls without an OnClose call. This can occur when an audio input
+ // device is unplugged whilst recording on Windows.
+ // See http://crbug.com/79936 for details.
+ base::DelayTimer<AudioInputController> timer_;
Satish 2011/06/15 10:23:27 'timer_' and 'DoTimerReset' seem very generic name
allanwoj 2011/06/15 11:11:17 Done.
+
// |state_| is written on the audio input controller thread and is read on
// the hardware audio thread. These operations need to be locked. But lock
// is not required for reading on the audio input controller thread.
« no previous file with comments | « no previous file | media/audio/audio_input_controller.cc » ('j') | media/audio/audio_input_controller.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698