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

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

Issue 1015023002: Plugin Power Saver: Throttle 'large' plugins that appear small. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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/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..0d11f1341a8f207afa53bcabf9c89d90b8fd374f 100644
--- a/content/renderer/pepper/plugin_instance_throttler_impl.h
+++ b/content/renderer/pepper/plugin_instance_throttler_impl.h
@@ -36,6 +36,8 @@ class CONTENT_EXPORT PluginInstanceThrottlerImpl
void MarkPluginEssential(PowerSaverUnthrottleMethod method) override;
void SetHiddenForPlaceholder(bool hidden) override;
blink::WebPlugin* GetWebPlugin() const override;
+ int GetWidth() const override;
+ int GetHeight() const override;
void SetWebPlugin(blink::WebPlugin* web_plugin);
@@ -52,7 +54,8 @@ class CONTENT_EXPORT PluginInstanceThrottlerImpl
void Initialize(RenderFrameImpl* frame,
const GURL& content_origin,
const std::string& plugin_module_name,
- const blink::WebRect& bounds);
+ int width,
+ int height);
// Called when the plugin flushes it's graphics context. Supplies the
// throttler with a candidate to use as the representative keyframe.
@@ -94,6 +97,10 @@ class CONTENT_EXPORT PluginInstanceThrottlerImpl
// Number of frames we've examined to find a keyframe.
int frames_examined_;
+ // Plugin dimensions as of initialization.
+ int initialized_width_;
+ int initialized_height_;
+
ObserverList<Observer> observer_list_;
base::WeakPtrFactory<PluginInstanceThrottlerImpl> weak_factory_;

Powered by Google App Engine
This is Rietveld 408576698