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

Side by Side Diff: webkit/fileapi/remove_operation_delegate.h

Issue 12051055: 2nd try: FileAPI: Split recursive remove into multiple tasks. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 7 years, 10 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
« no previous file with comments | « webkit/fileapi/obfuscated_file_util.cc ('k') | webkit/fileapi/remove_operation_delegate.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef WEBKIT_FILEAPI_REMOVE_OPERATION_DELEGATE_H_
6 #define WEBKIT_FILEAPI_REMOVE_OPERATION_DELEGATE_H_
7
8 #include <queue>
9 #include <stack>
10
11 #include "base/basictypes.h"
12 #include "base/callback.h"
13 #include "base/memory/weak_ptr.h"
14 #include "webkit/fileapi/file_system_operation.h"
15 #include "webkit/fileapi/file_system_url.h"
16
17 namespace fileapi {
18
19 class FileSystemURL;
20 class LocalFileSystemOperation;
21
22 class RemoveOperationDelegate
23 : public base::SupportsWeakPtr<RemoveOperationDelegate> {
24 public:
25 typedef FileSystemOperation::StatusCallback StatusCallback;
26 typedef FileSystemOperation::FileEntryList FileEntryList;
27
28 RemoveOperationDelegate(LocalFileSystemOperation* original_operation,
29 const StatusCallback& callback);
30 virtual ~RemoveOperationDelegate();
31
32 void Run(const FileSystemURL& url);
33 void RunRecursively(const FileSystemURL& url);
34
35 private:
36 void ProcessNextDirectory(base::PlatformFileError error);
37 void DidTryRemoveFile(
38 const FileSystemURL& url,
39 base::PlatformFileError error);
40 void DidReadDirectory(
41 const FileSystemURL& parent,
42 base::PlatformFileError error,
43 const FileEntryList& entries,
44 bool has_more);
45 void RemoveFile(const FileSystemURL& url);
46 void DidRemoveFile(base::PlatformFileError error);
47 void RemoveNextDirectory(base::PlatformFileError error);
48
49 LocalFileSystemOperation* NewOperation(const FileSystemURL& url);
50
51 LocalFileSystemOperation* original_operation_;
52 StatusCallback callback_;
53
54 std::queue<FileSystemURL> pending_directories_;
55 std::stack<FileSystemURL> to_remove_directories_;
56
57 int inflight_operations_;
58
59 DISALLOW_COPY_AND_ASSIGN(RemoveOperationDelegate);
60 };
61
62 } // namespace fileapi
63
64 #endif // WEBKIT_FILEAPI_REMOVE_OPERATION_DELEGATE_H_
OLDNEW
« no previous file with comments | « webkit/fileapi/obfuscated_file_util.cc ('k') | webkit/fileapi/remove_operation_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698