Chromium Code Reviews| 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_PPAPI_HOST_H_ | 5 #ifndef PPAPI_HOST_PPAPI_HOST_H_ |
| 6 #define PPAPI_HOST_PPAPI_HOST_H_ | 6 #define PPAPI_HOST_PPAPI_HOST_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "base/memory/linked_ptr.h" | 11 #include "base/memory/linked_ptr.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/memory/scoped_vector.h" | 13 #include "base/memory/scoped_vector.h" |
| 14 #include "base/observer_list.h" | 14 #include "base/observer_list.h" |
| 15 #include "ipc/ipc_listener.h" | 15 #include "ipc/ipc_listener.h" |
| 16 #include "ipc/ipc_sender.h" | 16 #include "ipc/ipc_sender.h" |
| 17 #include "ppapi/c/pp_instance.h" | 17 #include "ppapi/c/pp_instance.h" |
| 18 #include "ppapi/c/pp_resource.h" | 18 #include "ppapi/c/pp_resource.h" |
| 19 #include "ppapi/host/ppapi_host_export.h" | 19 #include "ppapi/host/ppapi_host_export.h" |
| 20 #include "ppapi/shared_impl/ppapi_permissions.h" | 20 #include "ppapi/shared_impl/ppapi_permissions.h" |
| 21 | 21 |
| 22 namespace ppapi { | 22 namespace ppapi { |
| 23 | 23 |
| 24 namespace proxy { | 24 namespace proxy { |
| 25 class ResourceMessageCallParams; | 25 class ResourceMessageCallParams; |
| 26 class ResourceMessageReplyParams; | 26 class ResourceMessageReplyParams; |
| 27 class SerializedHandle; | |
| 27 } | 28 } |
| 28 | 29 |
| 29 namespace host { | 30 namespace host { |
| 30 | 31 |
| 31 class HostFactory; | 32 class HostFactory; |
| 32 struct HostMessageContext; | 33 struct HostMessageContext; |
| 33 class InstanceMessageFilter; | 34 class InstanceMessageFilter; |
| 34 struct ReplyMessageContext; | 35 struct ReplyMessageContext; |
| 35 class ResourceHost; | 36 class ResourceHost; |
| 36 | 37 |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 54 // Listener implementation. | 55 // Listener implementation. |
| 55 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; | 56 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; |
| 56 | 57 |
| 57 // Sends the given reply message to the plugin. | 58 // Sends the given reply message to the plugin. |
| 58 void SendReply(const ReplyMessageContext& context, | 59 void SendReply(const ReplyMessageContext& context, |
| 59 const IPC::Message& msg); | 60 const IPC::Message& msg); |
| 60 | 61 |
| 61 // Sends the given unsolicited reply message to the plugin. | 62 // Sends the given unsolicited reply message to the plugin. |
| 62 void SendUnsolicitedReply(PP_Resource resource, const IPC::Message& msg); | 63 void SendUnsolicitedReply(PP_Resource resource, const IPC::Message& msg); |
| 63 | 64 |
| 65 // Similar to SendUnsolicitedReply, but it support send a file handler. | |
|
bbudge
2013/12/31 00:51:53
s/support send/supports sending
s/file handler/fil
Peng
2013/12/31 23:33:54
Done.
| |
| 66 void SendUnsolicitedReplyWithHandle( | |
| 67 PP_Resource resource, | |
| 68 const IPC::Message& msg, | |
| 69 const ppapi::proxy::SerializedHandle& handle); | |
| 70 | |
| 64 // Create a ResourceHost with the given |nested_msg|. | 71 // Create a ResourceHost with the given |nested_msg|. |
| 65 scoped_ptr<ResourceHost> CreateResourceHost( | 72 scoped_ptr<ResourceHost> CreateResourceHost( |
| 66 const proxy::ResourceMessageCallParams& params, | 73 const proxy::ResourceMessageCallParams& params, |
| 67 PP_Instance instance, | 74 PP_Instance instance, |
| 68 const IPC::Message& nested_msg); | 75 const IPC::Message& nested_msg); |
| 69 | 76 |
| 70 // Adds the given host resource as a pending one (with no corresponding | 77 // Adds the given host resource as a pending one (with no corresponding |
| 71 // PluginResource object and no PP_Resource ID yet). The pending resource ID | 78 // PluginResource object and no PP_Resource ID yet). The pending resource ID |
| 72 // is returned. See PpapiHostMsg_AttachToPendingHost. | 79 // is returned. See PpapiHostMsg_AttachToPendingHost. |
| 73 int AddPendingResourceHost(scoped_ptr<ResourceHost> resource_host); | 80 int AddPendingResourceHost(scoped_ptr<ResourceHost> resource_host); |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 135 PendingHostResourceMap pending_resource_hosts_; | 142 PendingHostResourceMap pending_resource_hosts_; |
| 136 int next_pending_resource_host_id_; | 143 int next_pending_resource_host_id_; |
| 137 | 144 |
| 138 DISALLOW_COPY_AND_ASSIGN(PpapiHost); | 145 DISALLOW_COPY_AND_ASSIGN(PpapiHost); |
| 139 }; | 146 }; |
| 140 | 147 |
| 141 } // namespace host | 148 } // namespace host |
| 142 } // namespace ppapi | 149 } // namespace ppapi |
| 143 | 150 |
| 144 #endif // PPAPI_HOST_PPAPIE_HOST_H_ | 151 #endif // PPAPI_HOST_PPAPIE_HOST_H_ |
| OLD | NEW |