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

Side by Side Diff: webkit/browser/fileapi/file_system_operation_runner.h

Issue 492873002: Collapse fileapi, webkit_blob, webkit_database, quota, and webkit_common namespaces into single sto… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix chromeos build Created 6 years, 4 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 | Annotate | Revision Log
OLDNEW
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 #ifndef WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_OPERATION_RUNNER_H_ 5 #ifndef WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_OPERATION_RUNNER_H_
6 #define WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_OPERATION_RUNNER_H_ 6 #define WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_OPERATION_RUNNER_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/basictypes.h" 12 #include "base/basictypes.h"
13 #include "base/id_map.h" 13 #include "base/id_map.h"
14 #include "base/memory/scoped_ptr.h" 14 #include "base/memory/scoped_ptr.h"
15 #include "base/memory/weak_ptr.h" 15 #include "base/memory/weak_ptr.h"
16 #include "webkit/browser/blob/blob_data_handle.h" 16 #include "webkit/browser/blob/blob_data_handle.h"
17 #include "webkit/browser/fileapi/file_system_operation.h" 17 #include "webkit/browser/fileapi/file_system_operation.h"
18 #include "webkit/browser/fileapi/file_system_url.h" 18 #include "webkit/browser/fileapi/file_system_url.h"
19 #include "webkit/browser/webkit_storage_browser_export.h" 19 #include "webkit/browser/webkit_storage_browser_export.h"
20 20
21 namespace net { 21 namespace net {
22 class URLRequestContext; 22 class URLRequestContext;
23 } 23 }
24 24
25 namespace fileapi { 25 namespace storage {
26 26
27 class FileSystemURL; 27 class FileSystemURL;
28 class FileSystemContext; 28 class FileSystemContext;
29 29
30 // A central interface for running FileSystem API operations. 30 // A central interface for running FileSystem API operations.
31 // All operation methods take callback and returns OperationID, which is 31 // All operation methods take callback and returns OperationID, which is
32 // an integer value which can be used for cancelling an operation. 32 // an integer value which can be used for cancelling an operation.
33 // All operation methods return kErrorOperationID if running (posting) an 33 // All operation methods return kErrorOperationID if running (posting) an
34 // operation fails, in addition to dispatching the callback with an error 34 // operation fails, in addition to dispatching the callback with an error
35 // code (therefore in most cases the caller does not need to check the 35 // code (therefore in most cases the caller does not need to check the
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 104
105 // Removes a file or directory at |url|. If |recursive| is true, remove 105 // Removes a file or directory at |url|. If |recursive| is true, remove
106 // all files and directories under the directory at |url| recursively. 106 // all files and directories under the directory at |url| recursively.
107 OperationID Remove(const FileSystemURL& url, bool recursive, 107 OperationID Remove(const FileSystemURL& url, bool recursive,
108 const StatusCallback& callback); 108 const StatusCallback& callback);
109 109
110 // Writes contents of |blob_url| to |url| at |offset|. 110 // Writes contents of |blob_url| to |url| at |offset|.
111 // |url_request_context| is used to read contents in |blob|. 111 // |url_request_context| is used to read contents in |blob|.
112 OperationID Write(const net::URLRequestContext* url_request_context, 112 OperationID Write(const net::URLRequestContext* url_request_context,
113 const FileSystemURL& url, 113 const FileSystemURL& url,
114 scoped_ptr<webkit_blob::BlobDataHandle> blob, 114 scoped_ptr<storage::BlobDataHandle> blob,
115 int64 offset, 115 int64 offset,
116 const WriteCallback& callback); 116 const WriteCallback& callback);
117 117
118 // Truncates a file at |url| to |length|. If |length| is larger than 118 // Truncates a file at |url| to |length|. If |length| is larger than
119 // the original file size, the file will be extended, and the extended 119 // the original file size, the file will be extended, and the extended
120 // part is filled with null bytes. 120 // part is filled with null bytes.
121 OperationID Truncate(const FileSystemURL& url, int64 length, 121 OperationID Truncate(const FileSystemURL& url, int64 length,
122 const StatusCallback& callback); 122 const StatusCallback& callback);
123 123
124 // Tries to cancel the operation |id| [we support cancelling write or 124 // Tries to cancel the operation |id| [we support cancelling write or
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 const OperationHandle& handle, 272 const OperationHandle& handle,
273 const OpenFileCallback& callback, 273 const OpenFileCallback& callback,
274 base::File file, 274 base::File file,
275 const base::Closure& on_close_callback); 275 const base::Closure& on_close_callback);
276 void DidCreateSnapshot( 276 void DidCreateSnapshot(
277 const OperationHandle& handle, 277 const OperationHandle& handle,
278 const SnapshotFileCallback& callback, 278 const SnapshotFileCallback& callback,
279 base::File::Error rv, 279 base::File::Error rv,
280 const base::File::Info& file_info, 280 const base::File::Info& file_info,
281 const base::FilePath& platform_path, 281 const base::FilePath& platform_path,
282 const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref); 282 const scoped_refptr<storage::ShareableFileReference>& file_ref);
283 283
284 void OnCopyProgress( 284 void OnCopyProgress(
285 const OperationHandle& handle, 285 const OperationHandle& handle,
286 const CopyProgressCallback& callback, 286 const CopyProgressCallback& callback,
287 FileSystemOperation::CopyProgressType type, 287 FileSystemOperation::CopyProgressType type,
288 const FileSystemURL& source_url, 288 const FileSystemURL& source_url,
289 const FileSystemURL& dest_url, 289 const FileSystemURL& dest_url,
290 int64 size); 290 int64 size);
291 291
292 void PrepareForWrite(OperationID id, const FileSystemURL& url); 292 void PrepareForWrite(OperationID id, const FileSystemURL& url);
(...skipping 17 matching lines...) Expand all
310 310
311 // Operations that are finished but not yet fire their callbacks. 311 // Operations that are finished but not yet fire their callbacks.
312 std::set<OperationID> finished_operations_; 312 std::set<OperationID> finished_operations_;
313 313
314 // Callbacks for stray cancels whose target operation is already finished. 314 // Callbacks for stray cancels whose target operation is already finished.
315 std::map<OperationID, StatusCallback> stray_cancel_callbacks_; 315 std::map<OperationID, StatusCallback> stray_cancel_callbacks_;
316 316
317 DISALLOW_COPY_AND_ASSIGN(FileSystemOperationRunner); 317 DISALLOW_COPY_AND_ASSIGN(FileSystemOperationRunner);
318 }; 318 };
319 319
320 } // namespace fileapi 320 } // namespace storage
321 321
322 #endif // WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_OPERATION_RUNNER_H_ 322 #endif // WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_OPERATION_RUNNER_H_
OLDNEW
« no previous file with comments | « webkit/browser/fileapi/file_system_operation_impl.cc ('k') | webkit/browser/fileapi/file_system_operation_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698