| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2015 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_SOCKET_UNIX_NODE_H_ |
| 6 #define LIBRARIES_NACL_IO_SOCKET_UNIX_NODE_H_ |
| 7 |
| 8 #include "nacl_io/ossocket.h" |
| 9 #ifdef PROVIDES_SOCKET_API |
| 10 |
| 11 #include "nacl_io/node.h" |
| 12 #include "nacl_io/socket/socket_node.h" |
| 13 #include "nacl_io/socket/unix_event_emitter.h" |
| 14 |
| 15 namespace nacl_io { |
| 16 |
| 17 class UnixNode : public SocketNode { |
| 18 public: |
| 19 explicit UnixNode(Filesystem* filesystem); |
| 20 UnixNode(Filesystem* filesystem, const UnixNode& peer); |
| 21 |
| 22 virtual EventEmitter* GetEventEmitter(); |
| 23 |
| 24 protected: |
| 25 virtual Error Recv_Locked(void* buffer, |
| 26 size_t len, |
| 27 PP_Resource* out_addr, |
| 28 int* out_len); |
| 29 virtual Error Send_Locked(const void* buffer, |
| 30 size_t len, |
| 31 PP_Resource addr, |
| 32 int* out_len); |
| 33 virtual Error RecvFrom(const HandleAttr& attr, |
| 34 void* buf, |
| 35 size_t len, |
| 36 int flags, |
| 37 struct sockaddr* src_addr, |
| 38 socklen_t* addrlen, |
| 39 int* out_len); |
| 40 virtual Error Send(const HandleAttr& attr, |
| 41 const void* buf, |
| 42 size_t len, |
| 43 int flags, |
| 44 int* out_len); |
| 45 virtual Error SendTo(const HandleAttr& attr, |
| 46 const void* buf, |
| 47 size_t len, |
| 48 int flags, |
| 49 const struct sockaddr* dest_addr, |
| 50 socklen_t addrlen, |
| 51 int* out_len); |
| 52 |
| 53 private: |
| 54 ScopedUnixEventEmitter emitter_; |
| 55 }; |
| 56 |
| 57 } // namespace nacl_io |
| 58 |
| 59 #endif // PROVIDES_SOCKET_API |
| 60 #endif // LIBRARIES_NACL_IO_SOCKET_UNIX_NODE_H_ |
| OLD | NEW |