| 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..1c8bc4f7ca4dad11f1def1f3f705169725aea9c3 100644
|
| --- a/ppapi/proxy/ppb_testing_proxy.cc
|
| +++ b/ppapi/proxy/ppb_testing_proxy.cc
|
| @@ -80,16 +80,27 @@ PP_Bool IsOutOfProcess() {
|
| return PP_TRUE;
|
| }
|
|
|
| -PP_Bool IsPeripheral(PP_Instance instance_id) {
|
| +PP_Var GetPowerSaverStatus(PP_Instance instance_id) {
|
| ProxyAutoLock lock;
|
| PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance_id);
|
| if (!dispatcher)
|
| - return PP_FALSE;
|
| + return PP_MakeUndefined();
|
|
|
| - PP_Bool result = PP_FALSE;
|
| - dispatcher->Send(new PpapiHostMsg_PPBTesting_IsPeripheral(
|
| + ReceiveSerializedVarReturnValue result;
|
| + dispatcher->Send(new PpapiHostMsg_PPBTesting_GetPowerSaverStatus(
|
| API_ID_PPB_TESTING, instance_id, &result));
|
| - return result;
|
| + return result.Return(dispatcher);
|
| +}
|
| +
|
| +void SubscribeToPowerSaverNotifications(PP_Instance instance_id) {
|
| + ProxyAutoLock lock;
|
| + PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance_id);
|
| + if (!dispatcher)
|
| + return;
|
| +
|
| + dispatcher->Send(
|
| + new PpapiHostMsg_PPBTesting_SubscribeToPowerSaverNotifications(
|
| + API_ID_PPB_TESTING, instance_id));
|
| }
|
|
|
| void SimulateInputEvent(PP_Instance instance_id, PP_Resource input_event) {
|
| @@ -150,7 +161,8 @@ const PPB_Testing_Private testing_interface = {
|
| &QuitMessageLoop,
|
| &GetLiveObjectsForInstance,
|
| &IsOutOfProcess,
|
| - &IsPeripheral,
|
| + &GetPowerSaverStatus,
|
| + &SubscribeToPowerSaverNotifications,
|
| &SimulateInputEvent,
|
| &GetDocumentURL,
|
| &GetLiveVars,
|
| @@ -186,7 +198,11 @@ bool PPB_Testing_Proxy::OnMessageReceived(const IPC::Message& msg) {
|
| OnMsgReadImageData)
|
| IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBTesting_GetLiveObjectsForInstance,
|
| OnMsgGetLiveObjectsForInstance)
|
| - IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBTesting_IsPeripheral, OnMsgIsPeripheral)
|
| + IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBTesting_GetPowerSaverStatus,
|
| + OnMsgGetPowerSaverStatus)
|
| + IPC_MESSAGE_HANDLER(
|
| + PpapiHostMsg_PPBTesting_SubscribeToPowerSaverNotifications,
|
| + OnMsgSubscribeToPowerSaverNotifications)
|
| IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBTesting_SimulateInputEvent,
|
| OnMsgSimulateInputEvent)
|
| IPC_MESSAGE_HANDLER(
|
| @@ -219,9 +235,15 @@ void PPB_Testing_Proxy::OnMsgGetLiveObjectsForInstance(PP_Instance instance,
|
| *result = ppb_testing_impl_->GetLiveObjectsForInstance(instance);
|
| }
|
|
|
| -void PPB_Testing_Proxy::OnMsgIsPeripheral(PP_Instance instance,
|
| - PP_Bool* result) {
|
| - *result = ppb_testing_impl_->IsPeripheral(instance);
|
| +void PPB_Testing_Proxy::OnMsgGetPowerSaverStatus(
|
| + PP_Instance instance,
|
| + SerializedVarReturnValue result) {
|
| + result.Return(dispatcher(), ppb_testing_impl_->GetPowerSaverStatus(instance));
|
| +}
|
| +
|
| +void PPB_Testing_Proxy::OnMsgSubscribeToPowerSaverNotifications(
|
| + PP_Instance instance) {
|
| + ppb_testing_impl_->SubscribeToPowerSaverNotifications(instance);
|
| }
|
|
|
| void PPB_Testing_Proxy::OnMsgSimulateInputEvent(
|
|
|