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

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

Issue 2143073002: Plugin Power Saver: Improve blocked tiny plugins behavior (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rename a variable again Created 4 years, 5 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 c46b7115bd8c864a799583a30a40bdc5014f7350..0d7d8d961ffbdff44f693f174361f3eb3fc4106a 100644
--- a/components/plugins/renderer/loadable_plugin_placeholder.h
+++ b/components/plugins/renderer/loadable_plugin_placeholder.h
@@ -21,7 +21,9 @@ namespace plugins {
// (blocked or disabled).
class LoadablePluginPlaceholder : public PluginPlaceholderBase {
public:
- void set_delayed(bool delayed) { is_delayed_placeholder_ = delayed; }
+ void set_blocked_for_tinyness(bool blocked_for_tinyness) {
+ is_blocked_for_tinyness_ = blocked_for_tinyness;
+ }
void set_blocked_for_background_tab(bool blocked_for_background_tab) {
is_blocked_for_background_tab_ = blocked_for_background_tab;
@@ -53,8 +55,6 @@ class LoadablePluginPlaceholder : public PluginPlaceholderBase {
~LoadablePluginPlaceholder() override;
- void SetDelegate(std::unique_ptr<Delegate> delegate);
-
void MarkPluginEssential(
content::PluginInstanceThrottler::PowerSaverUnthrottleMethod method);
@@ -99,18 +99,16 @@ class LoadablePluginPlaceholder : public PluginPlaceholderBase {
// Plugin creation is embedder-specific.
virtual blink::WebPlugin* CreatePlugin() = 0;
- // Handling of delayed behavior is embedder-specific.
- virtual void OnLoadedRectUpdate(
- const gfx::Rect& unobscured_rect,
- content::RenderFrame::PeripheralContentStatus status) = 0;
+ // Embedder-specific behavior.
+ virtual void OnBlockedTinyContent() = 0;
content::WebPluginInfo plugin_info_;
base::string16 message_;
- // True if this is a "delayed" placeholder - one that will make a decision
- // on placeholder vs. plugin behavior once initial size has been determined.
- bool is_delayed_placeholder_;
+ // True if the plugin load was deferred because this might be a tiny plugin.
+ // Plugin may be automatically loaded if it receives non-tiny geometry.
+ bool is_blocked_for_tinyness_;
// True if the plugin load was deferred due to page being a background tab.
// Plugin may be automatically loaded when the page is foregrounded.
@@ -140,8 +138,6 @@ class LoadablePluginPlaceholder : public PluginPlaceholderBase {
// True if the power saver heuristic has already been run on this content.
bool heuristic_run_before_;
- std::unique_ptr<Delegate> delegate_;
-
base::WeakPtrFactory<LoadablePluginPlaceholder> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(LoadablePluginPlaceholder);
« no previous file with comments | « chrome/renderer/resources/renderer_resources.grd ('k') | components/plugins/renderer/loadable_plugin_placeholder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698