Index: content/renderer/pepper/plugin_module.cc |
diff --git a/content/renderer/pepper/plugin_module.cc b/content/renderer/pepper/plugin_module.cc |
index 6d0a03c9684ed98f36df778ae89dbb32b44f197a..1cbdcaf34f616de3f66c6012ce99826e713e6aef 100644 |
--- a/content/renderer/pepper/plugin_module.cc |
+++ b/content/renderer/pepper/plugin_module.cc |
@@ -21,6 +21,7 @@ |
#include "content/renderer/pepper/pepper_hung_plugin_filter.h" |
#include "content/renderer/pepper/pepper_plugin_instance_impl.h" |
#include "content/renderer/pepper/pepper_plugin_registry.h" |
+#include "content/renderer/pepper/plugin_instance_throttler_impl.h" |
#include "content/renderer/pepper/ppapi_preferences_builder.h" |
#include "content/renderer/pepper/ppb_image_data_impl.h" |
#include "content/renderer/pepper/ppb_proxy_impl.h" |
@@ -245,6 +246,14 @@ uint32_t GetLiveObjectsForInstance(PP_Instance instance_id) { |
PP_Bool IsOutOfProcess() { return PP_FALSE; } |
+PP_Bool IsPeripheral(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()->power_saver_enabled()); |
+} |
+ |
void SimulateInputEvent(PP_Instance instance, PP_Resource input_event) { |
PepperPluginInstanceImpl* plugin_instance = |
host_globals->GetInstance(instance); |
@@ -288,11 +297,17 @@ void RunV8GC(PP_Instance instance) { |
} |
const PPB_Testing_Private testing_interface = { |
- &ReadImageData, &RunMessageLoop, |
- &QuitMessageLoop, &GetLiveObjectsForInstance, |
- &IsOutOfProcess, &SimulateInputEvent, |
- &GetDocumentURL, &GetLiveVars, |
- &SetMinimumArrayBufferSizeForShmem,&RunV8GC}; |
+ &ReadImageData, |
+ &RunMessageLoop, |
+ &QuitMessageLoop, |
+ &GetLiveObjectsForInstance, |
+ &IsOutOfProcess, |
+ &IsPeripheral, |
+ &SimulateInputEvent, |
+ &GetDocumentURL, |
+ &GetLiveVars, |
+ &SetMinimumArrayBufferSizeForShmem, |
+ &RunV8GC}; |
// GetInterface ---------------------------------------------------------------- |