| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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_FILESYSTEM_H_ | 5 #ifndef LIBRARIES_NACL_IO_FILESYSTEM_H_ |
| 6 #define LIBRARIES_NACL_IO_FILESYSTEM_H_ | 6 #define LIBRARIES_NACL_IO_FILESYSTEM_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 // |ppapi| can be NULL. If so, this filesystem cannot make any pepper calls. | 55 // |ppapi| can be NULL. If so, this filesystem cannot make any pepper calls. |
| 56 virtual Error Init(const FsInitArgs& args); | 56 virtual Error Init(const FsInitArgs& args); |
| 57 virtual void Destroy(); | 57 virtual void Destroy(); |
| 58 | 58 |
| 59 public: | 59 public: |
| 60 PepperInterface* ppapi() { return ppapi_; } | 60 PepperInterface* ppapi() { return ppapi_; } |
| 61 int dev() { return dev_; } | 61 int dev() { return dev_; } |
| 62 | 62 |
| 63 // All paths in functions below are expected to containing a leading "/". | 63 // All paths in functions below are expected to containing a leading "/". |
| 64 | 64 |
| 65 // Open a node at |path| with the specified open and modeflags. The resulting |
| 66 // Node is created with a ref count of 1. |
| 67 // Assumes that |out_node| is non-NULL. |
| 68 virtual Error OpenWithMode(const Path& path, |
| 69 int open_flags, |
| 70 mode_t mode, |
| 71 ScopedNode* out_node) = 0; |
| 72 |
| 65 // Open a node at |path| with the specified open flags. The resulting | 73 // Open a node at |path| with the specified open flags. The resulting |
| 66 // Node is created with a ref count of 1. | 74 // Node is created with a ref count of 1. |
| 67 // Assumes that |out_node| is non-NULL. | 75 // Assumes that |out_node| is non-NULL. |
| 68 virtual Error Open(const Path& path, | 76 Error Open(const Path& path, |
| 69 int open_flags, | 77 int open_flags, |
| 70 ScopedNode* out_node) = 0; | 78 ScopedNode* out_node); |
| 71 | 79 |
| 72 // OpenResource is only used to read files from the NaCl NMF file. No | 80 // OpenResource is only used to read files from the NaCl NMF file. No |
| 73 // filesystem except PassthroughFs should implement it. | 81 // filesystem except PassthroughFs should implement it. |
| 74 // Assumes that |out_node| is non-NULL. | 82 // Assumes that |out_node| is non-NULL. |
| 75 virtual Error OpenResource(const Path& path, ScopedNode* out_node); | 83 virtual Error OpenResource(const Path& path, ScopedNode* out_node); |
| 76 | 84 |
| 77 // Unlink, Mkdir, Rmdir will affect the both the RefCount | 85 // Unlink, Mkdir, Rmdir will affect the both the RefCount |
| 78 // and the nlink number in the stat object. | 86 // and the nlink number in the stat object. |
| 79 virtual Error Unlink(const Path& path) = 0; | 87 virtual Error Unlink(const Path& path) = 0; |
| 80 virtual Error Mkdir(const Path& path, int permissions) = 0; | 88 virtual Error Mkdir(const Path& path, int permissions) = 0; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 102 // May only be called by the KernelProxy when the Kernel's | 110 // May only be called by the KernelProxy when the Kernel's |
| 103 // lock is held, so we make it private. | 111 // lock is held, so we make it private. |
| 104 friend class KernelObject; | 112 friend class KernelObject; |
| 105 friend class KernelProxy; | 113 friend class KernelProxy; |
| 106 DISALLOW_COPY_AND_ASSIGN(Filesystem); | 114 DISALLOW_COPY_AND_ASSIGN(Filesystem); |
| 107 }; | 115 }; |
| 108 | 116 |
| 109 } // namespace nacl_io | 117 } // namespace nacl_io |
| 110 | 118 |
| 111 #endif // LIBRARIES_NACL_IO_FILESYSTEM_H_ | 119 #endif // LIBRARIES_NACL_IO_FILESYSTEM_H_ |
| OLD | NEW |