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), |