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

Unified Diff: content/renderer/pepper/plugin_power_saver_helper.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: content/renderer/pepper/plugin_power_saver_helper.cc
diff --git a/content/renderer/pepper/plugin_power_saver_helper.cc b/content/renderer/pepper/plugin_power_saver_helper.cc
index 2544162ad5869144cb50c9b32599b7ccea51f528..ba979ea7bdfef7a08366bb6dd17251ac2d8ea0e2 100644
--- a/content/renderer/pepper/plugin_power_saver_helper.cc
+++ b/content/renderer/pepper/plugin_power_saver_helper.cc
@@ -101,6 +101,21 @@ bool PluginPowerSaverHelper::ShouldThrottleContent(
auto decision = PeripheralContentHeuristic::GetPeripheralStatus(
origin_whitelist_, main_frame_origin, content_origin, width, height);
+ bool plugin_size_unknown = width < 0 || height < 0;
+ if (plugin_size_unknown) {
groby-ooo-7-16 2015/12/04 22:06:56 Can you leave a comment why we record these here?
tommycli 2015/12/07 22:06:18 Done. It's very non-obvious.
+ if (decision == PeripheralContentHeuristic::
+ HEURISTIC_DECISION_ESSENTIAL_SAME_ORIGIN ||
+ decision == PeripheralContentHeuristic::
+ HEURISTIC_DECISION_ESSENTIAL_CROSS_ORIGIN_WHITELISTED) {
+ UMA_HISTOGRAM_ENUMERATION(
+ kPeripheralHeuristicHistogram, decision,
+ PeripheralContentHeuristic::HEURISTIC_DECISION_NUM_ITEMS);
+ return false;
+ }
+
+ return true;
+ }
+
UMA_HISTOGRAM_ENUMERATION(
kPeripheralHeuristicHistogram, decision,
PeripheralContentHeuristic::HEURISTIC_DECISION_NUM_ITEMS);

Powered by Google App Engine
This is Rietveld 408576698