summaryrefslogtreecommitdiffstats
path: root/content/public/renderer
diff options
context:
space:
mode:
authorjam <jam@chromium.org>2015-12-14 11:20:49 -0800
committerCommit bot <commit-bot@chromium.org>2015-12-14 19:22:30 +0000
commit9bbcff19095d8b25342e29fa1e66c8d5c18d95d3 (patch)
tree36f264ae56fc8b0c3bbc8b3ac91988e16ba11472 /content/public/renderer
parent5e0672938d40de5fb513d5f041d664cb77f2476a (diff)
downloadchromium_src-9bbcff19095d8b25342e29fa1e66c8d5c18d95d3.zip
chromium_src-9bbcff19095d8b25342e29fa1e66c8d5c18d95d3.tar.gz
chromium_src-9bbcff19095d8b25342e29fa1e66c8d5c18d95d3.tar.bz2
Revert of Plugin Power Saver: Improve Poster behavior for essential plugins. (patchset #8 id:140001 of https://codereview.chromium.org/1497623002/ )
Reason for revert: Causing lots of flakiness in PrerenderBrowserTest.PrerenderContentSettingDetect BUG=569198 Original issue's description: > Plugin Power Saver: Improve Poster behavior for essential plugins. > > This patch does two things: > > 1) Early exit plugin placeholder if the poster-specified plugin is > same-origin or whitelisted-origin. The placeholder is never created. > > 2) Fix bug that made the poster geometry recheck flaky. This fixes one > bug, but there may be more. The geometry recheck logic is super janky. > > BUG=560590 > > Committed: https://crrev.com/fa5a32e29048ba0be1cbed8221fb74b7731dc55e > Cr-Commit-Position: refs/heads/master@{#364781} TBR=groby@chromium.org,piman@chromium.org,thestig@chromium.org,tommycli@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=560590 Review URL: https://codereview.chromium.org/1528653002 Cr-Commit-Position: refs/heads/master@{#365065}
Diffstat (limited to 'content/public/renderer')
-rw-r--r--content/public/renderer/render_frame.h35
1 files changed, 10 insertions, 25 deletions
diff --git a/content/public/renderer/render_frame.h b/content/public/renderer/render_frame.h
index dc055ef..2011c4e 100644
--- a/content/public/renderer/render_frame.h
+++ b/content/public/renderer/render_frame.h
@@ -29,7 +29,6 @@ struct WebPluginParams;
namespace gfx {
class Range;
-class Size;
}
namespace url {
@@ -57,24 +56,6 @@ struct WebPreferences;
class CONTENT_EXPORT RenderFrame : public IPC::Listener,
public IPC::Sender {
public:
- // These numeric values are used in UMA logs; do not change them.
- enum PeripheralContentStatus {
- // Content is peripheral because it doesn't meet any of the below criteria.
- CONTENT_STATUS_PERIPHERAL = 0,
- // Content is essential because it's same-origin with the top-level frame.
- CONTENT_STATUS_ESSENTIAL_SAME_ORIGIN = 1,
- // Content is essential even though it's cross-origin, because it's large.
- CONTENT_STATUS_ESSENTIAL_CROSS_ORIGIN_BIG = 2,
- // Content is essential because there's large content from the same origin.
- CONTENT_STATUS_ESSENTIAL_CROSS_ORIGIN_WHITELISTED = 3,
- // Content is essential because it's tiny in size.
- CONTENT_STATUS_ESSENTIAL_CROSS_ORIGIN_TINY = 4,
- // Content is essential because it has an unknown size.
- CONTENT_STATUS_ESSENTIAL_UNKNOWN_SIZE = 5,
- // Must be last.
- CONTENT_STATUS_NUM_ITEMS
- };
-
// Returns the RenderFrame given a WebFrame.
static RenderFrame* FromWebFrame(blink::WebFrame* web_frame);
@@ -150,7 +131,7 @@ class CONTENT_EXPORT RenderFrame : public IPC::Listener,
const url::Origin& content_origin,
const base::Closure& unthrottle_callback) = 0;
- // Returns the peripheral content heuristic decision.
+ // 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.
@@ -165,11 +146,15 @@ class CONTENT_EXPORT RenderFrame : public IPC::Listener,
//
// |content_origin| is the origin of the plugin content.
//
- // |unobscured_size| are zoom and device scale independent logical pixels.
- virtual PeripheralContentStatus GetPeripheralContentStatus(
- const url::Origin& main_frame_origin,
- const url::Origin& content_origin,
- const gfx::Size& unobscured_size) const = 0;
+ // |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,
+ 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.