Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(460)

Side by Side Diff: components/arc/common/file_system.mojom

Issue 2914433002: arc: Use the MIME type returned by the container to handle content URLs (Closed)
Patch Set: Profile check Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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: 4 5 // Next MinVersion: 5
6 6
7 module arc.mojom; 7 module arc.mojom;
8 8
9 // Represents a document in Android DocumentsProvider. 9 // Represents a document in Android DocumentsProvider.
10 // See Android docs of DocumentsContract.Document for details. 10 // See Android docs of DocumentsContract.Document for details.
11 struct Document { 11 struct Document {
12 // Opaque ID of the document. 12 // Opaque ID of the document.
13 string document_id; 13 string document_id;
14 14
15 // Display name of the document. 15 // Display name of the document.
(...skipping 28 matching lines...) Expand all
44 }; 44 };
45 45
46 46
47 // Next method ID: 1 47 // Next method ID: 1
48 interface FileSystemHost { 48 interface FileSystemHost {
49 // Called when a watched document was changed. 49 // Called when a watched document was changed.
50 // |type| describes the type of change made to the document. 50 // |type| describes the type of change made to the document.
51 [MinVersion=3] OnDocumentChanged@0(int64 watcher_id, ChangeType type); 51 [MinVersion=3] OnDocumentChanged@0(int64 watcher_id, ChangeType type);
52 }; 52 };
53 53
54 // Next method ID: 8 54 // Next method ID: 9
55 interface FileSystemInstance { 55 interface FileSystemInstance {
56 // Notes about Android Documents Provider: 56 // Notes about Android Documents Provider:
57 // 57 //
58 // In Android Storage Access Framework, a document is uniquely identified by 58 // In Android Storage Access Framework, a document is uniquely identified by
59 // a pair of "authority" and "document ID". 59 // a pair of "authority" and "document ID".
60 // 60 //
61 // - An authority specifies a Documents Provider that serves a document. 61 // - An authority specifies a Documents Provider that serves a document.
62 // It is the origin part of a content:// URI used to access the Documents 62 // It is the origin part of a content:// URI used to access the Documents
63 // Provider via Content Resolver protocol. 63 // Provider via Content Resolver protocol.
64 // Example: "com.android.providers.media.documents" 64 // Example: "com.android.providers.media.documents"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 // Documents Provider. 98 // Documents Provider.
99 // If such a document does not exist, null is returned. 99 // If such a document does not exist, null is returned.
100 [MinVersion=2] GetDocument@3(string authority, string document_id) => 100 [MinVersion=2] GetDocument@3(string authority, string document_id) =>
101 (Document? document); 101 (Document? document);
102 102
103 // Asks the ContentResolver for the size of the file specified by the URL. 103 // Asks the ContentResolver for the size of the file specified by the URL.
104 // If the file does not exist or the size is unknown (e.g. directories and 104 // If the file does not exist or the size is unknown (e.g. directories and
105 // streams), -1 is returned. 105 // streams), -1 is returned.
106 [MinVersion=1] GetFileSize@1(string url) => (int64 size); 106 [MinVersion=1] GetFileSize@1(string url) => (int64 size);
107 107
108 // Asks the ContentResolver to get the MIME type of the file specified by the
109 // URL.
dcheng 2017/06/01 11:06:44 Nit: document what it means if nothing is returned
hashimoto 2017/06/01 11:30:16 Done.
110 [MinVersion=4] GetMimeType@8(string url) => (string? mime_type);
111
108 // Establishes full-duplex communication with the host. 112 // Establishes full-duplex communication with the host.
109 [MinVersion=3] Init@5(FileSystemHost host_ptr); 113 [MinVersion=3] Init@5(FileSystemHost host_ptr);
110 114
111 // Asks the ContentResolver to get a FD to read the file specified by the 115 // Asks the ContentResolver to get a FD to read the file specified by the
112 // URL. 116 // URL.
113 [MinVersion=1] OpenFileToRead@2(string url) => (handle? fd); 117 [MinVersion=1] OpenFileToRead@2(string url) => (handle? fd);
114 118
115 // Uninstalls a document watcher. 119 // Uninstalls a document watcher.
116 // 120 //
117 // After this method call returns, OnDocumentChanged() will never be called 121 // After this method call returns, OnDocumentChanged() will never be called
118 // with the watcher ID. Whether OnDocumentChanged() is called or not after 122 // with the watcher ID. Whether OnDocumentChanged() is called or not after
119 // this method is called and before this method returns is undefined. 123 // this method is called and before this method returns is undefined.
120 // 124 //
121 // It fails if the specified watcher does not exist. 125 // It fails if the specified watcher does not exist.
122 [MinVersion=3] RemoveWatcher@7(int64 watcher_id) => (bool success); 126 [MinVersion=3] RemoveWatcher@7(int64 watcher_id) => (bool success);
123 127
124 // Requests MediaProvider to scan specified files. 128 // Requests MediaProvider to scan specified files.
125 // When the specified file does not exist, the corresponding entry in 129 // When the specified file does not exist, the corresponding entry in
126 // MediaProvider is removed. 130 // MediaProvider is removed.
127 RequestMediaScan@0(array<string> paths); 131 RequestMediaScan@0(array<string> paths);
128 }; 132 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698