Chromium Code Reviews| 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_SOCKETPAIR_NODE_H_ | |
| 6 #define LIBRARIES_NACL_IO_SOCKET_UNIX_SOCKETPAIR_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 UnixSocketpairNode : public SocketNode { | |
| 18 public: | |
| 19 explicit UnixSocketpairNode(Filesystem* filesystem); | |
|
Sam Clegg
2015/09/17 09:40:39
Should we just call this UnixSocketNode, since it
avallee
2015/09/17 16:18:01
Sounds fair.
binji
2015/09/18 23:30:13
Please rename the class as well.
| |
| 20 UnixSocketpairNode(Filesystem* filesystem, const UnixSocketpairNode& 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 private: | |
| 53 ScopedUnixEventEmitter emitter_; | |
| 54 }; | |
| 55 | |
| 56 } // namespace nacl_io | |
| 57 | |
| 58 #endif // PROVIDES_SOCKET_API | |
| 59 #endif // LIBRARIES_NACL_IO_SOCKET_UNIX_SOCKETPAIR_NODE_H_ | |
| OLD | NEW |