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 |
| 11 // client to receive and handle the shutdown signal. Just because the shell has |
| 12 // closed the application connection to the FileSystem doesn't mean that we |
| 13 // should immediately kill all connections to our clients. We notify them that |
| 14 // we are shutting down so that they can flush any data and cleanly shutdown. |
| 15 // |
| 16 // Actual connection lifetime is controlled by the lifetime of the |directory| |
| 17 // object. |
| 18 interface FileSystemClient { |
| 19 OnFileSystemShutdown(); |
| 20 }; |
| 21 |
10 interface FileSystem { | 22 interface FileSystem { |
11 // Opens the root directory for the file system with the given name; null | 23 // Opens the root directory for the file system with the given name; null |
12 // yields the default file system, if any. | 24 // yields the default file system, if any. |
13 OpenFileSystem(string? file_system, Directory& directory) => (FileError error)
; | 25 OpenFileSystem(string? file_system, Directory& directory, |
| 26 FileSystemClient client) => (FileError error); |
14 }; | 27 }; |
OLD | NEW |