Chromium Code Reviews| 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() { |