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

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

Issue 1497623002: 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
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 4a32ee355ffefad22f4e6a6e29db35ae593263da..4b05f0f9940259a59457047732a28e00b95c2ed4 100644
--- a/components/plugins/renderer/loadable_plugin_placeholder.cc
+++ b/components/plugins/renderer/loadable_plugin_placeholder.cc
@@ -181,8 +181,9 @@ v8::Local<v8::Object> LoadablePluginPlaceholder::GetV8ScriptableObject(
void LoadablePluginPlaceholder::OnUnobscuredRectUpdate(
const gfx::Rect& unobscured_rect) {
DCHECK(content::RenderThread::Get());
- if (!power_saver_enabled_ || !finished_loading_)
+ if (!power_saver_enabled_ || !finished_loading_) {
return;
+ }
groby-ooo-7-16 2015/12/04 22:06:56 ??
tommycli 2015/12/07 22:06:18 Done.
// Only update the unobscured rect during the recheck phase. Also early exit
// to prevent reentrancy issues.
@@ -269,6 +270,10 @@ void LoadablePluginPlaceholder::DidFinishLoadingCallback() {
// 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.
groby-ooo-7-16 2015/12/04 22:06:56 Is it, even if large posters don't get throttled?
tommycli 2015/12/07 22:06:18 Yes, as large posters are throttled, and then beco
groby-ooo-7-16 2015/12/07 22:16:04 That's... limited happiness. Will that mean poster
tommycli 2015/12/07 22:22:13 This patch makes the "flash" imperceptible on my m
+ plugin()->container()->reportGeometry();
}
void LoadablePluginPlaceholder::DidFinishIconRepositionForTestingCallback() {

Powered by Google App Engine
This is Rietveld 408576698