1 // Copyright 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.
5 #ifndef LIBRARIES_NACL_IO_PIPE_PIPE_EVENT_EMITTER_H_
6 #define LIBRARIES_NACL_IO_PIPE_PIPE_EVENT_EMITTER_H_
12 #include "nacl_io/fifo_char.h"
13 #include "nacl_io/stream/stream_event_emitter.h"
15 #include "sdk_util/auto_lock.h"
16 #include "sdk_util/macros.h"
20 class PipeEventEmitter
;
21 typedef sdk_util::ScopedRef
<PipeEventEmitter
> ScopedPipeEventEmitter
;
23 class PipeEventEmitter
: public StreamEventEmitter
{
25 explicit PipeEventEmitter(size_t size
);
27 Error
Read_Locked(char* data
, size_t len
, int* out_bytes
);
28 Error
Write_Locked(const char* data
, size_t len
, int* out_bytes
);
31 virtual FIFOChar
* in_fifo() { return &fifo_
; }
32 virtual FIFOChar
* out_fifo() { return &fifo_
; }
36 DISALLOW_COPY_AND_ASSIGN(PipeEventEmitter
);
39 } // namespace nacl_io
41 #endif // LIBRARIES_NACL_IO_PIPE_PIPE_EVENT_EMITTER_H_