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 module filesystem.mojom; | 5 module filesystem.mojom; |
6 | 6 |
7 import "components/filesystem/public/interfaces/file.mojom"; | 7 import "components/filesystem/public/interfaces/file.mojom"; |
8 import "components/filesystem/public/interfaces/types.mojom"; | 8 import "components/filesystem/public/interfaces/types.mojom"; |
9 | 9 |
10 struct FileOpenDetails { | 10 struct FileOpenDetails { |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 | 84 |
85 // Gets information about this file. On success, |file_information| is | 85 // Gets information about this file. On success, |file_information| is |
86 // non-null and will contain this information. | 86 // non-null and will contain this information. |
87 [Sync] | 87 [Sync] |
88 StatFile(string path) => (FileError error, FileInformation? file_information); | 88 StatFile(string path) => (FileError error, FileInformation? file_information); |
89 | 89 |
90 // Creates a copy of this directory. | 90 // Creates a copy of this directory. |
91 Clone(Directory& directory); | 91 Clone(Directory& directory); |
92 | 92 |
93 // Reads the contents of an entire file. | 93 // Reads the contents of an entire file. |
| 94 [Sync] |
94 ReadEntireFile(string path) => (FileError error, array<uint8> data); | 95 ReadEntireFile(string path) => (FileError error, array<uint8> data); |
95 | 96 |
96 // Writes |data| to |path|, overwriting the file if it already exists. | 97 // Writes |data| to |path|, overwriting the file if it already exists. |
| 98 [Sync] |
97 WriteFile(string path, array<uint8> data) => (FileError error); | 99 WriteFile(string path, array<uint8> data) => (FileError error); |
98 | 100 |
99 // TODO(vtl): directory "streaming"? | 101 // TODO(vtl): directory "streaming"? |
100 // TODO(vtl): "make root" (i.e., prevent cd-ing, etc., to parent); note that | 102 // TODO(vtl): "make root" (i.e., prevent cd-ing, etc., to parent); note that |
101 // this would require a much more complicated implementation (e.g., it needs | 103 // this would require a much more complicated implementation (e.g., it needs |
102 // to be "inherited" by OpenDirectory(), and the enforcement needs to be valid | 104 // to be "inherited" by OpenDirectory(), and the enforcement needs to be valid |
103 // even if the opened directory is subsequently moved -- e.g., closer to the | 105 // even if the opened directory is subsequently moved -- e.g., closer to the |
104 // "root") | 106 // "root") |
105 // TODO(vtl): Add a "watch"? | 107 // TODO(vtl): Add a "watch"? |
106 }; | 108 }; |
OLD | NEW |