Chromium Code Reviews| Index: content/renderer/pepper/pepper_platform_audio_output.cc |
| diff --git a/content/renderer/pepper/pepper_platform_audio_output.cc b/content/renderer/pepper/pepper_platform_audio_output.cc |
| index 1e9c74cc7e5700c486041d4598e5f707201dbd86..a8e7c4336689621fba646a8685ae800025a10573 100644 |
| --- a/content/renderer/pepper/pepper_platform_audio_output.cc |
| +++ b/content/renderer/pepper/pepper_platform_audio_output.cc |
| @@ -60,6 +60,17 @@ bool PepperPlatformAudioOutput::StopPlayback() { |
| return false; |
| } |
| +bool PepperPlatformAudioOutput::SetVolume(double volume) { |
| + if (ipc_) { |
|
mlamouri (slow - plz ping)
2016/06/23 13:04:13
I would prefer `if (!ipc_) return false;` (ie. ear
Zhiqiang Zhang (Slow)
2016/06/23 14:50:29
Acknowledged.
|
| + io_task_runner_->PostTask( |
| + FROM_HERE, |
| + base::Bind(&PepperPlatformAudioOutput::SetVolumeOnIOThread, |
| + this, volume)); |
| + return true; |
| + } |
| + return false; |
| +} |
| + |
| void PepperPlatformAudioOutput::ShutDown() { |
| // Called on the main thread to stop all audio callbacks. We must only change |
| // the client on the main thread, and the delegates from the I/O thread. |
| @@ -156,6 +167,12 @@ void PepperPlatformAudioOutput::StartPlaybackOnIOThread() { |
| ipc_->PlayStream(); |
| } |
| +void PepperPlatformAudioOutput::SetVolumeOnIOThread(double volume) { |
| + DCHECK(io_task_runner_->BelongsToCurrentThread()); |
| + if (ipc_) |
| + ipc_->SetVolume(volume); |
| +} |
| + |
| void PepperPlatformAudioOutput::StopPlaybackOnIOThread() { |
| DCHECK(io_task_runner_->BelongsToCurrentThread()); |
| if (ipc_) |