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

Unified Diff: components/plugins/renderer/loadable_plugin_placeholder.cc

Issue 1114623002: Plugin Power Saver: Make PPS work well with prerendered pages. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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: components/plugins/renderer/loadable_plugin_placeholder.cc
diff --git a/components/plugins/renderer/loadable_plugin_placeholder.cc b/components/plugins/renderer/loadable_plugin_placeholder.cc
index d3af1fc35ed33950dcd428f25b0ff939ddc7c2d9..b1567c8642c58ba5b93a648374b355056d57bd1d 100644
--- a/components/plugins/renderer/loadable_plugin_placeholder.cc
+++ b/components/plugins/renderer/loadable_plugin_placeholder.cc
@@ -292,20 +292,7 @@ void LoadablePluginPlaceholder::LoadPlugin() {
ReplacePlugin(premade_throttler_->GetWebPlugin());
premade_throttler_ = nullptr;
} else {
- // TODO(mmenke): In the case of prerendering, feed into
- // ChromeContentRendererClient::CreatePlugin instead, to
- // reduce the chance of future regressions.
- scoped_ptr<PluginInstanceThrottler> throttler;
-#if defined(ENABLE_PLUGINS)
- // If the plugin has already been marked essential in its placeholder form,
- // we shouldn't create a new throttler and start the process all over again.
- if (power_saver_enabled_)
- throttler = PluginInstanceThrottler::Create();
-#endif
- WebPlugin* plugin = render_frame()->CreatePlugin(
- GetFrame(), plugin_info_, GetPluginParams(), throttler.Pass());
-
- ReplacePlugin(plugin);
+ ReplacePlugin(CreatePlugin());
}
}
@@ -348,6 +335,10 @@ void LoadablePluginPlaceholder::SetIdentifier(const std::string& identifier) {
identifier_ = identifier;
}
+const std::string& LoadablePluginPlaceholder::GetIdentifier() const {
+ return identifier_;
+}
+
bool LoadablePluginPlaceholder::LoadingBlocked() const {
DCHECK(allow_loading_);
return is_blocked_for_background_tab_ || is_blocked_for_power_saver_poster_ ||
« no previous file with comments | « components/plugins/renderer/loadable_plugin_placeholder.h ('k') | content/public/renderer/plugin_instance_throttler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698