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

Unified Diff: ppapi/host/dispatch_host_message.h

Issue 10824272: Add a skeleton gamepad resource. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge Created 8 years, 4 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/host/dispatch_host_message.h
diff --git a/ppapi/host/dispatch_host_message.h b/ppapi/host/dispatch_host_message.h
index 070b746b329fa96cb845350d4d25489bcbbfad43..9a3fae52e3721b59fa1c05a0e04d6ec94b26e0ee 100644
--- a/ppapi/host/dispatch_host_message.h
+++ b/ppapi/host/dispatch_host_message.h
@@ -61,20 +61,28 @@ inline int32_t DispatchResourceCall(ObjT* obj, Method method,
return (obj->*method)(context, arg.a, arg.b, arg.c, arg.d, arg.e);
}
+// Note that this only works for message with 1 or more parameters. For
+// 0-parameter messages you need to use the _0 version below (since there are
+// no Params in the message).
#define PPAPI_DISPATCH_HOST_RESOURCE_CALL(msg_class, member_func) \
case msg_class::ID: { \
- TRACK_RUN_IN_IPC_HANDLER(member_func); \
- msg_class::Schema::Param p; \
- if (msg_class::Read(&ipc_message__, &p)) { \
- return ppapi::host::DispatchResourceCall( \
- this, \
- &_IpcMessageHandlerClass::member_func, \
- context, p); \
- } else { \
- return PP_ERROR_FAILED; \
- } \
- } \
- break;
+ TRACK_RUN_IN_IPC_HANDLER(member_func); \
+ msg_class::Schema::Param p; \
+ if (msg_class::Read(&ipc_message__, &p)) { \
+ return ppapi::host::DispatchResourceCall( \
+ this, \
+ &_IpcMessageHandlerClass::member_func, \
+ context, p); \
+ } \
+ return PP_ERROR_FAILED; \
+ }
+
+#define PPAPI_DISPATCH_HOST_RESOURCE_CALL_0(msg_class, member_func) \
+ case msg_class::ID: { \
+ TRACK_RUN_IN_IPC_HANDLER(member_func); \
+ return member_func(context); \
+ }
+
} // namespace host
} // namespace ppapi

Powered by Google App Engine
This is Rietveld 408576698