| Index: content/renderer/pepper/plugin_instance_throttler_impl.h
|
| diff --git a/content/renderer/pepper/plugin_instance_throttler_impl.h b/content/renderer/pepper/plugin_instance_throttler_impl.h
|
| index b223cd26b613c65c5de327ad5676ec3b2e98e553..0bcad2f60dcade53727b175c2fac0b4ac3694803 100644
|
| --- a/content/renderer/pepper/plugin_instance_throttler_impl.h
|
| +++ b/content/renderer/pepper/plugin_instance_throttler_impl.h
|
| @@ -8,9 +8,11 @@
|
| #include "base/macros.h"
|
| #include "base/memory/weak_ptr.h"
|
| #include "base/observer_list.h"
|
| +#include "base/timer/timer.h"
|
| #include "content/common/content_export.h"
|
| #include "content/public/renderer/plugin_instance_throttler.h"
|
| #include "ppapi/shared_impl/ppb_view_shared.h"
|
| +#include "third_party/skia/include/core/SkBitmap.h"
|
|
|
| namespace blink {
|
| class WebInputEvent;
|
| @@ -36,6 +38,7 @@ class CONTENT_EXPORT PluginInstanceThrottlerImpl
|
| void MarkPluginEssential(PowerSaverUnthrottleMethod method) override;
|
| void SetHiddenForPlaceholder(bool hidden) override;
|
| blink::WebPlugin* GetWebPlugin() const override;
|
| + void NotifyAudioThrottled() override;
|
|
|
| void SetWebPlugin(blink::WebPlugin* web_plugin);
|
|
|
| @@ -80,6 +83,7 @@ class CONTENT_EXPORT PluginInstanceThrottlerImpl
|
| // simply suspend the plugin where it's at. Chosen arbitrarily.
|
| static const int kMaximumFramesToExamine;
|
|
|
| + void AudioThrottledFrameTimeout();
|
| void EngageThrottle();
|
|
|
| ThrottlerState state_;
|
| @@ -88,12 +92,21 @@ class CONTENT_EXPORT PluginInstanceThrottlerImpl
|
|
|
| blink::WebPlugin* web_plugin_;
|
|
|
| + // Holds a reference to the last received frame. This doesn't actually copy
|
| + // the pixel data, but rather increments the reference count to the pixels.
|
| + SkBitmap last_received_frame_;
|
| +
|
| // Number of consecutive interesting frames we've encountered.
|
| int consecutive_interesting_frames_;
|
|
|
| // Number of frames we've examined to find a keyframe.
|
| int frames_examined_;
|
|
|
| + // Video plugins with throttled audio often stop generating frames.
|
| + // This timer is so we don't wait forever for candidate poster frames.
|
| + bool audio_throttled_;
|
| + base::DelayTimer<PluginInstanceThrottlerImpl> audio_throttled_frame_timeout_;
|
| +
|
| ObserverList<Observer> observer_list_;
|
|
|
| base::WeakPtrFactory<PluginInstanceThrottlerImpl> weak_factory_;
|
|
|