Index: content/renderer/pepper/pepper_platform_audio_input_impl.cc |
diff --git a/content/renderer/pepper/pepper_platform_audio_input_impl.cc b/content/renderer/pepper/pepper_platform_audio_input_impl.cc |
index d9d73263d86fbcbf3cd84c7f32b22de06cf016c4..a6fa730b19497ad5a197f1ea6c1fd94cc80a62bf 100644 |
--- a/content/renderer/pepper/pepper_platform_audio_input_impl.cc |
+++ b/content/renderer/pepper/pepper_platform_audio_input_impl.cc |
@@ -103,24 +103,6 @@ void PepperPlatformAudioInputImpl::OnStateChanged( |
media::AudioInputIPCDelegate::State state) { |
} |
-void PepperPlatformAudioInputImpl::OnDeviceReady(const std::string& device_id) { |
- DCHECK(ChildProcess::current()->io_message_loop_proxy()-> |
- BelongsToCurrentThread()); |
- |
- if (shutdown_called_) |
- return; |
- |
- if (device_id.empty()) { |
- main_message_loop_proxy_->PostTask( |
- FROM_HERE, |
- base::Bind(&PepperPlatformAudioInputImpl::NotifyStreamCreationFailed, |
- this)); |
- } else { |
- // We will be notified by OnStreamCreated(). |
- ipc_->CreateStream(stream_id_, params_, device_id, false); |
- } |
-} |
- |
void PepperPlatformAudioInputImpl::OnIPCClosed() { |
ipc_ = NULL; |
} |
@@ -166,11 +148,13 @@ bool PepperPlatformAudioInputImpl::Initialize( |
sample_rate, 16, frames_per_buffer); |
if (device_id.empty()) { |
- // Use the default device. |
+ // TODO(xians): this bypasses the permission and create a stream using the |
palmer
2013/03/12 17:45:11
Is that safe? (Doesn't sound safe.) Is this change
no longer working on chromium
2013/03/14 10:47:32
We allow pepper flash to use the default device wi
|
+ // default device, we should remove it once Pepper completely switches to |
+ // OpenDevice(). |
ChildProcess::current()->io_message_loop()->PostTask( |
FROM_HERE, |
base::Bind(&PepperPlatformAudioInputImpl::InitializeOnIOThread, |
- this, 0)); |
+ this, 1)); |
} else { |
// We need to open the device and obtain the label and session ID before |
// initializing. |
@@ -193,14 +177,8 @@ void PepperPlatformAudioInputImpl::InitializeOnIOThread(int session_id) { |
stream_id_ = ipc_->AddDelegate(this); |
DCHECK_NE(0, stream_id_); |
- if (!session_id) { |
- // We will be notified by OnStreamCreated(). |
- ipc_->CreateStream(stream_id_, params_, |
- media::AudioManagerBase::kDefaultDeviceId, false); |
- } else { |
- // We will be notified by OnDeviceReady(). |
- ipc_->StartDevice(stream_id_, session_id); |
- } |
+ // We will be notified by OnStreamCreated(). |
+ ipc_->CreateStream(stream_id_, session_id, params_, false); |
} |
void PepperPlatformAudioInputImpl::StartCaptureOnIOThread() { |