OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_UDP_SOCKET_RESOURCE_BASE_H_ | 5 #ifndef PPAPI_PROXY_UDP_SOCKET_RESOURCE_BASE_H_ |
6 #define PPAPI_PROXY_UDP_SOCKET_RESOURCE_BASE_H_ | 6 #define PPAPI_PROXY_UDP_SOCKET_RESOURCE_BASE_H_ |
7 | 7 |
8 #include <queue> | 8 #include <queue> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 int32_t RecvFromImpl(char* buffer, | 66 int32_t RecvFromImpl(char* buffer, |
67 int32_t num_bytes, | 67 int32_t num_bytes, |
68 PP_Resource* addr, | 68 PP_Resource* addr, |
69 scoped_refptr<TrackedCallback> callback); | 69 scoped_refptr<TrackedCallback> callback); |
70 PP_Bool GetRecvFromAddressImpl(PP_NetAddress_Private* addr); | 70 PP_Bool GetRecvFromAddressImpl(PP_NetAddress_Private* addr); |
71 int32_t SendToImpl(const char* buffer, | 71 int32_t SendToImpl(const char* buffer, |
72 int32_t num_bytes, | 72 int32_t num_bytes, |
73 const PP_NetAddress_Private* addr, | 73 const PP_NetAddress_Private* addr, |
74 scoped_refptr<TrackedCallback> callback); | 74 scoped_refptr<TrackedCallback> callback); |
75 void CloseImpl(); | 75 void CloseImpl(); |
| 76 int32_t JoinGroupImpl(const PP_NetAddress_Private *group, |
| 77 scoped_refptr<TrackedCallback> callback); |
| 78 int32_t LeaveGroupImpl(const PP_NetAddress_Private *group, |
| 79 scoped_refptr<TrackedCallback> callback); |
76 | 80 |
77 private: | 81 private: |
78 struct RecvBuffer { | 82 struct RecvBuffer { |
79 int32_t result; | 83 int32_t result; |
80 std::string data; | 84 std::string data; |
81 PP_NetAddress_Private addr; | 85 PP_NetAddress_Private addr; |
82 }; | 86 }; |
83 | 87 |
84 // Resource overrides. | 88 // Resource overrides. |
85 virtual void OnReplyReceived(const ResourceMessageReplyParams& params, | 89 virtual void OnReplyReceived(const ResourceMessageReplyParams& params, |
86 const IPC::Message& msg) override; | 90 const IPC::Message& msg) override; |
87 | 91 |
88 void PostAbortIfNecessary(scoped_refptr<TrackedCallback>* callback); | 92 void PostAbortIfNecessary(scoped_refptr<TrackedCallback>* callback); |
89 | 93 |
90 // IPC message handlers. | 94 // IPC message handlers. |
91 void OnPluginMsgSetOptionReply(scoped_refptr<TrackedCallback> callback, | 95 void OnPluginMsgGeneralReply(scoped_refptr<TrackedCallback> callback, |
92 const ResourceMessageReplyParams& params); | 96 const ResourceMessageReplyParams& params); |
93 void OnPluginMsgBindReply(const ResourceMessageReplyParams& params, | 97 void OnPluginMsgBindReply(const ResourceMessageReplyParams& params, |
94 const PP_NetAddress_Private& bound_addr); | 98 const PP_NetAddress_Private& bound_addr); |
95 void OnPluginMsgPushRecvResult(const ResourceMessageReplyParams& params, | 99 void OnPluginMsgPushRecvResult(const ResourceMessageReplyParams& params, |
96 int32_t result, | 100 int32_t result, |
97 const std::string& data, | 101 const std::string& data, |
98 const PP_NetAddress_Private& addr); | 102 const PP_NetAddress_Private& addr); |
99 void OnPluginMsgSendToReply(const ResourceMessageReplyParams& params, | 103 void OnPluginMsgSendToReply(const ResourceMessageReplyParams& params, |
100 int32_t bytes_written); | 104 int32_t bytes_written); |
101 | 105 |
102 void RunCallback(scoped_refptr<TrackedCallback> callback, int32_t pp_result); | 106 void RunCallback(scoped_refptr<TrackedCallback> callback, int32_t pp_result); |
(...skipping 29 matching lines...) Expand all Loading... |
132 | 136 |
133 std::queue<scoped_refptr<TrackedCallback>> sendto_callbacks_; | 137 std::queue<scoped_refptr<TrackedCallback>> sendto_callbacks_; |
134 | 138 |
135 DISALLOW_COPY_AND_ASSIGN(UDPSocketResourceBase); | 139 DISALLOW_COPY_AND_ASSIGN(UDPSocketResourceBase); |
136 }; | 140 }; |
137 | 141 |
138 } // namespace proxy | 142 } // namespace proxy |
139 } // namespace ppapi | 143 } // namespace ppapi |
140 | 144 |
141 #endif // PPAPI_PROXY_UDP_SOCKET_RESOURCE_BASE_H_ | 145 #endif // PPAPI_PROXY_UDP_SOCKET_RESOURCE_BASE_H_ |
OLD | NEW |