| 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 #include "ipc/ipc_message_macros.h" | |
| 6 | |
| 7 // This file provides infrastructure for dispatching host resource call | 5 // This file provides infrastructure for dispatching host resource call |
| 8 // messages. Normal IPC message handlers can't take extra parameters or | 6 // messages. Normal IPC message handlers can't take extra parameters or |
| 9 // return values. We want to take a HostMessageContext as a parameter and | 7 // return values. We want to take a HostMessageContext as a parameter and |
| 10 // also return the int32_t return value to the caller. | 8 // also return the int32_t return value to the caller. |
| 11 | 9 |
| 10 #ifndef PPAPI_HOST_DISPATCH_HOST_MESSAGE_H_ |
| 11 #define PPAPI_HOST_DISPATCH_HOST_MESSAGE_H_ |
| 12 |
| 12 #include "base/profiler/scoped_profile.h" // For TRACK_RUN_IN_IPC_HANDLER. | 13 #include "base/profiler/scoped_profile.h" // For TRACK_RUN_IN_IPC_HANDLER. |
| 14 #include "ipc/ipc_message_macros.h" |
| 13 #include "ppapi/c/pp_errors.h" | 15 #include "ppapi/c/pp_errors.h" |
| 14 | 16 |
| 15 namespace ppapi { | 17 namespace ppapi { |
| 16 namespace host { | 18 namespace host { |
| 17 | 19 |
| 18 struct HostMessageContext; | 20 struct HostMessageContext; |
| 19 | 21 |
| 20 template <class ObjT, class Method> | 22 template <class ObjT, class Method> |
| 21 inline int32_t DispatchResourceCall(ObjT* obj, Method method, | 23 inline int32_t DispatchResourceCall(ObjT* obj, Method method, |
| 22 HostMessageContext* context, | 24 HostMessageContext* context, |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 &_IpcMessageHandlerClass::member_func, \ | 71 &_IpcMessageHandlerClass::member_func, \ |
| 70 context, p); \ | 72 context, p); \ |
| 71 } else { \ | 73 } else { \ |
| 72 return PP_ERROR_FAILED; \ | 74 return PP_ERROR_FAILED; \ |
| 73 } \ | 75 } \ |
| 74 } \ | 76 } \ |
| 75 break; | 77 break; |
| 76 | 78 |
| 77 } // namespace host | 79 } // namespace host |
| 78 } // namespace ppapi | 80 } // namespace ppapi |
| 81 |
| 82 #endif // PPAPI_HOST_DISPATCH_HOST_MESSAGE_H_ |
| OLD | NEW |