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

Unified Diff: content/renderer/peripheral_content_heuristic.h

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
Index: content/renderer/peripheral_content_heuristic.h
diff --git a/content/renderer/peripheral_content_heuristic.h b/content/renderer/peripheral_content_heuristic.h
index 251edaa966c49680c65c28d9006f9d21716a2a41..5b28693cdda5827b8e13f60e950b28c5d134b0b3 100644
--- a/content/renderer/peripheral_content_heuristic.h
+++ b/content/renderer/peripheral_content_heuristic.h
@@ -8,17 +8,24 @@
#include <set>
#include "content/common/content_export.h"
-#include "content/public/renderer/render_frame.h"
#include "url/origin.h"
-
-namespace gfx {
-class Size;
-}
namespace content {
class CONTENT_EXPORT PeripheralContentHeuristic {
public:
+ // Initial decision of the peripheral content decision.
+ // These numeric values are used in UMA logs; do not change them.
+ enum Decision {
+ HEURISTIC_DECISION_PERIPHERAL = 0,
+ HEURISTIC_DECISION_ESSENTIAL_SAME_ORIGIN = 1,
+ HEURISTIC_DECISION_ESSENTIAL_CROSS_ORIGIN_BIG = 2,
+ HEURISTIC_DECISION_ESSENTIAL_CROSS_ORIGIN_WHITELISTED = 3,
+ HEURISTIC_DECISION_ESSENTIAL_CROSS_ORIGIN_TINY = 4,
+ HEURISTIC_DECISION_ESSENTIAL_UNKNOWN_SIZE = 5,
+ HEURISTIC_DECISION_NUM_ITEMS
+ };
+
// Returns true if this content should have power saver enabled.
//
// Power Saver is enabled for content that are cross-origin and
@@ -36,16 +43,17 @@
//
// |content_origin| is the origin of the content e.g. plugin or video source.
//
- // |unobscured_size| is in zoom and device scale independent logical pixels.
- static RenderFrame::PeripheralContentStatus GetPeripheralStatus(
+ // |width| and |height| are zoom and device scale independent logical pixels.
+ static Decision GetPeripheralStatus(
const std::set<url::Origin>& origin_whitelist,
const url::Origin& main_frame_origin,
const url::Origin& content_origin,
- const gfx::Size& unobscured_size);
+ int width,
+ int height);
// Returns true if content is considered "large", and thus essential.
- // |unobscured_size| is in zoom and device scale independent logical pixels.
- static bool IsLargeContent(const gfx::Size& unobscured_size);
+ // |width| and |height| are zoom and device scale independent logical pixels.
+ static bool IsLargeContent(int width, int height);
};
} // namespace content
« no previous file with comments | « content/renderer/pepper/plugin_power_saver_helper_browsertest.cc ('k') | content/renderer/peripheral_content_heuristic.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698