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(); |
| 35 |
| 36 PP_Resource GetAcceptedSocket_Locked(); |
| 37 void SetAcceptedSocket_Locked(PP_Resource socket); |
| 38 |
| 39 protected: |
29 virtual FIFOChar* in_fifo() { return &in_fifo_; } | 40 virtual FIFOChar* in_fifo() { return &in_fifo_; } |
30 virtual FIFOChar* out_fifo() { return &out_fifo_; } | 41 virtual FIFOChar* out_fifo() { return &out_fifo_; } |
31 | 42 |
32 protected: | 43 private: |
33 FIFOChar in_fifo_; | 44 FIFOChar in_fifo_; |
34 FIFOChar out_fifo_; | 45 FIFOChar out_fifo_; |
| 46 PP_Resource accepted_socket_; |
35 DISALLOW_COPY_AND_ASSIGN(EventEmitterTCP); | 47 DISALLOW_COPY_AND_ASSIGN(EventEmitterTCP); |
36 }; | 48 }; |
37 | 49 |
38 } // namespace nacl_io | 50 } // namespace nacl_io |
39 | 51 |
40 #endif // LIBRARIES_NACL_IO_EVENT_EMITTER_TCP_H_ | 52 #endif // LIBRARIES_NACL_IO_EVENT_EMITTER_TCP_H_ |
41 | 53 |
OLD | NEW |