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

Unified Diff: ppapi/proxy/ppb_testing_proxy.cc

Issue 6432001: Implement proxy for FlashMenu and Run/QuitMessageLoop (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Handle NULL menus more gracefully Created 9 years, 10 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/proxy/serialized_flash_menu.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 ca1515146dc56875e41f77c3547c38b1898f3c38..593ed7d0afaa2eca6a683acd6e3a240aca620fa2 100644
--- a/ppapi/proxy/ppb_testing_proxy.cc
+++ b/ppapi/proxy/ppb_testing_proxy.cc
@@ -41,15 +41,22 @@ PP_Bool ReadImageData(PP_Resource graphics_2d,
return result;
}
-void RunMessageLoop() {
- bool old_state = MessageLoop::current()->NestableTasksAllowed();
- MessageLoop::current()->SetNestableTasksAllowed(true);
- MessageLoop::current()->Run();
- MessageLoop::current()->SetNestableTasksAllowed(old_state);
+void RunMessageLoop(PP_Instance instance) {
+ PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance);
+ if (!dispatcher)
+ return;
+ IPC::SyncMessage* msg = new PpapiHostMsg_PPBTesting_RunMessageLoop(
+ INTERFACE_ID_PPB_TESTING, instance);
+ msg->EnableMessagePumping();
+ dispatcher->Send(msg);
}
-void QuitMessageLoop() {
- MessageLoop::current()->QuitNow();
+void QuitMessageLoop(PP_Instance instance) {
+ PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance);
+ if (!dispatcher)
+ return;
+ dispatcher->Send(new PpapiHostMsg_PPBTesting_QuitMessageLoop(
+ INTERFACE_ID_PPB_TESTING, instance));
}
uint32_t GetLiveObjectsForInstance(PP_Instance instance_id) {
@@ -122,13 +129,12 @@ void PPB_Testing_Proxy::OnMsgReadImageData(
device_context_2d.host_resource(), image.host_resource(), &top_left);
}
-void PPB_Testing_Proxy::OnMsgRunMessageLoop(bool* dummy) {
- ppb_testing_target()->RunMessageLoop();
- *dummy = false;
+void PPB_Testing_Proxy::OnMsgRunMessageLoop(PP_Instance instance) {
+ ppb_testing_target()->RunMessageLoop(instance);
}
-void PPB_Testing_Proxy::OnMsgQuitMessageLoop() {
- ppb_testing_target()->QuitMessageLoop();
+void PPB_Testing_Proxy::OnMsgQuitMessageLoop(PP_Instance instance) {
+ ppb_testing_target()->QuitMessageLoop(instance);
}
void PPB_Testing_Proxy::OnMsgGetLiveObjectsForInstance(PP_Instance instance,
« no previous file with comments | « ppapi/proxy/ppb_testing_proxy.h ('k') | ppapi/proxy/serialized_flash_menu.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698