| 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 16 matching lines...) Expand all Loading... |
| 27 } | 27 } |
| 28 | 28 |
| 29 template <class ObjT, class Method, class A> | 29 template <class ObjT, class Method, class A> |
| 30 inline void DispatchResourceReply(ObjT* obj, Method method, | 30 inline void DispatchResourceReply(ObjT* obj, Method method, |
| 31 const ResourceMessageReplyParams& params, | 31 const ResourceMessageReplyParams& params, |
| 32 const Tuple1<A>& arg) { | 32 const Tuple1<A>& arg) { |
| 33 return (obj->*method)(params, arg.a); | 33 return (obj->*method)(params, arg.a); |
| 34 } | 34 } |
| 35 | 35 |
| 36 template<class ObjT, class Method, class A, class B> | 36 template<class ObjT, class Method, class A, class B> |
| 37 inline int32_t DispatchResourceReply(ObjT* obj, Method method, | 37 inline void DispatchResourceReply(ObjT* obj, Method method, |
| 38 const ResourceMessageReplyParams& params, | 38 const ResourceMessageReplyParams& params, |
| 39 const Tuple2<A, B>& arg) { | 39 const Tuple2<A, B>& arg) { |
| 40 return (obj->*method)(params, arg.a, arg.b); | 40 return (obj->*method)(params, arg.a, arg.b); |
| 41 } | 41 } |
| 42 | 42 |
| 43 template<class ObjT, class Method, class A, class B, class C> | 43 template<class ObjT, class Method, class A, class B, class C> |
| 44 inline void DispatchResourceReply(ObjT* obj, Method method, | 44 inline void DispatchResourceReply(ObjT* obj, Method method, |
| 45 const ResourceMessageReplyParams& params, | 45 const ResourceMessageReplyParams& params, |
| 46 const Tuple3<A, B, C>& arg) { | 46 const Tuple3<A, B, C>& arg) { |
| 47 return (obj->*method)(params, arg.a, arg.b, arg.c); | 47 return (obj->*method)(params, arg.a, arg.b, arg.c); |
| 48 } | 48 } |
| 49 | 49 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 78 case msg_class::ID: { \ | 78 case msg_class::ID: { \ |
| 79 TRACK_RUN_IN_IPC_HANDLER(member_func); \ | 79 TRACK_RUN_IN_IPC_HANDLER(member_func); \ |
| 80 member_func(params); \ | 80 member_func(params); \ |
| 81 break; \ | 81 break; \ |
| 82 } | 82 } |
| 83 | 83 |
| 84 } // namespace proxy | 84 } // namespace proxy |
| 85 } // namespace ppapi | 85 } // namespace ppapi |
| 86 | 86 |
| 87 #endif // PPAPI_PROXY_DISPATCH_REPLY_MESSAGE_H_ | 87 #endif // PPAPI_PROXY_DISPATCH_REPLY_MESSAGE_H_ |
| OLD | NEW |