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 1ff6248f3b349d75a7aa60f9b6b82bace08566e8..3652be349d65de7f4a6d811f3fd410400fbb808e 100644 |
| --- a/content/renderer/pepper/plugin_instance_throttler_impl.cc |
| +++ b/content/renderer/pepper/plugin_instance_throttler_impl.cc |
| @@ -101,6 +101,10 @@ blink::WebPlugin* PluginInstanceThrottlerImpl::GetWebPlugin() const { |
| return web_plugin_; |
| } |
| +const gfx::Size& PluginInstanceThrottlerImpl::GetSize() const { |
| + return initialized_size_; |
| +} |
| + |
| void PluginInstanceThrottlerImpl::SetWebPlugin(blink::WebPlugin* web_plugin) { |
| DCHECK(!web_plugin_); |
| web_plugin_ = web_plugin; |
| @@ -110,13 +114,15 @@ void PluginInstanceThrottlerImpl::Initialize( |
| RenderFrameImpl* frame, |
| const GURL& content_origin, |
| const std::string& plugin_module_name, |
| - const blink::WebRect& bounds) { |
| + const gfx::Size& size) { |
| + initialized_size_ = size; |
|
Lei Zhang
2015/03/18 00:48:12
put this in the initializer list?
tommycli
2015/03/19 22:10:12
I was not able to, as the Throttler is constructed
Lei Zhang
2015/03/19 22:29:44
Whoops, I was thinking this was the ctor. Ignore.
|
| + |
| // |frame| may be nullptr in tests. |
| if (frame) { |
| PluginPowerSaverHelper* helper = frame->plugin_power_saver_helper(); |
| bool cross_origin_main_content = false; |
| if (!helper->ShouldThrottleContent(content_origin, plugin_module_name, |
| - bounds.width, bounds.height, |
| + size.width(), size.height(), |
| &cross_origin_main_content)) { |
| state_ = THROTTLER_STATE_MARKED_ESSENTIAL; |