OLD | NEW |
---|---|
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_EVENT_EMITTER_TCP_H_ | 5 #ifndef LIBRARIES_NACL_IO_EVENT_EMITTER_TCP_H_ |
6 #define LIBRARIES_NACL_IO_EVENT_EMITTER_TCP_H_ | 6 #define LIBRARIES_NACL_IO_EVENT_EMITTER_TCP_H_ |
7 | 7 |
8 #include "nacl_io/event_emitter_stream.h" | 8 #include "nacl_io/event_emitter_stream.h" |
9 #include "nacl_io/fifo_char.h" | 9 #include "nacl_io/fifo_char.h" |
10 | 10 |
11 #include <ppapi/c/pp_resource.h> | |
12 | |
11 #include "sdk_util/macros.h" | 13 #include "sdk_util/macros.h" |
12 #include "sdk_util/scoped_ref.h" | 14 #include "sdk_util/scoped_ref.h" |
13 | 15 |
16 | |
14 namespace nacl_io { | 17 namespace nacl_io { |
15 | 18 |
16 class EventEmitterTCP; | 19 class EventEmitterTCP; |
20 class MountNode; | |
21 | |
17 typedef sdk_util::ScopedRef<EventEmitterTCP> ScopedEventEmitterTCP; | 22 typedef sdk_util::ScopedRef<EventEmitterTCP> ScopedEventEmitterTCP; |
18 | 23 |
19 class EventEmitterTCP : public EventEmitterStream { | 24 class EventEmitterTCP : public EventEmitterStream { |
20 public: | 25 public: |
21 EventEmitterTCP(size_t rsize, size_t wsize); | 26 EventEmitterTCP(size_t rsize, size_t wsize); |
22 | 27 |
23 uint32_t ReadIn_Locked(char* buffer, uint32_t len); | 28 uint32_t ReadIn_Locked(char* buffer, uint32_t len); |
24 uint32_t WriteIn_Locked(const char* buffer, uint32_t len); | 29 uint32_t WriteIn_Locked(const char* buffer, uint32_t len); |
25 | 30 |
26 uint32_t ReadOut_Locked(char* buffer, uint32_t len); | 31 uint32_t ReadOut_Locked(char* buffer, uint32_t len); |
27 uint32_t WriteOut_Locked(const char* buffer, uint32_t len); | 32 uint32_t WriteOut_Locked(const char* buffer, uint32_t len); |
28 | 33 |
34 void ConnectDone_Locked(); | |
35 PP_Resource GetAcceptedSocket_Locked(); | |
36 void SetAcceptedSocket_Locked(PP_Resource socket); | |
37 | |
38 protected: | |
29 virtual FIFOChar* in_fifo() { return &in_fifo_; } | 39 virtual FIFOChar* in_fifo() { return &in_fifo_; } |
noelallen1
2013/10/12 00:13:29
same
| |
30 virtual FIFOChar* out_fifo() { return &out_fifo_; } | 40 virtual FIFOChar* out_fifo() { return &out_fifo_; } |
31 | 41 |
32 protected: | 42 private: |
33 FIFOChar in_fifo_; | 43 FIFOChar in_fifo_; |
34 FIFOChar out_fifo_; | 44 FIFOChar out_fifo_; |
45 PP_Resource accepted_socket_; | |
35 DISALLOW_COPY_AND_ASSIGN(EventEmitterTCP); | 46 DISALLOW_COPY_AND_ASSIGN(EventEmitterTCP); |
36 }; | 47 }; |
37 | 48 |
38 } // namespace nacl_io | 49 } // namespace nacl_io |
39 | 50 |
40 #endif // LIBRARIES_NACL_IO_EVENT_EMITTER_TCP_H_ | 51 #endif // LIBRARIES_NACL_IO_EVENT_EMITTER_TCP_H_ |
41 | 52 |
OLD | NEW |