| Index: components/plugins/renderer/plugin_placeholder.cc
|
| diff --git a/components/plugins/renderer/plugin_placeholder.cc b/components/plugins/renderer/plugin_placeholder.cc
|
| index 09b27381df3ff2c32097bcb84d1534c5205f8d0b..9644d7bf6ff1ee3aaaeda0d494e5e33fd97718e9 100644
|
| --- a/components/plugins/renderer/plugin_placeholder.cc
|
| +++ b/components/plugins/renderer/plugin_placeholder.cc
|
| @@ -68,7 +68,8 @@ PluginPlaceholder::PluginPlaceholder(content::RenderFrame* render_frame,
|
| is_blocked_for_background_tab_(false),
|
| is_blocked_for_prerendering_(false),
|
| is_blocked_for_power_saver_poster_(false),
|
| - power_saver_mode_(content::RenderFrame::POWER_SAVER_MODE_ESSENTIAL),
|
| + power_saver_mode_(
|
| + content::PluginInstanceThrottler::POWER_SAVER_MODE_ESSENTIAL),
|
| allow_loading_(false),
|
| hidden_(false),
|
| finished_loading_(false),
|
| @@ -79,7 +80,8 @@ PluginPlaceholder::~PluginPlaceholder() {}
|
|
|
| #if defined(ENABLE_PLUGINS)
|
| void PluginPlaceholder::DisablePowerSaverForInstance() {
|
| - power_saver_mode_ = content::RenderFrame::POWER_SAVER_MODE_ESSENTIAL;
|
| + power_saver_mode_ =
|
| + content::PluginInstanceThrottler::POWER_SAVER_MODE_ESSENTIAL;
|
| if (is_blocked_for_power_saver_poster_) {
|
| is_blocked_for_power_saver_poster_ = false;
|
| if (!LoadingBlocked())
|
| @@ -247,11 +249,19 @@ void PluginPlaceholder::LoadPlugin() {
|
| return;
|
| }
|
|
|
| + scoped_ptr<content::PluginInstanceThrottler> throttler;
|
| +#if defined(ENABLE_PLUGINS)
|
| + if (power_saver_mode_ !=
|
| + content::PluginInstanceThrottler::POWER_SAVER_MODE_ESSENTIAL) {
|
| + throttler = content::PluginInstanceThrottler::Create(
|
| + render_frame(), plugin_params_.url, power_saver_mode_);
|
| + }
|
| +#endif
|
| // TODO(mmenke): In the case of prerendering, feed into
|
| // ChromeContentRendererClient::CreatePlugin instead, to
|
| // reduce the chance of future regressions.
|
| WebPlugin* plugin = render_frame()->CreatePlugin(
|
| - frame_, plugin_info_, plugin_params_, power_saver_mode_);
|
| + frame_, plugin_info_, plugin_params_, throttler.Pass());
|
| ReplacePlugin(plugin);
|
| }
|
|
|
|
|