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

Unified Diff: content/public/renderer/plugin_instance_throttler.h

Issue 904913003: Plugin Power Saver: Fix implicitly sized and below the fold plugins. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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
« no previous file with comments | « components/plugins/renderer/loadable_plugin_placeholder.cc ('k') | content/public/renderer/render_frame.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/renderer/plugin_instance_throttler.h
diff --git a/content/public/renderer/plugin_instance_throttler.h b/content/public/renderer/plugin_instance_throttler.h
index 376e6ab989f7a20e4f8d61a9eda485877e1f247a..8243a21ff8be2ed90831e0be34ddfe3697360551 100644
--- a/content/public/renderer/plugin_instance_throttler.h
+++ b/content/public/renderer/plugin_instance_throttler.h
@@ -9,25 +9,15 @@
#include "base/memory/scoped_ptr.h"
#include "content/common/content_export.h"
+namespace blink {
+struct WebPluginParams;
+}
+
class GURL;
class SkBitmap;
namespace content {
-class RenderFrame;
-
-// Plugin instances are "peripheral" if they are heuristically determined to be
-// not "essential" to the web page content. See comments on
-// RenderFrame::ShouldThrottleContent for details on these heuristics.
-enum PluginPowerSaverMode {
- // Plugin content is main content, and therefore never throttled.
- POWER_SAVER_MODE_ESSENTIAL = 0,
- // Plugin content is peripheral, but throttling is disabled.
- POWER_SAVER_MODE_PERIPHERAL_UNTHROTTLED = 1,
- // Plugin content is peripheral, and throttling is enabled.
- POWER_SAVER_MODE_PERIPHERAL_THROTTLED = 2
-};
-
// This class manages the metric collection, throttling, and unthrottling of a
// single peripheral plugin instance. If the Power Saver feature is disabled,
// the plugin instance will never actually be throttled, but still collects
@@ -73,11 +63,7 @@ class CONTENT_EXPORT PluginInstanceThrottler {
virtual void OnThrottlerDestroyed() {}
};
- // Returns a nullptr if no throttler needed based on |power_saver_mode|.
- static scoped_ptr<PluginInstanceThrottler> Get(
- RenderFrame* frame,
- const GURL& plugin_url,
- PluginPowerSaverMode power_saver_mode);
+ static scoped_ptr<PluginInstanceThrottler> Create(bool power_saver_enabled);
static void RecordUnthrottleMethodMetric(PowerSaverUnthrottleMethod method);
« no previous file with comments | « components/plugins/renderer/loadable_plugin_placeholder.cc ('k') | content/public/renderer/render_frame.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698