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

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

Issue 1024493004: Plugin Power Saver: Record PPS UMAs only for users with PPS enabled. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 f4e0369ff37e5294a469e5c72ba565a8ee2092e3..3719130a70f189e57fe16ef983c59acd1ee6a9e7 100644
--- a/components/plugins/renderer/loadable_plugin_placeholder.cc
+++ b/components/plugins/renderer/loadable_plugin_placeholder.cc
@@ -101,13 +101,13 @@ void LoadablePluginPlaceholder::MarkPluginEssential(
return;
plugin_marked_essential_ = true;
- if (premade_throttler_) {
+ if (premade_throttler_)
premade_throttler_->MarkPluginEssential(method);
- }
+ else
+ PluginInstanceThrottler::RecordUnthrottleMethodMetric(method);
if (is_blocked_for_power_saver_poster_) {
is_blocked_for_power_saver_poster_ = false;
- PluginInstanceThrottler::RecordUnthrottleMethodMetric(method);
if (!LoadingBlocked())
LoadPlugin();
}
@@ -299,8 +299,8 @@ void LoadablePluginPlaceholder::LoadPlugin() {
#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 (!plugin_marked_essential_)
- throttler = PluginInstanceThrottler::Create(power_saver_enabled_);
+ if (!plugin_marked_essential_ && power_saver_enabled_)
+ throttler = PluginInstanceThrottler::Create();
#endif
WebPlugin* plugin = render_frame()->CreatePlugin(
GetFrame(), plugin_info_, GetPluginParams(), throttler.Pass());
« no previous file with comments | « chrome/renderer/chrome_content_renderer_client.cc ('k') | content/public/renderer/plugin_instance_throttler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698