OLD | NEW |
---|---|
1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 /* Copyright (c) 2012 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_MOUNT_H_ | 5 #ifndef LIBRARIES_NACL_IO_MOUNT_H_ |
6 #define LIBRARIES_NACL_IO_MOUNT_H_ | 6 #define LIBRARIES_NACL_IO_MOUNT_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
45 | 45 |
46 PepperInterface* ppapi() { return ppapi_; } | 46 PepperInterface* ppapi() { return ppapi_; } |
47 | 47 |
48 // Assumes that |node| is non-NULL. | 48 // Assumes that |node| is non-NULL. |
49 void AcquireNode(MountNode* node); | 49 void AcquireNode(MountNode* node); |
50 // Assumes that |node| is non-NULL. | 50 // Assumes that |node| is non-NULL. |
51 void ReleaseNode(MountNode* node); | 51 void ReleaseNode(MountNode* node); |
52 | 52 |
53 // All paths in functions below are expected to containing a leading "/". | 53 // All paths in functions below are expected to containing a leading "/". |
54 | 54 |
55 // Test whether a file at a given path can be accessed. | |
56 // Returns 0 on success, or an appropriate errno value on failure. | |
binji
2013/06/19 16:46:28
What is the behavior of access if given a director
Matt Giuca
2013/06/20 01:43:14
Should be the same as for normal access. R_OK mean
binji
2013/06/20 16:07:21
Hm. I might like to have something similar to your
| |
57 virtual Error Access(const Path& path, int a_mode) = 0; | |
58 | |
55 // Open a node at |path| with the specified open flags. The resulting | 59 // Open a node at |path| with the specified open flags. The resulting |
56 // MountNode is created with a ref count of 1. | 60 // MountNode is created with a ref count of 1. |
57 // Assumes that |out_node| is non-NULL. | 61 // Assumes that |out_node| is non-NULL. |
58 virtual Error Open(const Path& path, int o_flags, MountNode** out_node) = 0; | 62 virtual Error Open(const Path& path, int o_flags, MountNode** out_node) = 0; |
59 | 63 |
60 // OpenResource is only used to read files from the NaCl NMF file. No mount | 64 // OpenResource is only used to read files from the NaCl NMF file. No mount |
61 // except MountPassthrough should implement it. | 65 // except MountPassthrough should implement it. |
62 // Assumes that |out_node| is non-NULL. | 66 // Assumes that |out_node| is non-NULL. |
63 virtual Error OpenResource(const Path& path, MountNode** out_node); | 67 virtual Error OpenResource(const Path& path, MountNode** out_node); |
64 | 68 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
106 delete mnt; | 110 delete mnt; |
107 *out_mount = NULL; | 111 *out_mount = NULL; |
108 return error; | 112 return error; |
109 } | 113 } |
110 | 114 |
111 *out_mount = mnt; | 115 *out_mount = mnt; |
112 return 0; | 116 return 0; |
113 } | 117 } |
114 | 118 |
115 #endif // LIBRARIES_NACL_IO_MOUNT_H_ | 119 #endif // LIBRARIES_NACL_IO_MOUNT_H_ |
OLD | NEW |