Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef LIBRARIES_NACL_IO_MOUNT_NODE_UDP_H_ | |
| 6 #define LIBRARIES_NACL_IO_MOUNT_NODE_UDP_H_ | |
| 7 | |
| 8 #include "nacl_io/ossocket.h" | |
| 9 #ifdef PROVIDES_SOCKET_API | |
| 10 | |
| 11 #include <ppapi/c/pp_resource.h> | |
| 12 #include <ppapi/c/ppb_udp_socket.h> | |
| 13 | |
| 14 #include "nacl_io/mount_node.h" | |
| 15 #include "nacl_io/mount_node_socket.h" | |
| 16 | |
| 17 #include "nacl_io/ossocket.h" | |
|
binji
2013/08/09 19:28:06
included twice
noelallen1
2013/08/09 22:53:22
Done.
| |
| 18 | |
| 19 namespace nacl_io { | |
| 20 | |
| 21 class MountNodeUDP : public MountNodeSocket { | |
| 22 public: | |
| 23 explicit MountNodeUDP(Mount* mount); | |
| 24 | |
| 25 virtual Error Init(int flags); | |
| 26 | |
| 27 virtual Error Bind(const struct sockaddr* addr, socklen_t len); | |
| 28 virtual Error Connect(const struct sockaddr* addr, socklen_t len); | |
| 29 | |
| 30 virtual Error Recv(void* buf, size_t len, int flags, int* out_len); | |
| 31 virtual Error RecvFrom(void* buf, | |
| 32 size_t len, | |
| 33 int flags, | |
| 34 struct sockaddr* src_addr, | |
| 35 socklen_t* addrlen, | |
| 36 int* out_len); | |
| 37 | |
| 38 virtual Error Send(const void* buf, size_t len, int flags, int* out_len); | |
| 39 virtual Error SendTo(const void* buf, | |
| 40 size_t len, | |
| 41 int flags, | |
| 42 const struct sockaddr* dest_addr, | |
| 43 socklen_t addrlen, | |
| 44 int* out_len); | |
| 45 | |
| 46 protected: | |
| 47 UDPSocketInterface* UDPSocket(); | |
| 48 | |
| 49 Error RecvFromHelper(void* buf, | |
| 50 size_t len, | |
| 51 int flags, | |
| 52 PP_Resource* addr, | |
| 53 int* out_len); | |
| 54 | |
| 55 Error SendToHelper(const void* buf, | |
| 56 size_t len, | |
| 57 int flags, | |
| 58 PP_Resource dest_addr, | |
| 59 int* out_len); | |
| 60 }; | |
| 61 | |
| 62 | |
| 63 } // namespace nacl_io | |
| 64 | |
| 65 #endif // PROVIDES_SOCKET_API | |
| 66 #endif // LIBRARIES_NACL_IO_MOUNT_NODE_UDP_H_ | |
| OLD | NEW |