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

Unified Diff: components/plugins/renderer/loadable_plugin_placeholder.cc

Issue 1528653002: Revert of Plugin Power Saver: Improve Poster behavior for essential plugins. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 | « chrome/renderer/plugins/power_saver_info.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: components/plugins/renderer/loadable_plugin_placeholder.cc
diff --git a/components/plugins/renderer/loadable_plugin_placeholder.cc b/components/plugins/renderer/loadable_plugin_placeholder.cc
index ff30f4a702c4b7a863cb233a72fbb3b984faf55d..a47d910835c1910d986355816e16e37979b36602 100644
--- a/components/plugins/renderer/loadable_plugin_placeholder.cc
+++ b/components/plugins/renderer/loadable_plugin_placeholder.cc
@@ -270,10 +270,6 @@
// This is necessary to prevent a flicker.
if (premade_throttler_ && power_saver_enabled_)
premade_throttler_->SetHiddenForPlaceholder(true /* hidden */);
-
- // In case our initial geometry was reported before the placeholder finished
- // loading, request another one. Needed for correct large poster unthrottling.
- plugin()->container()->reportGeometry();
}
void LoadablePluginPlaceholder::DidFinishIconRepositionForTestingCallback() {
@@ -351,20 +347,17 @@
// On a size update check if we now qualify as a essential plugin.
url::Origin content_origin = url::Origin(GetPluginParams().url);
- auto status = render_frame()->GetPeripheralContentStatus(
- render_frame()->GetWebFrame()->top()->securityOrigin(), content_origin,
- gfx::Size(width, height));
- if (status != content::RenderFrame::CONTENT_STATUS_PERIPHERAL) {
+ bool cross_origin_main_content = false;
+ if (!render_frame()->ShouldThrottleContent(
+ render_frame()->GetWebFrame()->top()->securityOrigin(),
+ content_origin, width, height, &cross_origin_main_content)) {
MarkPluginEssential(
heuristic_run_before_
? PluginInstanceThrottler::UNTHROTTLE_METHOD_BY_SIZE_CHANGE
: PluginInstanceThrottler::UNTHROTTLE_METHOD_DO_NOT_RECORD);
- if (!heuristic_run_before_ &&
- status ==
- content::RenderFrame::CONTENT_STATUS_ESSENTIAL_CROSS_ORIGIN_BIG) {
+ if (cross_origin_main_content && !heuristic_run_before_)
render_frame()->WhitelistContentOrigin(content_origin);
- }
}
heuristic_run_before_ = true;
« no previous file with comments | « chrome/renderer/plugins/power_saver_info.cc ('k') | content/public/renderer/render_frame.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698