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 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 28 matching lines...) Expand all Loading... |
39 // The host provides routing and tracking for resource message calls that | 39 // The host provides routing and tracking for resource message calls that |
40 // come from the plugin to the host (browser or renderer), and the | 40 // come from the plugin to the host (browser or renderer), and the |
41 // corresponding replies. | 41 // corresponding replies. |
42 class PPAPI_HOST_EXPORT PpapiHost : public IPC::Sender, public IPC::Listener { | 42 class PPAPI_HOST_EXPORT PpapiHost : public IPC::Sender, public IPC::Listener { |
43 public: | 43 public: |
44 // The sender is the channel to the plugin for outgoing messages. | 44 // The sender is the channel to the plugin for outgoing messages. |
45 // Normally the creator will add filters for resource creation messages | 45 // Normally the creator will add filters for resource creation messages |
46 // (AddHostFactoryFilter) and instance messages (AddInstanceMessageFilter) | 46 // (AddHostFactoryFilter) and instance messages (AddInstanceMessageFilter) |
47 // after construction. | 47 // after construction. |
48 PpapiHost(IPC::Sender* sender, const PpapiPermissions& perms); | 48 PpapiHost(IPC::Sender* sender, const PpapiPermissions& perms); |
49 virtual ~PpapiHost(); | 49 ~PpapiHost() override; |
50 | 50 |
51 const PpapiPermissions& permissions() const { return permissions_; } | 51 const PpapiPermissions& permissions() const { return permissions_; } |
52 | 52 |
53 // Sender implementation. Forwards to the sender_. | 53 // Sender implementation. Forwards to the sender_. |
54 virtual bool Send(IPC::Message* msg) override; | 54 bool Send(IPC::Message* msg) override; |
55 | 55 |
56 // Listener implementation. | 56 // Listener implementation. |
57 virtual bool OnMessageReceived(const IPC::Message& msg) override; | 57 bool OnMessageReceived(const IPC::Message& msg) override; |
58 | 58 |
59 // Sends the given reply message to the plugin. | 59 // Sends the given reply message to the plugin. |
60 void SendReply(const ReplyMessageContext& context, | 60 void SendReply(const ReplyMessageContext& context, |
61 const IPC::Message& msg); | 61 const IPC::Message& msg); |
62 | 62 |
63 // Sends the given unsolicited reply message to the plugin. | 63 // Sends the given unsolicited reply message to the plugin. |
64 void SendUnsolicitedReply(PP_Resource resource, const IPC::Message& msg); | 64 void SendUnsolicitedReply(PP_Resource resource, const IPC::Message& msg); |
65 | 65 |
66 // Similar to |SendUnsolicitedReply()|, but also sends handles. | 66 // Similar to |SendUnsolicitedReply()|, but also sends handles. |
67 void SendUnsolicitedReplyWithHandles( | 67 void SendUnsolicitedReplyWithHandles( |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 PendingHostResourceMap pending_resource_hosts_; | 142 PendingHostResourceMap pending_resource_hosts_; |
143 int next_pending_resource_host_id_; | 143 int next_pending_resource_host_id_; |
144 | 144 |
145 DISALLOW_COPY_AND_ASSIGN(PpapiHost); | 145 DISALLOW_COPY_AND_ASSIGN(PpapiHost); |
146 }; | 146 }; |
147 | 147 |
148 } // namespace host | 148 } // namespace host |
149 } // namespace ppapi | 149 } // namespace ppapi |
150 | 150 |
151 #endif // PPAPI_HOST_PPAPIE_HOST_H_ | 151 #endif // PPAPI_HOST_PPAPIE_HOST_H_ |
OLD | NEW |