Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 // Next MinVersion: 2 | 5 // Next MinVersion: 3 |
| 6 | 6 |
| 7 module arc.mojom; | 7 module arc.mojom; |
| 8 | 8 |
| 9 // Represents a document in Android DocumentsProvider. | |
| 10 // See Android docs of DocumentsContract.Document for details. | |
| 11 [Extensible] | |
|
Luis Héctor Chávez
2016/12/07 15:59:05
nit: only enums need [Extensible].
Shuhei Takahashi
2016/12/08 05:38:03
Done.
| |
| 12 struct Document { | |
| 13 // ID of the document. | |
|
dcheng
2016/12/07 18:30:48
Does this have any structure, or is it just an opa
Shuhei Takahashi
2016/12/08 05:38:03
It's an opaque string, described in DocumentsContr
| |
| 14 string document_id; | |
| 15 | |
| 16 // Display name of the document. | |
| 17 string display_name; | |
| 18 | |
| 19 // MIME type of the document. | |
| 20 // A directory is represented by a document having MIME_TYPE_DIR MIME type. | |
| 21 string mime_type; | |
| 22 | |
| 23 // Size of the document in bytes. If the size is unknown, -1 is set. | |
|
Yusuke Sato
2016/12/07 18:50:27
When is the size unknown typically? Example?
Shuhei Takahashi
2016/12/08 05:38:03
Added examples (directories and streams).
| |
| 24 int64 size; | |
| 25 | |
| 26 // Timestamp when the document was modified last time, in milliseconds | |
| 27 // since UNIX epoch. | |
| 28 uint64 last_modified; | |
|
dcheng
2016/12/07 18:30:48
Can we use Time from common_custom_types.mojom?
Shuhei Takahashi
2016/12/08 05:38:03
Having a typed value sounds pretty, but Time is ma
dcheng
2016/12/09 08:00:18
Would you be willing to file a bug for this and ad
Shuhei Takahashi
2016/12/09 08:17:53
Sure, filed a bug: http://crbug.com/672737
| |
| 29 }; | |
| 30 | |
| 9 // Next method ID: 3 | 31 // Next method ID: 3 |
|
Luis Héctor Chávez
2016/12/07 15:59:05
Next method ID: 5
Shuhei Takahashi
2016/12/08 05:38:03
Oops, done.
| |
| 10 interface FileSystemInstance { | 32 interface FileSystemInstance { |
| 33 // Queries child documents of the directory specified by |authority| and | |
| 34 // |parent_document_id| in Documents Provider. | |
| 35 // If such a directory does not exist, null is returned. | |
| 36 [MinVersion=2] GetChildDocuments@4(string authority, | |
| 37 string parent_document_id) => | |
| 38 (array<Document>? documents); | |
| 39 | |
| 40 // Queries the document specified by |authority| and |document_id| in | |
| 41 // Documents Provider. | |
| 42 // If such a document does not exist, null is returned. | |
| 43 [MinVersion=2] GetDocument@3(string authority, string document_id) => | |
| 44 (Document? document); | |
| 45 | |
| 11 // Asks the ContentResolver for the size of the file specified by the URL. | 46 // Asks the ContentResolver for the size of the file specified by the URL. |
| 12 // If the file does not exist or the size is unknown, -1 is returned. | 47 // If the file does not exist or the size is unknown, -1 is returned. |
| 13 [MinVersion=1] GetFileSize@1(string url) => (int64 size); | 48 [MinVersion=1] GetFileSize@1(string url) => (int64 size); |
| 14 | 49 |
| 15 // Asks the ContentResolver to get a FD to read the file specified by the | 50 // Asks the ContentResolver to get a FD to read the file specified by the |
| 16 // URL. | 51 // URL. |
| 17 [MinVersion=1] OpenFileToRead@2(string url) => (handle? fd); | 52 [MinVersion=1] OpenFileToRead@2(string url) => (handle? fd); |
| 18 | 53 |
| 19 // Requests MediaProvider to scan specified files. | 54 // Requests MediaProvider to scan specified files. |
| 20 // When the specified file does not exist, the corresponding entry in | 55 // When the specified file does not exist, the corresponding entry in |
| 21 // MediaProvider is removed. | 56 // MediaProvider is removed. |
| 22 RequestMediaScan@0(array<string> paths); | 57 RequestMediaScan@0(array<string> paths); |
| 23 }; | 58 }; |
| OLD | NEW |