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

Unified Diff: content/renderer/pepper/pepper_plugin_instance_impl.h

Issue 849723002: Plugin Power Saver: Make PepperPluginInstanceThrottler interface public. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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_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..2d9856ab3296153e942d0ad36f10ec9bb76560b5 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,7 @@ class FullscreenContainer;
class MessageChannel;
class PepperCompositorHost;
class PepperGraphics2DHost;
-class PepperPluginInstanceThrottler;
+class PluginInstanceThrottlerImpl;
class PluginModule;
class PluginObject;
class PPB_Graphics3D_Impl;
@@ -122,7 +123,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 +139,7 @@ class CONTENT_EXPORT PepperPluginInstanceImpl
blink::WebPluginContainer* container() const { return container_; }
- PepperPluginInstanceThrottler* throttler() const { return throttler_.get(); }
+ PluginInstanceThrottlerImpl* throttler() const { return throttler_.get(); }
// Returns the PP_Instance uniquely identifying this instance. Guaranteed
// nonzero.
@@ -200,7 +202,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);
+ scoped_ptr<PluginInstanceThrottlerImpl> throttler);
bool HandleDocumentLoad(const blink::WebURLResponse& response);
bool HandleInputEvent(const blink::WebInputEvent& event,
blink::WebCursorInfo* cursor_info);
@@ -538,6 +540,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 +723,14 @@ class CONTENT_EXPORT PepperPluginInstanceImpl
// Used to track Flash-specific metrics.
bool is_flash_plugin_;
+ // Set to true the first time the plugin is clicked. Used to collect metrics.
+ 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<PluginInstanceThrottlerImpl> throttler_;
// Indicates whether this is a full frame instance, which means it represents
// an entire document rather than an embed tag.
« no previous file with comments | « content/renderer/pepper/pepper_graphics_2d_host.cc ('k') | content/renderer/pepper/pepper_plugin_instance_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698