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

Unified Diff: ppapi/proxy/gamepad_resource.cc

Issue 11022005: Converted PluginResource reply message handling to use base::Callback (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 3 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/gamepad_resource.cc
diff --git a/ppapi/proxy/gamepad_resource.cc b/ppapi/proxy/gamepad_resource.cc
index 446c11c9f79a372d0e7ed8d878c7e2fa32224ab5..fa028e4e02c9246b967e77dfa8e7ab31635f0ad4 100644
--- a/ppapi/proxy/gamepad_resource.cc
+++ b/ppapi/proxy/gamepad_resource.cc
@@ -6,6 +6,7 @@
#include <string.h>
+#include "base/bind.h"
#include "base/threading/platform_thread.h"
#include "ppapi/proxy/dispatch_reply_message.h"
#include "ppapi/proxy/ppapi_messages.h"
@@ -48,7 +49,9 @@ GamepadResource::GamepadResource(Connection connection, PP_Instance instance)
memset(&last_read_, 0, sizeof(last_read_));
SendCreateToBrowser(PpapiHostMsg_Gamepad_Create());
- CallBrowser(PpapiHostMsg_Gamepad_RequestMemory());
+ CallBrowser<PpapiPluginMsg_Gamepad_SendMemory>(
+ PpapiHostMsg_Gamepad_RequestMemory(),
+ base::Bind(&GamepadResource::OnPluginMsgSendMemory, this));
}
GamepadResource::~GamepadResource() {
@@ -91,14 +94,6 @@ void GamepadResource::Sample(PP_GamepadsSampleData* data) {
memcpy(data, &last_read_, sizeof(PP_GamepadsSampleData));
}
-void GamepadResource::OnReplyReceived(const ResourceMessageReplyParams& params,
- const IPC::Message& msg) {
- IPC_BEGIN_MESSAGE_MAP(GamepadResource, msg)
- PPAPI_DISPATCH_RESOURCE_REPLY_0(PpapiPluginMsg_Gamepad_SendMemory,
- OnPluginMsgSendMemory)
- IPC_END_MESSAGE_MAP()
-}
-
void GamepadResource::OnPluginMsgSendMemory(
const ResourceMessageReplyParams& params) {
// On failure, the handle will be null and the CHECK below will be tripped.

Powered by Google App Engine
This is Rietveld 408576698