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

Unified Diff: content/public/renderer/plugin_instance_throttler.h

Issue 879403002: Plugin Power Saver: Mute throttled plugins. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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: content/public/renderer/plugin_instance_throttler.h
diff --git a/content/public/renderer/plugin_instance_throttler.h b/content/public/renderer/plugin_instance_throttler.h
index 5fa327679794a658b62c58f191c39f24a236f664..ab9ad14d10e5584a8e09eb75634dbff20bbb9cc6 100644
--- a/content/public/renderer/plugin_instance_throttler.h
+++ b/content/public/renderer/plugin_instance_throttler.h
@@ -59,9 +59,22 @@ class CONTENT_EXPORT PluginInstanceThrottler {
UNTHROTTLE_METHOD_NUM_ITEMS
};
+ enum PowerSaverState {
+ // Initial state if Power Saver is disabled. We are just collecting metrics.
+ POWER_SAVER_DISABLED,
+ // Initial state if Power Saver is enabled. Waiting for a keyframe.
+ POWER_SAVER_ENABLED_AWAITING_KEYFRAME,
+ // We've chosen a keyframe and the plug-in is throttled.
+ POWER_SAVER_ENABLED_PLUGIN_THROTTLED,
+ // Plugin instance is no longer considered peripheral. This can happen from
+ // a user click, whitelisting, or some other reason. We can end up in this
+ // state regardless of whether power saver is enabled.
+ POWER_SAVER_MARKED_ESSENTIAL
+ };
+
class Observer {
public:
- virtual void OnThrottleStateChange() = 0;
+ virtual void OnPowerSaverStateChange(PowerSaverState state) = 0;
};
// Returns a nullptr if no throttler needed based on |power_saver_mode|.
« no previous file with comments | « no previous file | content/renderer/pepper/pepper_plugin_instance_impl.h » ('j') | ppapi/shared_impl/ppb_audio_shared.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698