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

Unified Diff: content/renderer/pepper/pepper_platform_audio_output.cc

Issue 2065513004: Expose flash playback status and volume control to content renderer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@audio_focus_manager
Patch Set: addressing nits Created 4 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
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_) {
+ 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_)

Powered by Google App Engine
This is Rietveld 408576698