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. 4 5 #ifndef LIBRARIES_NACL_IO_PIPE_PIPE_NODE_H_ 6 #define LIBRARIES_NACL_IO_PIPE_PIPE_NODE_H_ 7 8 #include <map> 9 #include <string> 10 11 #include "nacl_io/pipe/pipe_event_emitter.h" 12 #include "nacl_io/stream/stream_node.h" 13 14 namespace nacl_io { 15 16 class PipeNode : public StreamNode { 17 public: 18 explicit PipeNode(Filesystem* fs); 19 20 virtual PipeEventEmitter* GetEventEmitter(); 21 virtual Error Read(const HandleAttr& attr, 22 void* buf, 23 size_t count, 24 int* out_bytes); 25 virtual Error Write(const HandleAttr& attr, 26 const void* buf, 27 size_t count, 28 int* out_bytes); 29 30 protected: 31 ScopedPipeEventEmitter pipe_; 32 33 friend class KernelProxy; 34 friend class StreamFs; 35 }; 36 37 } // namespace nacl_io 38 39 #endif // LIBRARIES_NACL_IO_PIPE_PIPE_NODE_H_ 40