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

Unified Diff: content/renderer/peripheral_content_heuristic.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/peripheral_content_heuristic.cc
diff --git a/content/renderer/peripheral_content_heuristic.cc b/content/renderer/peripheral_content_heuristic.cc
index b2c59c994a8af6e54f2c883155648d61d3c8dd20..d2c7a00a0478fcff344e575f207ef23c86b2cc96 100644
--- a/content/renderer/peripheral_content_heuristic.cc
+++ b/content/renderer/peripheral_content_heuristic.cc
@@ -40,12 +40,12 @@ PeripheralContentHeuristic::GetPeripheralStatus(
if (main_frame_origin.IsSameOriginWith(content_origin))
return HEURISTIC_DECISION_ESSENTIAL_SAME_ORIGIN;
- if (width <= 0 || height <= 0)
- return HEURISTIC_DECISION_ESSENTIAL_UNKNOWN_SIZE;
-
if (origin_whitelist.count(content_origin))
groby-ooo-7-16 2015/12/04 22:06:56 Since order matters, probably worth having either
tommycli 2015/12/07 22:06:18 Sounds good. I added a test.
return HEURISTIC_DECISION_ESSENTIAL_CROSS_ORIGIN_WHITELISTED;
+ if (width <= 0 || height <= 0)
+ return HEURISTIC_DECISION_ESSENTIAL_UNKNOWN_SIZE;
+
if (width <= kTinyContentSize && height <= kTinyContentSize)
return HEURISTIC_DECISION_ESSENTIAL_CROSS_ORIGIN_TINY;

Powered by Google App Engine
This is Rietveld 408576698