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 #include "nacl_io/event_emitter_stream.h" | 5 #include "nacl_io/event_emitter_stream.h" |
6 | 6 |
7 #include <poll.h> | 7 #include <poll.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <stdlib.h> | 9 #include <stdlib.h> |
10 | 10 |
(...skipping 21 matching lines...) Expand all Loading... |
32 if (!in_fifo()->IsEmpty()) | 32 if (!in_fifo()->IsEmpty()) |
33 status |= POLLIN; | 33 status |= POLLIN; |
34 | 34 |
35 if (!out_fifo()->IsFull()) | 35 if (!out_fifo()->IsFull()) |
36 status |= POLLOUT; | 36 status |= POLLOUT; |
37 | 37 |
38 ClearEvents_Locked(~status); | 38 ClearEvents_Locked(~status); |
39 RaiseEvents_Locked(status); | 39 RaiseEvents_Locked(status); |
40 } | 40 } |
41 | 41 |
| 42 uint32_t EventEmitterStream::BytesInOutputFIFO() { |
| 43 return out_fifo()->ReadAvailable(); |
| 44 } |
| 45 |
| 46 uint32_t EventEmitterStream::SpaceInInputFIFO() { |
| 47 return in_fifo()->WriteAvailable(); |
| 48 } |
42 | 49 |
43 } // namespace nacl_io | 50 } // namespace nacl_io |
44 | |
45 | |
OLD | NEW |