| 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; | 5 module filesystem; |
| 6 | 6 |
| 7 import "components/filesystem/public/interfaces/directory.mojom"; | 7 import "components/filesystem/public/interfaces/directory.mojom"; |
| 8 import "components/filesystem/public/interfaces/types.mojom"; | 8 import "components/filesystem/public/interfaces/types.mojom"; |
| 9 | 9 |
| 10 // Callback interface for FileSystem. When we call OpenFileSystem, we supply a | 10 interface FileSystem { |
| 11 // client to receive and handle the shutdown signal. Just because the shell has | 11 // Opens a temporary filesystem. Will return a different directory each time |
| 12 // closed the application connection to the FileSystem doesn't mean that we | 12 // it is called. |
| 13 // should immediately kill all connections to our clients. We notify them that | 13 OpenTempDirectory(Directory& directory) => (FileError error); |
| 14 // we are shutting down so that they can flush any data and cleanly shutdown. | 14 |
| 15 // | 15 // Returns a directory which will persist to disk. |
| 16 // Actual connection lifetime is controlled by the lifetime of the |directory| | 16 OpenPersistentFileSystem(Directory& directory) => (FileError error); |
| 17 // object. | |
| 18 interface FileSystemClient { | |
| 19 OnFileSystemShutdown(); | |
| 20 }; | 17 }; |
| 21 | |
| 22 interface FileSystem { | |
| 23 // Opens the root directory for the file system with the given name; null | |
| 24 // yields the default file system, if any. | |
| 25 OpenFileSystem(string? file_system, Directory& directory, | |
| 26 FileSystemClient client) => (FileError error); | |
| 27 }; | |
| OLD | NEW |