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_STREAM_H_ | 5 #ifndef LIBRARIES_NACL_IO_EVENT_EMITTER_STREAM_H_ |
6 #define LIBRARIES_NACL_IO_EVENT_EMITTER_STREAM_H_ | 6 #define LIBRARIES_NACL_IO_EVENT_EMITTER_STREAM_H_ |
7 | 7 |
8 #include "nacl_io/event_emitter.h" | 8 #include "nacl_io/event_emitter.h" |
9 | 9 |
10 #include "sdk_util/macros.h" | 10 #include "sdk_util/macros.h" |
11 #include "sdk_util/scoped_ref.h" | 11 #include "sdk_util/scoped_ref.h" |
12 | 12 |
13 namespace nacl_io { | 13 namespace nacl_io { |
14 | 14 |
15 class EventEmitterStream; | 15 class EventEmitterStream; |
16 class FIFOInterface; | 16 class FIFOInterface; |
17 class MountNodeStream; | 17 class MountNodeStream; |
18 | 18 |
19 typedef sdk_util::ScopedRef<EventEmitterStream> ScopedEventEmitterStream; | 19 typedef sdk_util::ScopedRef<EventEmitterStream> ScopedEventEmitterStream; |
20 | 20 |
21 class EventEmitterStream : public EventEmitter { | 21 class EventEmitterStream : public EventEmitter { |
22 public: | 22 public: |
23 EventEmitterStream(); | 23 EventEmitterStream(); |
24 | 24 |
25 void AttachStream(MountNodeStream* stream); | 25 void AttachStream(MountNodeStream* stream); |
26 void DetachStream(); | 26 void DetachStream(); |
27 | 27 |
28 MountNodeStream* stream() { return stream_; } | 28 MountNodeStream* stream() { return stream_; } |
29 | 29 |
| 30 uint32_t BytesInOutputFIFO(); |
| 31 uint32_t SpaceInInputFIFO(); |
| 32 |
30 protected: | 33 protected: |
31 virtual FIFOInterface* in_fifo() = 0; | 34 virtual FIFOInterface* in_fifo() = 0; |
32 virtual FIFOInterface* out_fifo() = 0; | 35 virtual FIFOInterface* out_fifo() = 0; |
33 void UpdateStatus_Locked(); | 36 void UpdateStatus_Locked(); |
34 | 37 |
35 protected: | 38 protected: |
36 MountNodeStream* stream_; | 39 MountNodeStream* stream_; |
37 DISALLOW_COPY_AND_ASSIGN(EventEmitterStream); | 40 DISALLOW_COPY_AND_ASSIGN(EventEmitterStream); |
38 }; | 41 }; |
39 | 42 |
40 } // namespace nacl_io | 43 } // namespace nacl_io |
41 | 44 |
42 #endif // LIBRARIES_NACL_IO_EVENT_EMITTER_STREAM_H_ | 45 #endif // LIBRARIES_NACL_IO_EVENT_EMITTER_STREAM_H_ |
43 | 46 |
OLD | NEW |