| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef LIBRARIES_NACL_IO_EVENT_EMITTER_TCP_H_ |
| 6 #define LIBRARIES_NACL_IO_EVENT_EMITTER_TCP_H_ |
| 7 |
| 8 #include "nacl_io/event_emitter_stream.h" |
| 9 #include "nacl_io/fifo_char.h" |
| 10 |
| 11 #include "sdk_util/macros.h" |
| 12 #include "sdk_util/scoped_ref.h" |
| 13 |
| 14 namespace nacl_io { |
| 15 |
| 16 class EventEmitterTCP; |
| 17 typedef sdk_util::ScopedRef<EventEmitterTCP> ScopedEventEmitterTCP; |
| 18 |
| 19 class EventEmitterTCP : public EventEmitterStream { |
| 20 public: |
| 21 EventEmitterTCP(size_t rsize, size_t wsize); |
| 22 |
| 23 uint32_t ReadIn_Locked(char* buffer, uint32_t len); |
| 24 uint32_t WriteIn_Locked(const char* buffer, uint32_t len); |
| 25 |
| 26 uint32_t ReadOut_Locked(char* buffer, uint32_t len); |
| 27 uint32_t WriteOut_Locked(const char* buffer, uint32_t len); |
| 28 |
| 29 virtual FIFOChar* in_fifo() { return &in_fifo_; } |
| 30 virtual FIFOChar* out_fifo() { return &out_fifo_; } |
| 31 |
| 32 protected: |
| 33 FIFOChar in_fifo_; |
| 34 FIFOChar out_fifo_; |
| 35 DISALLOW_COPY_AND_ASSIGN(EventEmitterTCP); |
| 36 }; |
| 37 |
| 38 } // namespace nacl_io |
| 39 |
| 40 #endif // LIBRARIES_NACL_IO_EVENT_EMITTER_TCP_H_ |
| 41 |
| OLD | NEW |