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

Unified Diff: content/renderer/pepper/plugin_module.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: content/renderer/pepper/plugin_module.cc
diff --git a/content/renderer/pepper/plugin_module.cc b/content/renderer/pepper/plugin_module.cc
index 1cbdcaf34f616de3f66c6012ce99826e713e6aef..b26e0e5f0b555b390522625dfe8111f76ff85d9c 100644
--- a/content/renderer/pepper/plugin_module.cc
+++ b/content/renderer/pepper/plugin_module.cc
@@ -254,6 +254,14 @@ PP_Bool IsPeripheral(PP_Instance instance_id) {
return PP_FromBool(plugin_instance->throttler()->power_saver_enabled());
}
+PP_Bool IsThrottled(PP_Instance instance_id) {
+ PepperPluginInstanceImpl* plugin_instance =
+ host_globals->GetInstance(instance_id);
+ if (!plugin_instance || !plugin_instance->throttler())
+ return PP_FALSE;
+ return PP_FromBool(plugin_instance->throttler()->IsThrottled());
+}
+
void SimulateInputEvent(PP_Instance instance, PP_Resource input_event) {
PepperPluginInstanceImpl* plugin_instance =
host_globals->GetInstance(instance);
@@ -303,6 +311,7 @@ const PPB_Testing_Private testing_interface = {
&GetLiveObjectsForInstance,
&IsOutOfProcess,
&IsPeripheral,
+ &IsThrottled,
&SimulateInputEvent,
&GetDocumentURL,
&GetLiveVars,

Powered by Google App Engine
This is Rietveld 408576698