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 messasges from host | 5 // This file provides infrastructure for dispatching messasges from host |
6 // resource, inlcuding reply messages or unsolicited replies. Normal IPC Reply | 6 // resource, inlcuding reply messages or unsolicited replies. Normal IPC Reply |
7 // handlers can't take extra parameters. We want to take a | 7 // handlers can't take extra parameters. We want to take a |
8 // ResourceMessageReplyParams as a parameter. | 8 // ResourceMessageReplyParams as a parameter. |
9 | 9 |
10 #ifndef PPAPI_PROXY_DISPATCH_REPLY_MESSAGE_H_ | 10 #ifndef PPAPI_PROXY_DISPATCH_REPLY_MESSAGE_H_ |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 << "Resource reply message of unexpected type."; | 127 << "Resource reply message of unexpected type."; |
128 (obj->*method)(reply_params); | 128 (obj->*method)(reply_params); |
129 } | 129 } |
130 | 130 |
131 // When using PPAPI_DISPATCH_PLUGIN_RESOURCE_CALL* below, use this macro to | 131 // When using PPAPI_DISPATCH_PLUGIN_RESOURCE_CALL* below, use this macro to |
132 // begin the map instead of IPC_BEGIN_MESSAGE_MAP. The reason is that the macros | 132 // begin the map instead of IPC_BEGIN_MESSAGE_MAP. The reason is that the macros |
133 // in src/ipc are all closely tied together, and there might be errors for | 133 // in src/ipc are all closely tied together, and there might be errors for |
134 // unused variables or other errors if they're used with these macros. | 134 // unused variables or other errors if they're used with these macros. |
135 #define PPAPI_BEGIN_MESSAGE_MAP(class_name, msg) \ | 135 #define PPAPI_BEGIN_MESSAGE_MAP(class_name, msg) \ |
136 { \ | 136 { \ |
137 typedef class_name _IpcMessageHandlerClass ALLOW_UNUSED; \ | 137 typedef class_name _IpcMessageHandlerClass ALLOW_UNUSED_TYPE; \ |
138 const IPC::Message& ipc_message__ = msg; \ | 138 const IPC::Message& ipc_message__ = msg; \ |
139 switch (ipc_message__.type()) { \ | 139 switch (ipc_message__.type()) { \ |
140 | 140 |
141 // Note that this only works for message with 1 or more parameters. For | 141 // Note that this only works for message with 1 or more parameters. For |
142 // 0-parameter messages you need to use the _0 version below (since there are | 142 // 0-parameter messages you need to use the _0 version below (since there are |
143 // no params in the message). | 143 // no params in the message). |
144 #define PPAPI_DISPATCH_PLUGIN_RESOURCE_CALL(msg_class, member_func) \ | 144 #define PPAPI_DISPATCH_PLUGIN_RESOURCE_CALL(msg_class, member_func) \ |
145 case msg_class::ID: { \ | 145 case msg_class::ID: { \ |
146 msg_class::Schema::Param p; \ | 146 msg_class::Schema::Param p; \ |
147 if (msg_class::Read(&ipc_message__, &p)) { \ | 147 if (msg_class::Read(&ipc_message__, &p)) { \ |
(...skipping 20 matching lines...) Expand all Loading... |
168 break; | 168 break; |
169 | 169 |
170 #define PPAPI_END_MESSAGE_MAP() \ | 170 #define PPAPI_END_MESSAGE_MAP() \ |
171 } \ | 171 } \ |
172 } | 172 } |
173 | 173 |
174 } // namespace proxy | 174 } // namespace proxy |
175 } // namespace ppapi | 175 } // namespace ppapi |
176 | 176 |
177 #endif // PPAPI_PROXY_DISPATCH_REPLY_MESSAGE_H_ | 177 #endif // PPAPI_PROXY_DISPATCH_REPLY_MESSAGE_H_ |
OLD | NEW |