| 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 WEBKIT_FILEAPI_FILE_SYSTEM_OPERATION_H_ | 5 #ifndef WEBKIT_FILEAPI_FILE_SYSTEM_OPERATION_H_ |
| 6 #define WEBKIT_FILEAPI_FILE_SYSTEM_OPERATION_H_ | 6 #define WEBKIT_FILEAPI_FILE_SYSTEM_OPERATION_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 int64 usage, int64 quota); | 167 int64 usage, int64 quota); |
| 168 | 168 |
| 169 // The 'body' methods that perform the actual work (i.e. posting the | 169 // The 'body' methods that perform the actual work (i.e. posting the |
| 170 // file task on proxy_) after the quota check. | 170 // file task on proxy_) after the quota check. |
| 171 void DoCreateFile(const StatusCallback& callback, bool exclusive); | 171 void DoCreateFile(const StatusCallback& callback, bool exclusive); |
| 172 void DoCreateDirectory(const StatusCallback& callback, | 172 void DoCreateDirectory(const StatusCallback& callback, |
| 173 bool exclusive, | 173 bool exclusive, |
| 174 bool recursive); | 174 bool recursive); |
| 175 void DoCopy(const StatusCallback& callback); | 175 void DoCopy(const StatusCallback& callback); |
| 176 void DoMove(const StatusCallback& callback); | 176 void DoMove(const StatusCallback& callback); |
| 177 void DoWrite(scoped_ptr<net::URLRequest> blob_request); | |
| 178 void DoTruncate(const StatusCallback& callback, int64 length); | 177 void DoTruncate(const StatusCallback& callback, int64 length); |
| 179 void DoOpenFile(const OpenFileCallback& callback, int file_flags); | 178 void DoOpenFile(const OpenFileCallback& callback, int file_flags); |
| 180 | 179 |
| 181 // Callback for CreateFile for |exclusive|=true cases. | 180 // Callback for CreateFile for |exclusive|=true cases. |
| 182 void DidEnsureFileExistsExclusive(const StatusCallback& callback, | 181 void DidEnsureFileExistsExclusive(const StatusCallback& callback, |
| 183 base::PlatformFileError rv, | 182 base::PlatformFileError rv, |
| 184 bool created); | 183 bool created); |
| 185 | 184 |
| 186 // Callback for CreateFile for |exclusive|=false cases. | 185 // Callback for CreateFile for |exclusive|=false cases. |
| 187 void DidEnsureFileExistsNonExclusive(const StatusCallback& callback, | 186 void DidEnsureFileExistsNonExclusive(const StatusCallback& callback, |
| (...skipping 23 matching lines...) Expand all Loading... |
| 211 void DidWrite(base::PlatformFileError rv, | 210 void DidWrite(base::PlatformFileError rv, |
| 212 int64 bytes, | 211 int64 bytes, |
| 213 bool complete); | 212 bool complete); |
| 214 void DidTouchFile(const StatusCallback& callback, | 213 void DidTouchFile(const StatusCallback& callback, |
| 215 base::PlatformFileError rv); | 214 base::PlatformFileError rv); |
| 216 void DidOpenFile(const OpenFileCallback& callback, | 215 void DidOpenFile(const OpenFileCallback& callback, |
| 217 base::PlatformFileError rv, | 216 base::PlatformFileError rv, |
| 218 base::PassPlatformFile file, | 217 base::PassPlatformFile file, |
| 219 bool created); | 218 bool created); |
| 220 | 219 |
| 221 // Helper for Write(). | |
| 222 void OnFileOpenedForWrite(scoped_ptr<net::URLRequest> blob_request, | |
| 223 FileSystemOperationContext* context_unused, | |
| 224 base::PlatformFileError rv, | |
| 225 base::PassPlatformFile file, | |
| 226 bool created); | |
| 227 | |
| 228 // Checks the validity of a given |path_url| and and populates | 220 // Checks the validity of a given |path_url| and and populates |
| 229 // |path| and |file_util| for |mode|. | 221 // |path| and |file_util| for |mode|. |
| 230 base::PlatformFileError SetUpFileSystemPath( | 222 base::PlatformFileError SetUpFileSystemPath( |
| 231 const GURL& path_url, | 223 const GURL& path_url, |
| 232 FileSystemPath* file_system_path, | 224 FileSystemPath* file_system_path, |
| 233 FileSystemFileUtil** file_util, | 225 FileSystemFileUtil** file_util, |
| 234 SetUpPathMode mode); | 226 SetUpPathMode mode); |
| 235 | 227 |
| 236 // Used only for internal assertions. | 228 // Used only for internal assertions. |
| 237 // Returns false if there's another inflight pending operation. | 229 // Returns false if there's another inflight pending operation. |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 // FileSystemOperation instance is usually deleted upon completion but | 265 // FileSystemOperation instance is usually deleted upon completion but |
| 274 // could be deleted while it has inflight callbacks when Cancel is called. | 266 // could be deleted while it has inflight callbacks when Cancel is called. |
| 275 base::WeakPtrFactory<FileSystemOperation> weak_factory_; | 267 base::WeakPtrFactory<FileSystemOperation> weak_factory_; |
| 276 | 268 |
| 277 DISALLOW_COPY_AND_ASSIGN(FileSystemOperation); | 269 DISALLOW_COPY_AND_ASSIGN(FileSystemOperation); |
| 278 }; | 270 }; |
| 279 | 271 |
| 280 } // namespace fileapi | 272 } // namespace fileapi |
| 281 | 273 |
| 282 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_OPERATION_H_ | 274 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_OPERATION_H_ |
| OLD | NEW |