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

Unified Diff: media/audio/audio_input_device.cc

Issue 2582533002: Simplify AudioInputRendererHost IPC interface. (Closed)
Patch Set: Created 4 years 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/audio_input_device.h ('k') | media/audio/audio_input_ipc.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/audio_input_device.cc
diff --git a/media/audio/audio_input_device.cc b/media/audio/audio_input_device.cc
index cee639bb68073055d8dab39ff8306086e9c2cfbb..68483a200b2591e11d1cd863a947c3a76f2b7fc9 100644
--- a/media/audio/audio_input_device.cc
+++ b/media/audio/audio_input_device.cc
@@ -155,47 +155,27 @@ void AudioInputDevice::OnStreamCreated(
ipc_->RecordStream();
}
-void AudioInputDevice::OnVolume(double volume) {
- NOTIMPLEMENTED();
-}
-
-void AudioInputDevice::OnStateChanged(
- AudioInputIPCDelegateState state) {
+void AudioInputDevice::OnError() {
DCHECK(task_runner()->BelongsToCurrentThread());
// Do nothing if the stream has been closed.
if (state_ < CREATING_STREAM)
return;
- // TODO(miu): Clean-up inconsistent and incomplete handling here.
- // http://crbug.com/180640
- switch (state) {
- case AUDIO_INPUT_IPC_DELEGATE_STATE_STOPPED:
Max Morin 2016/12/15 15:12:40 This message is handled here, but is never actuall
- ShutDownOnIOThread();
- break;
- case AUDIO_INPUT_IPC_DELEGATE_STATE_RECORDING:
- NOTIMPLEMENTED();
- break;
- case AUDIO_INPUT_IPC_DELEGATE_STATE_ERROR:
- DLOG(WARNING) << "AudioInputDevice::OnStateChanged(ERROR)";
- // Don't dereference the callback object if the audio thread
- // is stopped or stopping. That could mean that the callback
- // object has been deleted.
- // TODO(tommi): Add an explicit contract for clearing the callback
- // object. Possibly require calling Initialize again or provide
- // a callback object via Start() and clear it in Stop().
- {
- base::AutoLock auto_lock_(audio_thread_lock_);
- if (audio_thread_) {
- callback_->OnCaptureError(
- "AudioInputDevice::OnStateChanged - audio thread still running");
- }
+ DLOG(WARNING) << "AudioInputDevice::OnError()";
+ // Don't dereference the callback object if the audio thread
+ // is stopped or stopping. That could mean that the callback
+ // object has been deleted.
+ // TODO(tommi): Add an explicit contract for clearing the callback
+ // object. Possibly require calling Initialize again or provide
+ // a callback object via Start() and clear it in Stop().
+ {
+ base::AutoLock auto_lock_(audio_thread_lock_);
+ if (audio_thread_) {
+ callback_->OnCaptureError(
+ "AudioInputDevice::OnError - audio thread still running");
+ }
}
- break;
- default:
- NOTREACHED();
- break;
- }
}
void AudioInputDevice::OnIPCClosed() {
« no previous file with comments | « media/audio/audio_input_device.h ('k') | media/audio/audio_input_ipc.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698