OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_SHARED_IMPL_PRIVATE_UDP_SOCKET_PRIVATE_IMPL_H_ | 5 #ifndef PPAPI_SHARED_IMPL_PRIVATE_UDP_SOCKET_PRIVATE_IMPL_H_ |
6 #define PPAPI_SHARED_IMPL_PRIVATE_UDP_SOCKET_PRIVATE_IMPL_H_ | 6 #define PPAPI_SHARED_IMPL_PRIVATE_UDP_SOCKET_PRIVATE_IMPL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 int32_t num_bytes, | 46 int32_t num_bytes, |
47 PP_CompletionCallback callback) OVERRIDE; | 47 PP_CompletionCallback callback) OVERRIDE; |
48 virtual PP_Bool GetRecvFromAddress(PP_NetAddress_Private* addr) OVERRIDE; | 48 virtual PP_Bool GetRecvFromAddress(PP_NetAddress_Private* addr) OVERRIDE; |
49 virtual int32_t SendTo(const char* buffer, | 49 virtual int32_t SendTo(const char* buffer, |
50 int32_t num_bytes, | 50 int32_t num_bytes, |
51 const PP_NetAddress_Private* addr, | 51 const PP_NetAddress_Private* addr, |
52 PP_CompletionCallback callback) OVERRIDE; | 52 PP_CompletionCallback callback) OVERRIDE; |
53 virtual void Close() OVERRIDE; | 53 virtual void Close() OVERRIDE; |
54 | 54 |
55 // Notifications from the proxy. | 55 // Notifications from the proxy. |
56 void OnBindCompleted(bool succeeded); | 56 void OnBindCompleted(bool succeeded, uint32 bound_port); |
57 void OnRecvFromCompleted(bool succeeded, | 57 void OnRecvFromCompleted(bool succeeded, |
58 const std::string& data, | 58 const std::string& data, |
59 const PP_NetAddress_Private& addr); | 59 const PP_NetAddress_Private& addr); |
60 void OnSendToCompleted(bool succeeded, int32_t bytes_written); | 60 void OnSendToCompleted(bool succeeded, int32_t bytes_written); |
61 | 61 |
62 // Send functions that need to be implemented differently for | 62 // Send functions that need to be implemented differently for |
63 // the proxied and non-proxied derived classes. | 63 // the proxied and non-proxied derived classes. |
64 virtual void SendBind(const PP_NetAddress_Private& addr) = 0; | 64 virtual void SendBind(const PP_NetAddress_Private& addr) = 0; |
65 virtual void SendRecvFrom(int32_t num_bytes) = 0; | 65 virtual void SendRecvFrom(int32_t num_bytes) = 0; |
66 virtual void SendSendTo(const std::string& buffer, | 66 virtual void SendSendTo(const std::string& buffer, |
(...skipping 17 matching lines...) Expand all Loading... |
84 int32_t bytes_to_read_; | 84 int32_t bytes_to_read_; |
85 | 85 |
86 PP_NetAddress_Private recvfrom_addr_; | 86 PP_NetAddress_Private recvfrom_addr_; |
87 | 87 |
88 DISALLOW_COPY_AND_ASSIGN(UDPSocketPrivateImpl); | 88 DISALLOW_COPY_AND_ASSIGN(UDPSocketPrivateImpl); |
89 }; | 89 }; |
90 | 90 |
91 } // namespace ppapi | 91 } // namespace ppapi |
92 | 92 |
93 #endif // PPAPI_SHARED_IMPL_PRIVATE_UDP_SOCKET_PRIVATE_IMPL_H_ | 93 #endif // PPAPI_SHARED_IMPL_PRIVATE_UDP_SOCKET_PRIVATE_IMPL_H_ |
OLD | NEW |