Chromium Code Reviews| 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..febc6a889846297efb8338136a2d65686fa6f56e 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. These are similar to the numbers used by WebKit. |
|
groby-ooo-7-16
2015/06/05 23:03:45
Last sentence can probably go
tommycli
2015/06/06 01:23:22
Done.
|
| +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), |