Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(243)

Unified Diff: native_client_sdk/src/libraries/nacl_io/passthroughfs/real_node.h

Issue 414993002: [NaCl SDK] nacl_io: Remove duplication between passthroughfs and devfs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: native_client_sdk/src/libraries/nacl_io/passthroughfs/real_node.h
diff --git a/native_client_sdk/src/libraries/nacl_io/passthroughfs/real_node.h b/native_client_sdk/src/libraries/nacl_io/passthroughfs/real_node.h
new file mode 100644
index 0000000000000000000000000000000000000000..2bc3ac184c4cefb58987ab32ed9d682c0182fc02
--- /dev/null
+++ b/native_client_sdk/src/libraries/nacl_io/passthroughfs/real_node.h
@@ -0,0 +1,52 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+#ifndef LIBRARIES_NACL_IO_PASSTHROUGHFS_REAL_NODE_H_
+#define LIBRARIES_NACL_IO_PASSTHROUGHFS_REAL_NODE_H_
+
+#include "nacl_io/node.h"
+
+namespace nacl_io {
+
+class RealNode : public Node {
+ public:
+ RealNode(Filesystem* filesystem, int real_fd, bool close_on_destroy = false);
+
+ protected:
+ virtual Error Init(int flags) { return 0; }
+
+ virtual void Destroy();
+
+ public:
+ // Normal read/write operations on a file
+ virtual Error Read(const HandleAttr& attr,
+ void* buf,
+ size_t count,
+ int* out_bytes);
+ virtual Error Write(const HandleAttr& attr,
+ const void* buf,
+ size_t count,
+ int* out_bytes);
+ virtual Error FTruncate(off_t size);
+ virtual Error GetDents(size_t offs,
+ struct dirent* pdir,
+ size_t count,
+ int* out_bytes);
+ virtual Error GetStat(struct stat* stat);
+ virtual Error Isatty();
+ virtual Error MMap(void* addr,
+ size_t length,
+ int prot,
+ int flags,
+ size_t offset,
+ void** out_addr);
+
+ private:
+ int real_fd_;
+ bool close_on_destroy_;
+};
+
+} // namespace nacl_io
+
+#endif // LIBRARIES_NACL_IO_PASSTHROUGHFS_REAL_NODE_H_

Powered by Google App Engine
This is Rietveld 408576698