OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 // TODO(vtl): notes to self: | 5 // TODO(vtl): notes to self: |
6 // - file offsets, file positions, and file sizes are int64 (though positions | 6 // - file offsets, file positions, and file sizes are int64 (though positions |
7 // and sizes must always be non-negative) | 7 // and sizes must always be non-negative) |
8 // - buffer size parameters (for read/write) are uint32 | 8 // - buffer size parameters (for read/write) are uint32 |
9 | 9 |
10 module filesystem; | 10 module filesystem; |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 // I.e., the access mode, etc. (as specified to |Directory::OpenFile()| by the | 58 // I.e., the access mode, etc. (as specified to |Directory::OpenFile()| by the |
59 // |open_flags| argument) as well as file position. | 59 // |open_flags| argument) as well as file position. |
60 Dup(File& file) => (FileError error); | 60 Dup(File& file) => (FileError error); |
61 | 61 |
62 // Syncs data to disk. | 62 // Syncs data to disk. |
63 Flush() => (FileError error); | 63 Flush() => (FileError error); |
64 | 64 |
65 // Attempts to take an exclusive write lock on the file. This both takes a | 65 // Attempts to take an exclusive write lock on the file. This both takes a |
66 // native OS file lock (so that non-chrome, non-mojo processes can't write to | 66 // native OS file lock (so that non-chrome, non-mojo processes can't write to |
67 // this file). | 67 // this file). |
| 68 [Sync] |
68 Lock() => (FileError error); | 69 Lock() => (FileError error); |
69 | 70 |
70 // Unlocks a previously locked file. | 71 // Unlocks a previously locked file. |
| 72 [Sync] |
71 Unlock() => (FileError error); | 73 Unlock() => (FileError error); |
72 | 74 |
73 // Returns a handle to the file for raw access. | 75 // Returns a handle to the file for raw access. |
74 AsHandle() => (FileError error, handle file_handle); | 76 AsHandle() => (FileError error, handle file_handle); |
75 }; | 77 }; |
OLD | NEW |