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

Unified Diff: content/renderer/pepper/plugin_instance_throttler_impl.cc

Issue 1124173008: Plugin Power Saver: Unthrottle dynamically sized plugins correctly. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 months 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_instance_throttler_impl.cc
diff --git a/content/renderer/pepper/plugin_instance_throttler_impl.cc b/content/renderer/pepper/plugin_instance_throttler_impl.cc
index a73a22436e388711b0e4afa2cee49dff6d729a6f..096b81f6b71b06442bdf6fea77a0623b60c5ca15 100644
--- a/content/renderer/pepper/plugin_instance_throttler_impl.cc
+++ b/content/renderer/pepper/plugin_instance_throttler_impl.cc
@@ -21,6 +21,11 @@ namespace content {
namespace {
+// Maximum dimensions plugin content may have while still being considered
+// peripheral content.
+const int kPeripheralContentMaxWidth = 398;
+const int kPeripheralContentMaxHeight = 298;
+
// Threshold for 'boring' score to accept a frame as good enough to be a
// representative keyframe. Units are the ratio of all pixels that are within
// the most common luma bin. The same threshold is used for history thumbnails.
@@ -49,6 +54,12 @@ void PluginInstanceThrottler::RecordUnthrottleMethodMetric(
PluginInstanceThrottler::UNTHROTTLE_METHOD_NUM_ITEMS);
}
+// static
+bool PluginInstanceThrottler::IsLargeContent(int width, int height) {
+ return width >= kPeripheralContentMaxWidth &&
+ height >= kPeripheralContentMaxHeight;
+}
+
PluginInstanceThrottlerImpl::PluginInstanceThrottlerImpl()
: state_(THROTTLER_STATE_AWAITING_KEYFRAME),
is_hidden_for_placeholder_(false),
« no previous file with comments | « content/public/renderer/plugin_instance_throttler.h ('k') | content/renderer/pepper/plugin_power_saver_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698