| Index: content/renderer/pepper/ppb_audio_impl.h
|
| diff --git a/content/renderer/pepper/ppb_audio_impl.h b/content/renderer/pepper/ppb_audio_impl.h
|
| index 3348527028e7e327418c3bf2ed306adb3bd4cf3d..6c0af8f90fbf3222f73c5e188463e6a600ec270b 100644
|
| --- a/content/renderer/pepper/ppb_audio_impl.h
|
| +++ b/content/renderer/pepper/ppb_audio_impl.h
|
| @@ -9,6 +9,7 @@
|
| #include "base/memory/ref_counted.h"
|
| #include "base/memory/shared_memory.h"
|
| #include "base/sync_socket.h"
|
| +#include "content/public/renderer/plugin_instance_throttler.h"
|
| #include "content/renderer/pepper/audio_helper.h"
|
| #include "ppapi/c/pp_completion_callback.h"
|
| #include "ppapi/c/ppb_audio.h"
|
| @@ -28,7 +29,8 @@ class PepperPlatformAudioOutput;
|
| // to look more like typical HostResource implementations.
|
| class PPB_Audio_Impl : public ppapi::Resource,
|
| public ppapi::PPB_Audio_Shared,
|
| - public AudioHelper {
|
| + public AudioHelper,
|
| + public PluginInstanceThrottler::Observer {
|
| public:
|
| explicit PPB_Audio_Impl(PP_Instance instance);
|
|
|
| @@ -52,6 +54,12 @@ class PPB_Audio_Impl : public ppapi::Resource,
|
| size_t shared_memory_size_,
|
| base::SyncSocket::Handle socket) override;
|
|
|
| + // PluginInstanceThrottler::Observer implementation.
|
| + void OnThrottleStateChange() override;
|
| +
|
| + // Starts the deferred playback and unsubscribes from the throttler.
|
| + void StartDeferredPlayback();
|
| +
|
| // AudioConfig used for creating this Audio object. We own a ref.
|
| ppapi::ScopedPPResource config_;
|
|
|
| @@ -59,6 +67,9 @@ class PPB_Audio_Impl : public ppapi::Resource,
|
| // own this pointer but are responsible for calling Shutdown on it.
|
| PepperPlatformAudioOutput* audio_;
|
|
|
| + // Stream is playing, but throttled due to Plugin Power Saver.
|
| + bool playback_throttled_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(PPB_Audio_Impl);
|
| };
|
|
|
|
|