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

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

Issue 1421693002: Plugin Power Saver: Do not always throttle plugins with posters. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@0025-pps-poster-pixel-tests
Patch Set: Created 5 years, 2 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/public/renderer/render_frame.h
diff --git a/content/public/renderer/render_frame.h b/content/public/renderer/render_frame.h
index 814822517b3829be40f36ac13c9b59250ddc33ea..d284a989cd68f786b0ea8909b3c325809f38b08d 100644
--- a/content/public/renderer/render_frame.h
+++ b/content/public/renderer/render_frame.h
@@ -130,6 +130,36 @@ class CONTENT_EXPORT RenderFrame : public IPC::Listener,
virtual void RegisterPeripheralPlugin(
const url::Origin& content_origin,
const base::Closure& unthrottle_callback) = 0;
+
+ // Returns true if this plugin should have power saver enabled.
+ //
+ // Power Saver is enabled for plugin content that are cross-origin and
+ // heuristically determined to be not essential to the web page content.
+ //
+ // Plugin content is defined to be cross-origin when the plugin source's
+ // origin differs from the top level frame's origin. For example:
+ // - Cross-origin: a.com -> b.com/plugin.swf
+ // - Cross-origin: a.com -> b.com/iframe.html -> b.com/plugin.swf
+ // - Same-origin: a.com -> b.com/iframe-to-a.html -> a.com/plugin.swf
+ //
+ // |main_frame_origin| is the origin of the main frame.
+ //
+ // |content_origin| is the origin of the plugin content.
+ //
+ // |width| and |height| are zoom and device scale independent logical pixels.
+ //
+ // |cross_origin_main_content| may be NULL. It is set to true if the
+ // plugin content is cross-origin but still the "main attraction" of the page.
+ virtual bool ShouldThrottleContent(const url::Origin& main_frame_origin,
+ const url::Origin& content_origin,
+ const std::string& plugin_module_name,
+ int width,
+ int height,
+ bool* cross_origin_main_content) const = 0;
+
+ // Whitelists a |content_origin| so its content will never be throttled in
+ // this RenderFrame. Whitelist is cleared by top level navigation.
+ virtual void WhitelistContentOrigin(const url::Origin& content_origin) = 0;
#endif
// Returns true if this frame is a FTP directory listing.
« no previous file with comments | « content/public/renderer/plugin_instance_throttler.h ('k') | content/renderer/pepper/plugin_instance_throttler_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698