Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(398)

Side by Side Diff: native_client_sdk/src/libraries/nacl_io/mount_node_tcp.h

Issue 23498015: [NaCl SDK] Support non blocking TCP/UDP (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added Fifo Tests Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 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 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 LIBRARIES_NACL_IO_MOUNT_NODE_TCP_H_ 5 #ifndef LIBRARIES_NACL_IO_MOUNT_NODE_TCP_H_
6 #define LIBRARIES_NACL_IO_MOUNT_NODE_TCP_H_ 6 #define LIBRARIES_NACL_IO_MOUNT_NODE_TCP_H_
7 7
8 #include "nacl_io/ossocket.h" 8 #include "nacl_io/ossocket.h"
9 #ifdef PROVIDES_SOCKET_API 9 #ifdef PROVIDES_SOCKET_API
10 10
11 #include <ppapi/c/pp_resource.h> 11 #include <ppapi/c/pp_resource.h>
12 #include <ppapi/c/ppb_tcp_socket.h> 12 #include <ppapi/c/ppb_tcp_socket.h>
13 13
14 #include "nacl_io/event_emitter_tcp.h"
14 #include "nacl_io/mount_node.h" 15 #include "nacl_io/mount_node.h"
15 #include "nacl_io/mount_node_socket.h" 16 #include "nacl_io/mount_node_socket.h"
16 17
17 namespace nacl_io { 18 namespace nacl_io {
18 19
19 class MountNodeTCP : public MountNodeSocket { 20 class MountNodeTCP : public MountNodeSocket {
20 public: 21 public:
21 explicit MountNodeTCP(Mount* mount); 22 explicit MountNodeTCP(Mount* mount);
22 23
23 virtual Error Init(int flags); 24 virtual Error Init(int flags);
25 virtual EventEmitter* GetEventEmitter();
24 26
25 virtual Error Bind(const struct sockaddr* addr, socklen_t len); 27 virtual Error Bind(const struct sockaddr* addr, socklen_t len);
26 virtual Error Connect(const struct sockaddr* addr, socklen_t len); 28 virtual Error Connect(const struct sockaddr* addr, socklen_t len);
27 29
28 virtual Error Recv(void* buf, size_t len, int flags, int* out_len); 30 virtual Error Recv(void* buf, size_t len, int flags, int* out_len);
29 virtual Error RecvFrom(void* buf, 31 virtual Error RecvFrom(void* buf,
30 size_t len, 32 size_t len,
31 int flags, 33 int flags,
32 struct sockaddr* src_addr, 34 struct sockaddr* src_addr,
33 socklen_t* addrlen, 35 socklen_t* addrlen,
34 int* out_len); 36 int* out_len);
35 37
36 virtual Error Send(const void* buf, size_t len, int flags, int* out_len); 38 virtual Error Send(const void* buf, size_t len, int flags, int* out_len);
37 virtual Error SendTo(const void* buf, 39 virtual Error SendTo(const void* buf,
38 size_t len, 40 size_t len,
39 int flags, 41 int flags,
40 const struct sockaddr* dest_addr, 42 const struct sockaddr* dest_addr,
41 socklen_t addrlen, 43 socklen_t addrlen,
42 int* out_len); 44 int* out_len);
43 45
44 protected: 46 protected:
45 TCPSocketInterface* TCPSocket(); 47 ScopedEventEmitterTCP emitter_;
48 friend class UDPSendWork;
binji 2013/09/15 22:18:58 It should be TCP*Work, but if it compiles it isn't
noelallen1 2013/09/17 21:21:54 Not needed, I've been removing friends all over.
49 friend class UDPRecvWork;
46 }; 50 };
47 51
48 52
49 } // namespace nacl_io 53 } // namespace nacl_io
50 54
51 #endif // PROVIDES_SOCKET_API 55 #endif // PROVIDES_SOCKET_API
52 #endif // LIBRARIES_NACL_IO_MOUNT_NODE_TCP_H_ 56 #endif // LIBRARIES_NACL_IO_MOUNT_NODE_TCP_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698