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

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

Issue 12051010: (For-try) Divide recursive Copy/Move into multiple async tasks (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: test fix Created 7 years, 11 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
(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 <stack>
9
10 #include "webkit/fileapi/recursive_operation_delegate.h"
11
12 namespace fileapi {
13
14 class RemoveOperationDelegate
15 : public RecursiveOperationDelegate,
16 public base::SupportsWeakPtr<RemoveOperationDelegate> {
17 public:
18 RemoveOperationDelegate(LocalFileSystemOperation* original_operation,
19 const FileSystemURL& url,
20 const StatusCallback& callback);
21 virtual ~RemoveOperationDelegate();
22
23 // RecursiveOperationDelegate overrides:
24 virtual void Run() OVERRIDE;
25 virtual void RunRecursively() OVERRIDE;
26 virtual void ProcessFile(const FileSystemURL& url,
27 const StatusCallback& callback) OVERRIDE;
28 virtual void ProcessDirectory(const FileSystemURL& url,
29 const StatusCallback& callback) OVERRIDE;
30
31 using base::SupportsWeakPtr<RemoveOperationDelegate>::AsWeakPtr;
32
33 private:
34 void DidTryRemoveFile(base::PlatformFileError error);
35 void DidRemoveFile(const StatusCallback& callback,
36 base::PlatformFileError error);
37 void RemoveNextDirectory(base::PlatformFileError error);
38
39 FileSystemURL url_;
40 StatusCallback callback_;
41
42 std::stack<FileSystemURL> to_remove_directories_;
43
44 DISALLOW_COPY_AND_ASSIGN(RemoveOperationDelegate);
45 };
46
47 } // namespace fileapi
48
49 #endif // WEBKIT_FILEAPI_REMOVE_OPERATION_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698