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_UNIXSOCKET_EVENT_EMITTER_H_ | |
| 6 #define LIBRARIES_NACL_IO_SOCKET_UNIXSOCKET_EVENT_EMITTER_H_ | |
| 7 | |
| 8 #include "nacl_io/fifo_char.h" | |
| 9 #include "nacl_io/stream/stream_event_emitter.h" | |
| 10 | |
| 11 #include "sdk_util/macros.h" | |
| 12 #include "sdk_util/scoped_ref.h" | |
| 13 #include "sdk_util/simple_lock.h" | |
| 14 | |
| 15 namespace nacl_io { | |
| 16 | |
| 17 class UnixEventEmitter; | |
|
Sam Clegg
2015/09/22 17:53:44
Sorry, I think that the callname should match the
avallee
2015/09/22 20:25:06
I'm going to rename the files back to unix_{node,e
| |
| 18 class Node; | |
| 19 | |
| 20 typedef sdk_util::ScopedRef<UnixEventEmitter> ScopedUnixEventEmitter; | |
| 21 | |
| 22 class UnixEventEmitter : public StreamEventEmitter { | |
| 23 public: | |
| 24 uint32_t ReadIn_Locked(char* buffer, uint32_t len); | |
| 25 uint32_t WriteOut_Locked(const char* buffer, uint32_t len); | |
| 26 | |
| 27 uint32_t BytesInOutputFIFO(); | |
| 28 uint32_t SpaceInInputFIFO(); | |
| 29 | |
| 30 virtual ScopedUnixEventEmitter GetPeerEmitter() = 0; | |
| 31 | |
| 32 static ScopedUnixEventEmitter MakeUnixEventEmitter(size_t size); | |
| 33 | |
| 34 protected: | |
| 35 UnixEventEmitter() {} | |
| 36 | |
| 37 // Probably only need the master's lock. | |
| 38 virtual const sdk_util::SimpleLock& GetFifoLock() = 0; | |
| 39 virtual FIFOInterface* in_fifo() { return in_fifoc(); } | |
| 40 virtual FIFOInterface* out_fifo() { return out_fifoc(); } | |
| 41 virtual FIFOChar* in_fifoc() = 0; | |
| 42 virtual FIFOChar* out_fifoc() = 0; | |
| 43 | |
| 44 private: | |
| 45 DISALLOW_COPY_AND_ASSIGN(UnixEventEmitter); | |
| 46 }; | |
| 47 | |
| 48 } // namespace nacl_io | |
| 49 | |
| 50 #endif // LIBRARIES_NACL_IO_SOCKET_UNIXSOCKET_EVENT_EMITTER_H_ | |
| OLD | NEW |