Chromium Code Reviews| Index: components/arc/common/file_system.mojom |
| diff --git a/components/arc/common/file_system.mojom b/components/arc/common/file_system.mojom |
| index de13a030d0099265c5fd65fb27f39bfade747812..38c3d4d080b23dc57777bef2fd996caebb40dbd6 100644 |
| --- a/components/arc/common/file_system.mojom |
| +++ b/components/arc/common/file_system.mojom |
| @@ -2,7 +2,7 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| // |
| -// Next MinVersion: 3 |
| +// Next MinVersion: 4 |
| module arc.mojom; |
| @@ -29,7 +29,15 @@ struct Document { |
| uint64 last_modified; |
| }; |
| -// Next method ID: 5 |
| +// Next method ID: 1 |
| +interface FileSystemHost { |
| + // Called when a watched document was changed or deleted. |
| + // If |deleted| is true, the watcher has been already removed and the host |
| + // does not need to explicitly call RemoveWatcher(). |
| + [MinVersion=3] OnDocumentChanged@0(int64 watcher_id, bool deleted); |
|
Luis Héctor Chávez
2017/02/22 17:29:31
I'd prefer to replace |bool deleted| with an enum
Shuhei Takahashi
2017/02/23 03:37:22
Sure, let's use enum instead.
We are not going to
|
| +}; |
| + |
| +// Next method ID: 8 |
| interface FileSystemInstance { |
| // Notes about Android Documents Provider: |
| // |
| @@ -47,6 +55,18 @@ interface FileSystemInstance { |
| // https://developer.android.com/guide/topics/providers/document-provider.html |
| // https://developer.android.com/reference/android/provider/DocumentsContract.html |
| + // Installs a document watcher to watch updates of a document. |
| + // |
| + // On success, a positive unique integer is returned as a watcher ID and |
| + // FileSystemHost.OnDocumentChanged() will be called with the watcher ID |
| + // on document changes until the watcher is removed by RemoveWatcher(). |
| + // On failure, -1 is returned. |
| + // |
| + // It is allowed to install multiple watchers to the same document. In that |
| + // case, different watcher IDs are returned. |
| + [MinVersion=3] AddWatcher@6(string authority, string document_id) => |
| + (int64 watcher_id); |
| + |
| // Queries child documents of the directory specified by |authority| and |
| // |parent_document_id| in Documents Provider. |
| // If such a directory does not exist, null is returned. |
| @@ -65,10 +85,16 @@ interface FileSystemInstance { |
| // streams), -1 is returned. |
| [MinVersion=1] GetFileSize@1(string url) => (int64 size); |
| + // Establishes full-duplex communication with the host. |
| + [MinVersion=3] Init@5(FileSystemHost host_ptr); |
| + |
| // Asks the ContentResolver to get a FD to read the file specified by the |
| // URL. |
| [MinVersion=1] OpenFileToRead@2(string url) => (handle? fd); |
| + // Uninstalls a document watcher. |
|
Luis Héctor Chávez
2017/02/22 17:29:31
Please document the semantics of uninstalling a do
Shuhei Takahashi
2017/02/23 03:37:22
I changed the comment of OnDocumentChanged():
B
|
| + [MinVersion=3] RemoveWatcher@7(int64 watcher_id) => (bool success); |
| + |
| // Requests MediaProvider to scan specified files. |
| // When the specified file does not exist, the corresponding entry in |
| // MediaProvider is removed. |