Chromium Code Reviews| 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); |