Chromium Code Reviews| Index: content/renderer/pepper/pepper_plugin_instance_impl.h |
| diff --git a/content/renderer/pepper/pepper_plugin_instance_impl.h b/content/renderer/pepper/pepper_plugin_instance_impl.h |
| index ffc8ebb69c5b4bd308c79037f539d88f745dabc0..285c9921396cf5ad0d1b52257a8be29e184ba2f4 100644 |
| --- a/content/renderer/pepper/pepper_plugin_instance_impl.h |
| +++ b/content/renderer/pepper/pepper_plugin_instance_impl.h |
| @@ -21,6 +21,7 @@ |
| #include "cc/layers/texture_layer_client.h" |
| #include "content/common/content_export.h" |
| #include "content/public/renderer/pepper_plugin_instance.h" |
| +#include "content/public/renderer/plugin_instance_throttler.h" |
| #include "content/public/renderer/render_frame.h" |
| #include "content/public/renderer/render_frame_observer.h" |
| #include "content/renderer/mouse_lock_dispatcher.h" |
| @@ -104,7 +105,6 @@ class FullscreenContainer; |
| class MessageChannel; |
| class PepperCompositorHost; |
| class PepperGraphics2DHost; |
| -class PepperPluginInstanceThrottler; |
| class PluginModule; |
| class PluginObject; |
| class PPB_Graphics3D_Impl; |
| @@ -122,7 +122,8 @@ class CONTENT_EXPORT PepperPluginInstanceImpl |
| public NON_EXPORTED_BASE(PepperPluginInstance), |
| public ppapi::PPB_Instance_Shared, |
| public NON_EXPORTED_BASE(cc::TextureLayerClient), |
| - public RenderFrameObserver { |
| + public RenderFrameObserver, |
| + public NON_EXPORTED_BASE(PluginInstanceThrottler::Observer) { |
| public: |
| // Create and return a PepperPluginInstanceImpl object which supports the most |
| // recent version of PPP_Instance possible by querying the given |
| @@ -137,7 +138,7 @@ class CONTENT_EXPORT PepperPluginInstanceImpl |
| blink::WebPluginContainer* container() const { return container_; } |
| - PepperPluginInstanceThrottler* throttler() const { return throttler_.get(); } |
| + PluginInstanceThrottler* throttler() const { return throttler_.get(); } |
| // Returns the PP_Instance uniquely identifying this instance. Guaranteed |
| // nonzero. |
| @@ -200,7 +201,7 @@ class CONTENT_EXPORT PepperPluginInstanceImpl |
| bool Initialize(const std::vector<std::string>& arg_names, |
| const std::vector<std::string>& arg_values, |
| bool full_frame, |
| - RenderFrame::PluginPowerSaverMode power_saver_mode); |
| + PluginInstanceThrottler* throttler); |
| bool HandleDocumentLoad(const blink::WebURLResponse& response); |
| bool HandleInputEvent(const blink::WebInputEvent& event, |
| blink::WebCursorInfo* cursor_info); |
| @@ -538,6 +539,9 @@ class CONTENT_EXPORT PepperPluginInstanceImpl |
| // RenderFrameObserver |
| void OnDestruct() override; |
| + // PluginInstanceThrottler::Observer |
| + void OnThrottleStateChange() override; |
| + |
| void AddLatencyInfo(const std::vector<ui::LatencyInfo>& latency_info); |
| private: |
| @@ -718,11 +722,14 @@ class CONTENT_EXPORT PepperPluginInstanceImpl |
| // Used to track Flash-specific metrics. |
| bool is_flash_plugin_; |
| + // Set to true first time plugin is clicked. Used to collect metrics. |
|
Bernhard Bauer
2015/01/13 23:29:36
Nit: "Set to true _the_ first time _the_ plugin is
tommycli
2015/01/14 01:45:00
Done.
|
| + bool has_been_clicked_; |
| + |
| // Used to track if JavaScript has ever been used for this plugin instance. |
| bool javascript_used_; |
| // Responsible for turning on throttling if Power Saver is on. |
| - scoped_ptr<PepperPluginInstanceThrottler> throttler_; |
| + scoped_ptr<PluginInstanceThrottler> throttler_; |
| // Indicates whether this is a full frame instance, which means it represents |
| // an entire document rather than an embed tag. |