OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_PROVIDED_FILE_SYSTEM_INTERF ACE_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_PROVIDED_FILE_SYSTEM_INTERF ACE_H_ |
6 #define CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_PROVIDED_FILE_SYSTEM_INTERF ACE_H_ | 6 #define CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_PROVIDED_FILE_SYSTEM_INTERF ACE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
151 const base::FilePath& directory_path, | 151 const base::FilePath& directory_path, |
152 const storage::AsyncFileUtil::ReadDirectoryCallback& callback) = 0; | 152 const storage::AsyncFileUtil::ReadDirectoryCallback& callback) = 0; |
153 | 153 |
154 // Requests opening a file at |file_path|. If the file doesn't exist, then the | 154 // Requests opening a file at |file_path|. If the file doesn't exist, then the |
155 // operation will fail. In case of any error, the returned file handle is 0. | 155 // operation will fail. In case of any error, the returned file handle is 0. |
156 virtual AbortCallback OpenFile(const base::FilePath& file_path, | 156 virtual AbortCallback OpenFile(const base::FilePath& file_path, |
157 OpenFileMode mode, | 157 OpenFileMode mode, |
158 const OpenFileCallback& callback) = 0; | 158 const OpenFileCallback& callback) = 0; |
159 | 159 |
160 // Requests closing a file, previously opened with OpenFile() as a file with | 160 // Requests closing a file, previously opened with OpenFile() as a file with |
161 // |file_handle|. For either succes or error |callback| must be called. | 161 // |file_handle|. |callback| must be called. |
dschuyler
2017/05/04 22:43:51
nit: Starting on a |var| is unsightly :), Maybe:
T
Lei Zhang
2017/05/17 21:14:38
Done.
| |
162 virtual AbortCallback CloseFile( | 162 virtual AbortCallback CloseFile( |
163 int file_handle, | 163 int file_handle, |
164 const storage::AsyncFileUtil::StatusCallback& callback) = 0; | 164 const storage::AsyncFileUtil::StatusCallback& callback) = 0; |
165 | 165 |
166 // Requests reading a file previously opened with |file_handle|. The callback | 166 // Requests reading a file previously opened with |file_handle|. The callback |
167 // can be called multiple times until |has_more| is set to false. On success | 167 // can be called multiple times until |has_more| is set to false. On success |
168 // it should return |length| bytes starting from |offset| in total. It can | 168 // it should return |length| bytes starting from |offset| in total. It can |
169 // return less only in case EOF is encountered. | 169 // return less only in case EOF is encountered. |
170 virtual AbortCallback ReadFile(int file_handle, | 170 virtual AbortCallback ReadFile(int file_handle, |
171 net::IOBuffer* buffer, | 171 net::IOBuffer* buffer, |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
280 virtual void RemoveObserver(ProvidedFileSystemObserver* observer) = 0; | 280 virtual void RemoveObserver(ProvidedFileSystemObserver* observer) = 0; |
281 | 281 |
282 // Returns a weak pointer to this object. | 282 // Returns a weak pointer to this object. |
283 virtual base::WeakPtr<ProvidedFileSystemInterface> GetWeakPtr() = 0; | 283 virtual base::WeakPtr<ProvidedFileSystemInterface> GetWeakPtr() = 0; |
284 }; | 284 }; |
285 | 285 |
286 } // namespace file_system_provider | 286 } // namespace file_system_provider |
287 } // namespace chromeos | 287 } // namespace chromeos |
288 | 288 |
289 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_PROVIDED_FILE_SYSTEM_INT ERFACE_H_ | 289 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_PROVIDED_FILE_SYSTEM_INT ERFACE_H_ |
OLD | NEW |