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

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

Issue 1111893003: Plugin Power Saver: Fix double-counting NEVER case in LoadablePluginPlaceholder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add a correction 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.h
diff --git a/components/plugins/renderer/loadable_plugin_placeholder.h b/components/plugins/renderer/loadable_plugin_placeholder.h
index e67c86104537182898d1c84b85af0e75b5f07b05..53ef5e11e484aecb0305ab6f398a6ae09d10f9d8 100644
--- a/components/plugins/renderer/loadable_plugin_placeholder.h
+++ b/components/plugins/renderer/loadable_plugin_placeholder.h
@@ -13,9 +13,7 @@
namespace plugins {
// Placeholders can be used if a plugin is missing or not available
// (blocked or disabled).
-class LoadablePluginPlaceholder
- : public PluginPlaceholder,
- public content::PluginInstanceThrottler::Observer {
+class LoadablePluginPlaceholder : public PluginPlaceholder {
public:
void set_blocked_for_background_tab(bool blocked_for_background_tab) {
is_blocked_for_background_tab_ = blocked_for_background_tab;
@@ -32,12 +30,12 @@ class LoadablePluginPlaceholder
// Defer loading of plugin, and instead show the Power Saver poster image.
void BlockForPowerSaverPoster();
-#endif
-
- void set_allow_loading(bool allow_loading) { allow_loading_ = allow_loading; }
// When we load the plugin, use this already-created plugin, not a new one.
void SetPremadePlugin(content::PluginInstanceThrottler* throttler);
+#endif
+
+ void set_allow_loading(bool allow_loading) { allow_loading_ = allow_loading; }
protected:
LoadablePluginPlaceholder(content::RenderFrame* render_frame,
@@ -83,9 +81,6 @@ class LoadablePluginPlaceholder
// RenderFrameObserver methods:
void WasShown() override;
- // content::PluginInstanceThrottler::Observer methods:
- void OnThrottleStateChange() override;
-
// Javascript callbacks:
// Load the blocked plugin by calling LoadPlugin().
@@ -115,20 +110,15 @@ class LoadablePluginPlaceholder
// True if the plugin load was deferred due to a Power Saver poster.
bool is_blocked_for_power_saver_poster_;
- // This is independent of deferred plugin load due to a Power Saver poster.
+ // True if power saver is enabled for this plugin and it has not been marked
+ // essential (by a click or retroactive whitelisting).
bool power_saver_enabled_;
- // True if the plugin has been marked essential.
- bool plugin_marked_essential_;
-
// When we load, uses this premade plugin instead of creating a new one.
content::PluginInstanceThrottler* premade_throttler_;
bool allow_loading_;
- // True if the placeholder was replaced with the real plugin.
- bool placeholder_was_replaced_;
-
bool hidden_;
bool finished_loading_;
std::string identifier_;

Powered by Google App Engine
This is Rietveld 408576698