| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 // This file provides the core implementation of fileapi methods. | 5 // This file provides the core implementation of fileapi methods. |
| 6 // The functions should be called on UI thread. | 6 // The functions should be called on UI thread. |
| 7 // Note that most method invocation of fileapi is done on IO thread. The gap is | 7 // Note that most method invocation of fileapi is done on IO thread. The gap is |
| 8 // filled by FileSystemProxy. | 8 // filled by FileSystemProxy. |
| 9 // Also, the order of arguments for the functions which take FileSystemInterface | 9 // Also, the order of arguments for the functions which take FileSystemInterface |
| 10 // at the last is intentional. The instance of FileSystemInterface should be | 10 // at the last is intentional. The instance of FileSystemInterface should be |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 | 38 |
| 39 namespace drive { | 39 namespace drive { |
| 40 | 40 |
| 41 class FileSystemInterface; | 41 class FileSystemInterface; |
| 42 | 42 |
| 43 namespace fileapi_internal { | 43 namespace fileapi_internal { |
| 44 | 44 |
| 45 typedef base::Callback<FileSystemInterface*()> FileSystemGetter; | 45 typedef base::Callback<FileSystemInterface*()> FileSystemGetter; |
| 46 | 46 |
| 47 typedef base::Callback< | 47 typedef base::Callback< |
| 48 void(base::PlatformFileError result)> StatusCallback; | 48 void(base::File::Error result)> StatusCallback; |
| 49 typedef base::Callback< | 49 typedef base::Callback< |
| 50 void(base::PlatformFileError result, | 50 void(base::File::Error result, |
| 51 const base::PlatformFileInfo& file_info)> GetFileInfoCallback; | 51 const base::File::Info& file_info)> GetFileInfoCallback; |
| 52 typedef base::Callback< | 52 typedef base::Callback< |
| 53 void(base::PlatformFileError result, | 53 void(base::File::Error result, |
| 54 const std::vector<fileapi::DirectoryEntry>& file_list, | 54 const std::vector<fileapi::DirectoryEntry>& file_list, |
| 55 bool has_more)> ReadDirectoryCallback; | 55 bool has_more)> ReadDirectoryCallback; |
| 56 typedef base::Callback< | 56 typedef base::Callback< |
| 57 void(base::PlatformFileError result, | 57 void(base::File::Error result, |
| 58 const base::PlatformFileInfo& file_info, | 58 const base::File::Info& file_info, |
| 59 const base::FilePath& snapshot_file_path, | 59 const base::FilePath& snapshot_file_path, |
| 60 webkit_blob::ScopedFile::ScopeOutPolicy scope_out_policy)> | 60 webkit_blob::ScopedFile::ScopeOutPolicy scope_out_policy)> |
| 61 CreateSnapshotFileCallback; | 61 CreateSnapshotFileCallback; |
| 62 typedef base::Callback< | 62 typedef base::Callback< |
| 63 void(base::PlatformFileError result, | 63 void(base::File::Error result, |
| 64 const base::FilePath& snapshot_file_path, | 64 const base::FilePath& snapshot_file_path, |
| 65 const base::Closure& close_callback)> | 65 const base::Closure& close_callback)> |
| 66 CreateWritableSnapshotFileCallback; | 66 CreateWritableSnapshotFileCallback; |
| 67 typedef base::Callback< | 67 typedef base::Callback< |
| 68 void(base::PlatformFileError result, | 68 void(base::File::Error result, |
| 69 base::PlatformFile platform_file, | 69 base::PlatformFile platform_file, |
| 70 const base::Closure& close_callback)> OpenFileCallback; | 70 const base::Closure& close_callback)> OpenFileCallback; |
| 71 | 71 |
| 72 // Runs |file_system_getter| to obtain the instance of FileSystemInstance, | 72 // Runs |file_system_getter| to obtain the instance of FileSystemInstance, |
| 73 // and then runs |callback| with it. | 73 // and then runs |callback| with it. |
| 74 // If |file_system_getter| returns NULL, runs |error_callback| instead. | 74 // If |file_system_getter| returns NULL, runs |error_callback| instead. |
| 75 // This function must be called on UI thread. | 75 // This function must be called on UI thread. |
| 76 // |file_system_getter| and |callback| must not be null, but | 76 // |file_system_getter| and |callback| must not be null, but |
| 77 // |error_callback| can be null (if no operation is necessary for error | 77 // |error_callback| can be null (if no operation is necessary for error |
| 78 // case). | 78 // case). |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 void TouchFile(const base::FilePath& file_path, | 170 void TouchFile(const base::FilePath& file_path, |
| 171 const base::Time& last_access_time, | 171 const base::Time& last_access_time, |
| 172 const base::Time& last_modified_time, | 172 const base::Time& last_modified_time, |
| 173 const StatusCallback& callback, | 173 const StatusCallback& callback, |
| 174 FileSystemInterface* file_system); | 174 FileSystemInterface* file_system); |
| 175 | 175 |
| 176 } // namespace fileapi_internal | 176 } // namespace fileapi_internal |
| 177 } // namespace drive | 177 } // namespace drive |
| 178 | 178 |
| 179 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILEAPI_WORKER_H_ | 179 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILEAPI_WORKER_H_ |
| OLD | NEW |