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 #ifndef PPAPI_HOST_HOST_MESSAGE_CONTEXT_H_ | 5 #ifndef PPAPI_HOST_HOST_MESSAGE_CONTEXT_H_ |
6 #define PPAPI_HOST_HOST_MESSAGE_CONTEXT_H_ | 6 #define PPAPI_HOST_HOST_MESSAGE_CONTEXT_H_ |
7 | 7 |
8 #include "ipc/ipc_message.h" | 8 #include "ipc/ipc_message.h" |
9 #include "ppapi/host/ppapi_host_export.h" | 9 #include "ppapi/host/ppapi_host_export.h" |
10 #include "ppapi/proxy/resource_message_params.h" | 10 #include "ppapi/proxy/resource_message_params.h" |
11 | 11 |
12 namespace ppapi { | 12 namespace ppapi { |
13 namespace host { | 13 namespace host { |
14 | 14 |
15 // This context structure provides information about incoming resource message | 15 // This context structure provides information about incoming resource message |
16 // call requests when passed to resources. | 16 // call requests when passed to resources. |
17 struct PPAPI_HOST_EXPORT HostMessageContext { | 17 struct PPAPI_HOST_EXPORT HostMessageContext { |
18 explicit HostMessageContext(const ppapi::proxy::ResourceMessageCallParams& cp) | 18 explicit HostMessageContext( |
19 : params(cp) { | 19 const ppapi::proxy::ResourceMessageCallParams& cp); |
20 } | 20 ~HostMessageContext(); |
| 21 |
| 22 // Returns a "reply params" struct with the same resource and sequence number |
| 23 // as this request. |
| 24 ppapi::proxy::ResourceMessageReplyParams MakeReplyParams(); |
21 | 25 |
22 // The original call parameters passed to the resource message call. | 26 // The original call parameters passed to the resource message call. |
23 const ppapi::proxy::ResourceMessageCallParams& params; | 27 const ppapi::proxy::ResourceMessageCallParams& params; |
24 | 28 |
25 // The reply message. If the params has the callback flag set, this message | 29 // The reply message. If the params has the callback flag set, this message |
26 // will be sent in reply. It is initialized to the empty message. If the | 30 // will be sent in reply. It is initialized to the empty message. If the |
27 // handler wants to send something else, it should just assign the message | 31 // handler wants to send something else, it should just assign the message |
28 // it wants to this value. | 32 // it wants to this value. |
29 IPC::Message reply_msg; | 33 IPC::Message reply_msg; |
30 }; | 34 }; |
31 | 35 |
32 } // namespace host | 36 } // namespace host |
33 } // namespace ppapi | 37 } // namespace ppapi |
34 | 38 |
35 #endif // PPAPI_HOST_HOST_MESSAGE_CONTEXT_H_ | 39 #endif // PPAPI_HOST_HOST_MESSAGE_CONTEXT_H_ |
OLD | NEW |