OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_GDATA_GDATA_FILE_SYSTEM_INTERFACE_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_INTERFACE_H_ |
6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_INTERFACE_H_ | 6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_INTERFACE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
171 virtual void OpenFile(const FilePath& file_path, | 171 virtual void OpenFile(const FilePath& file_path, |
172 const OpenFileCallback& callback) = 0; | 172 const OpenFileCallback& callback) = 0; |
173 | 173 |
174 // Closes a file at the virtual path |file_path| on the gdata file system, | 174 // Closes a file at the virtual path |file_path| on the gdata file system, |
175 // which is opened via OpenFile(). It commits the dirty flag on the cache. | 175 // which is opened via OpenFile(). It commits the dirty flag on the cache. |
176 // | 176 // |
177 // Can be called from UI/IO thread. |callback| is run on the calling thread. | 177 // Can be called from UI/IO thread. |callback| is run on the calling thread. |
178 virtual void CloseFile(const FilePath& file_path, | 178 virtual void CloseFile(const FilePath& file_path, |
179 const FileOperationCallback& callback) = 0; | 179 const FileOperationCallback& callback) = 0; |
180 | 180 |
181 // Calls OpenFile, |callback|, then CloseFile in this order. | |
182 // | |
183 // Can be called from UI/IO thread. |callback| is run on th blocking thread | |
184 // pool that allows file operations. | |
185 virtual void PrepareWritableFileAndRun(const FilePath& path, | |
186 const OpenFileCallback& callback) = 0; | |
satorux1
2012/07/27 22:56:29
We want to minimize functions in GDataFileSystem.
kinaba
2012/07/28 00:06:10
I'll think about it. Do you have any advice where
satorux1
2012/07/28 00:44:07
I guess we can move this to gdata_util.cc. For Clo
kinaba
2012/08/01 13:48:45
Created a separate class (suggestions are highly w
| |
187 | |
181 // Copies |src_file_path| to |dest_file_path| on the file system. | 188 // Copies |src_file_path| to |dest_file_path| on the file system. |
182 // |src_file_path| can be a hosted document (see limitations below). | 189 // |src_file_path| can be a hosted document (see limitations below). |
183 // |dest_file_path| is expected to be of the same type of |src_file_path| | 190 // |dest_file_path| is expected to be of the same type of |src_file_path| |
184 // (i.e. if |src_file_path| is a file, |dest_file_path| will be created as | 191 // (i.e. if |src_file_path| is a file, |dest_file_path| will be created as |
185 // a file). | 192 // a file). |
186 // | 193 // |
187 // This method also has the following assumptions/limitations that may be | 194 // This method also has the following assumptions/limitations that may be |
188 // relaxed or addressed later: | 195 // relaxed or addressed later: |
189 // - |src_file_path| cannot be a regular file (i.e. non-hosted document) | 196 // - |src_file_path| cannot be a regular file (i.e. non-hosted document) |
190 // or a directory. | 197 // or a directory. |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
345 const FilePath& virtual_dir_path, | 352 const FilePath& virtual_dir_path, |
346 scoped_ptr<DocumentEntry> entry, | 353 scoped_ptr<DocumentEntry> entry, |
347 const FilePath& file_content_path, | 354 const FilePath& file_content_path, |
348 GDataCache::FileOperationType cache_operation, | 355 GDataCache::FileOperationType cache_operation, |
349 const base::Closure& callback) = 0; | 356 const base::Closure& callback) = 0; |
350 }; | 357 }; |
351 | 358 |
352 } // namespace gdata | 359 } // namespace gdata |
353 | 360 |
354 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_INTERFACE_H_ | 361 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_INTERFACE_H_ |
OLD | NEW |