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

Unified Diff: ppapi/proxy/ppb_testing_proxy.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: merge 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: ppapi/proxy/ppb_testing_proxy.cc
diff --git a/ppapi/proxy/ppb_testing_proxy.cc b/ppapi/proxy/ppb_testing_proxy.cc
index 914eb4486de31f7652e904818d7cf78efab826bc..8a3b20d1ef7e9783beabdd9a76d44f76120a5e04 100644
--- a/ppapi/proxy/ppb_testing_proxy.cc
+++ b/ppapi/proxy/ppb_testing_proxy.cc
@@ -92,6 +92,18 @@ PP_Bool IsPeripheral(PP_Instance instance_id) {
return result;
}
+PP_Bool IsThrottled(PP_Instance instance_id) {
+ ProxyAutoLock lock;
+ PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance_id);
+ if (!dispatcher)
+ return PP_FALSE;
+
+ PP_Bool result = PP_FALSE;
+ dispatcher->Send(new PpapiHostMsg_PPBTesting_IsThrottled(
+ API_ID_PPB_TESTING, instance_id, &result));
+ return result;
+}
+
void SimulateInputEvent(PP_Instance instance_id, PP_Resource input_event) {
ProxyAutoLock lock;
PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance_id);
@@ -151,6 +163,7 @@ const PPB_Testing_Private testing_interface = {
&GetLiveObjectsForInstance,
&IsOutOfProcess,
&IsPeripheral,
+ &IsThrottled,
&SimulateInputEvent,
&GetDocumentURL,
&GetLiveVars,
@@ -187,6 +200,7 @@ bool PPB_Testing_Proxy::OnMessageReceived(const IPC::Message& msg) {
IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBTesting_GetLiveObjectsForInstance,
OnMsgGetLiveObjectsForInstance)
IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBTesting_IsPeripheral, OnMsgIsPeripheral)
+ IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBTesting_IsThrottled, OnMsgIsThrottled)
IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBTesting_SimulateInputEvent,
OnMsgSimulateInputEvent)
IPC_MESSAGE_HANDLER(
@@ -224,6 +238,11 @@ void PPB_Testing_Proxy::OnMsgIsPeripheral(PP_Instance instance,
*result = ppb_testing_impl_->IsPeripheral(instance);
}
+void PPB_Testing_Proxy::OnMsgIsThrottled(PP_Instance instance,
+ PP_Bool* result) {
+ *result = ppb_testing_impl_->IsThrottled(instance);
+}
+
void PPB_Testing_Proxy::OnMsgSimulateInputEvent(
PP_Instance instance,
const InputEventData& input_event) {

Powered by Google App Engine
This is Rietveld 408576698