| 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 // Test whether a file or directory at a given path can be accessed. | |
| 66 // Returns 0 on success, or an appropriate errno value on failure. | |
| 67 virtual Error Access(const Path& path, int a_mode) = 0; | |
| 68 | |
| 69 // Open a node at |path| with the specified open flags. The resulting | 65 // Open a node at |path| with the specified open flags. The resulting |
| 70 // Node is created with a ref count of 1. | 66 // Node is created with a ref count of 1. |
| 71 // Assumes that |out_node| is non-NULL. | 67 // Assumes that |out_node| is non-NULL. |
| 72 virtual Error Open(const Path& path, | 68 virtual Error Open(const Path& path, |
| 73 int open_flags, | 69 int open_flags, |
| 74 ScopedNode* out_node) = 0; | 70 ScopedNode* out_node) = 0; |
| 75 | 71 |
| 76 // OpenResource is only used to read files from the NaCl NMF file. No | 72 // OpenResource is only used to read files from the NaCl NMF file. No |
| 77 // filesystem except PassthroughFs should implement it. | 73 // filesystem except PassthroughFs should implement it. |
| 78 // Assumes that |out_node| is non-NULL. | 74 // Assumes that |out_node| is non-NULL. |
| (...skipping 27 matching lines...) Expand all Loading... |
| 106 // May only be called by the KernelProxy when the Kernel's | 102 // May only be called by the KernelProxy when the Kernel's |
| 107 // lock is held, so we make it private. | 103 // lock is held, so we make it private. |
| 108 friend class KernelObject; | 104 friend class KernelObject; |
| 109 friend class KernelProxy; | 105 friend class KernelProxy; |
| 110 DISALLOW_COPY_AND_ASSIGN(Filesystem); | 106 DISALLOW_COPY_AND_ASSIGN(Filesystem); |
| 111 }; | 107 }; |
| 112 | 108 |
| 113 } // namespace nacl_io | 109 } // namespace nacl_io |
| 114 | 110 |
| 115 #endif // LIBRARIES_NACL_IO_FILESYSTEM_H_ | 111 #endif // LIBRARIES_NACL_IO_FILESYSTEM_H_ |
| OLD | NEW |