diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-24 19:54:30 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-24 19:54:30 +0000 |
commit | f511881bed1a46d2110f36e6b60e28f2b306b935 (patch) | |
tree | 58d69490432a1176a56ee2c0bdd6dd8016162e46 /ppapi/host/dispatch_host_message.h | |
parent | 5d67452f563f0d6eddc932dd67f7e84579b77831 (diff) | |
download | chromium_src-f511881bed1a46d2110f36e6b60e28f2b306b935.zip chromium_src-f511881bed1a46d2110f36e6b60e28f2b306b935.tar.gz chromium_src-f511881bed1a46d2110f36e6b60e28f2b306b935.tar.bz2 |
Add a skeleton gamepad resource.
This implements the skeleton of the gamepad resource for the IPC proxy. It is not actually hooked up. Hooking it up will require moving some gamepad lock code to a shared location.
This also hooks up the browser message routing for implementing resource hosts in the browser process.
BUG=
Review URL: https://chromiumcodereview.appspot.com/10824272
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@153265 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/host/dispatch_host_message.h')
-rw-r--r-- | ppapi/host/dispatch_host_message.h | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/ppapi/host/dispatch_host_message.h b/ppapi/host/dispatch_host_message.h index 070b746..9a3fae5 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 |