OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // This file provides infrastructure for dispatching host resource reply | 5 // This file provides infrastructure for dispatching host resource reply |
6 // messages. Normal IPC Reply handlers can't take extra parameters. | 6 // messages. Normal IPC Reply handlers can't take extra parameters. |
7 // We want to take a ResourceMessageReplyParams as a parameter. | 7 // We want to take a ResourceMessageReplyParams as a parameter. |
8 | 8 |
9 #ifndef PPAPI_PROXY_DISPATCH_REPLY_MESSAGE_H_ | 9 #ifndef PPAPI_PROXY_DISPATCH_REPLY_MESSAGE_H_ |
10 #define PPAPI_PROXY_DISPATCH_REPLY_MESSAGE_H_ | 10 #define PPAPI_PROXY_DISPATCH_REPLY_MESSAGE_H_ |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 | 56 |
57 template<class ObjT, class Method, class A, class B, class C, class D, class E> | 57 template<class ObjT, class Method, class A, class B, class C, class D, class E> |
58 inline void DispatchResourceReply(ObjT* obj, Method method, | 58 inline void DispatchResourceReply(ObjT* obj, Method method, |
59 const ResourceMessageReplyParams& params, | 59 const ResourceMessageReplyParams& params, |
60 const Tuple5<A, B, C, D, E>& arg) { | 60 const Tuple5<A, B, C, D, E>& arg) { |
61 return (obj->*method)(params, arg.a, arg.b, arg.c, arg.d, arg.e); | 61 return (obj->*method)(params, arg.a, arg.b, arg.c, arg.d, arg.e); |
62 } | 62 } |
63 | 63 |
64 #define PPAPI_DISPATCH_RESOURCE_REPLY(msg_class, member_func) \ | 64 #define PPAPI_DISPATCH_RESOURCE_REPLY(msg_class, member_func) \ |
65 case msg_class::ID: { \ | 65 case msg_class::ID: { \ |
66 TRACK_RUN_IN_IPC_HANDLER(member_func); \ | 66 TRACK_RUN_IN_IPC_HANDLER(member_func); \ |
67 msg_class::Schema::Param p; \ | 67 msg_class::Schema::Param p; \ |
68 if (msg_class::Read(&ipc_message__, &p)) { \ | 68 if (msg_class::Read(&ipc_message__, &p)) { \ |
69 ppapi::proxy::DispatchResourceReply( \ | 69 ppapi::proxy::DispatchResourceReply( \ |
70 this, \ | 70 this, \ |
71 &_IpcMessageHandlerClass::member_func, \ | 71 &_IpcMessageHandlerClass::member_func, \ |
72 params, p); \ | 72 params, p); \ |
73 } \ | |
74 } \ | 73 } \ |
75 break; | 74 break; \ |
| 75 } |
| 76 |
| 77 #define PPAPI_DISPATCH_RESOURCE_REPLY_0(msg_class, member_func) \ |
| 78 case msg_class::ID: { \ |
| 79 TRACK_RUN_IN_IPC_HANDLER(member_func); \ |
| 80 member_func(params); \ |
| 81 break; \ |
| 82 } |
76 | 83 |
77 } // namespace proxy | 84 } // namespace proxy |
78 } // namespace ppapi | 85 } // namespace ppapi |
79 | 86 |
80 #endif // PPAPI_PROXY_DISPATCH_REPLY_MESSAGE_H_ | 87 #endif // PPAPI_PROXY_DISPATCH_REPLY_MESSAGE_H_ |
OLD | NEW |