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_PROXY_PLUGIN_RESOURCE_H_ | 5 #ifndef PPAPI_PROXY_PLUGIN_RESOURCE_H_ |
6 #define PPAPI_PROXY_PLUGIN_RESOURCE_H_ | 6 #define PPAPI_PROXY_PLUGIN_RESOURCE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 }; | 55 }; |
56 | 56 |
57 IPC::Sender* GetSender(Destination dest) { | 57 IPC::Sender* GetSender(Destination dest) { |
58 return dest == RENDERER ? connection_.renderer_sender : | 58 return dest == RENDERER ? connection_.renderer_sender : |
59 connection_.browser_sender; | 59 connection_.browser_sender; |
60 } | 60 } |
61 | 61 |
62 // Sends a create message to the browser or renderer for the current resource. | 62 // Sends a create message to the browser or renderer for the current resource. |
63 void SendCreate(Destination dest, const IPC::Message& msg); | 63 void SendCreate(Destination dest, const IPC::Message& msg); |
64 | 64 |
| 65 // When the host returnes a resource to the plugin, it will create a pending |
| 66 // ResourceHost and send an ID back to the plugin that identifies the pending |
| 67 // object. The plugin uses this function to connect the plugin resource with |
| 68 // the pending host resource. See also PpapiHostMsg_AttachToPendingHost. This |
| 69 // is in lieu of sending a create message. |
| 70 void AttachToPendingHost(Destination dest, int pending_host_id); |
| 71 |
65 // Sends the given IPC message as a resource request to the host | 72 // Sends the given IPC message as a resource request to the host |
66 // corresponding to this resource object and does not expect a reply. | 73 // corresponding to this resource object and does not expect a reply. |
67 void Post(Destination dest, const IPC::Message& msg); | 74 void Post(Destination dest, const IPC::Message& msg); |
68 | 75 |
69 // Like Post() but expects a response. |callback| is a |base::Callback| that | 76 // Like Post() but expects a response. |callback| is a |base::Callback| that |
70 // will be run when a reply message with a sequence number matching that of | 77 // will be run when a reply message with a sequence number matching that of |
71 // the call is received. |ReplyMsgClass| is the type of the reply message that | 78 // the call is received. |ReplyMsgClass| is the type of the reply message that |
72 // is expected. An example of usage: | 79 // is expected. An example of usage: |
73 // | 80 // |
74 // Call<PpapiPluginMsg_MyResourceType_MyReplyMessage>( | 81 // Call<PpapiPluginMsg_MyResourceType_MyReplyMessage>( |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 | 232 |
226 if (UnpackMessage<ReplyMsgClass>(reply, a, b, c, d, e)) | 233 if (UnpackMessage<ReplyMsgClass>(reply, a, b, c, d, e)) |
227 return result; | 234 return result; |
228 return PP_ERROR_FAILED; | 235 return PP_ERROR_FAILED; |
229 } | 236 } |
230 | 237 |
231 } // namespace proxy | 238 } // namespace proxy |
232 } // namespace ppapi | 239 } // namespace ppapi |
233 | 240 |
234 #endif // PPAPI_PROXY_PLUGIN_RESOURCE_H_ | 241 #endif // PPAPI_PROXY_PLUGIN_RESOURCE_H_ |
OLD | NEW |