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

Unified Diff: ppapi/proxy/ppb_testing_proxy.cc

Issue 1088763002: Plugin Power Saver: Add comprehensive browser tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@0260-plugins-overhaul-prerender-tests
Patch Set: x 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
« no previous file with comments | « ppapi/proxy/ppb_testing_proxy.h ('k') | ppapi/shared_impl/ppapi_constants.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/ppb_testing_proxy.cc
diff --git a/ppapi/proxy/ppb_testing_proxy.cc b/ppapi/proxy/ppb_testing_proxy.cc
index 606cdc31fd2985b602f61119145cf281cc9fe717..914eb4486de31f7652e904818d7cf78efab826bc 100644
--- a/ppapi/proxy/ppb_testing_proxy.cc
+++ b/ppapi/proxy/ppb_testing_proxy.cc
@@ -80,6 +80,18 @@ PP_Bool IsOutOfProcess() {
return PP_TRUE;
}
+PP_Bool IsPeripheral(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_IsPeripheral(
+ 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);
@@ -133,17 +145,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};
} // namespace
@@ -174,6 +186,7 @@ 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_SimulateInputEvent,
OnMsgSimulateInputEvent)
IPC_MESSAGE_HANDLER(
@@ -206,6 +219,11 @@ 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::OnMsgSimulateInputEvent(
PP_Instance instance,
const InputEventData& input_event) {
« no previous file with comments | « ppapi/proxy/ppb_testing_proxy.h ('k') | ppapi/shared_impl/ppapi_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698