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.
5 #ifndef WEBKIT_FILEAPI_REMOVE_OPERATION_DELEGATE_H_
6 #define WEBKIT_FILEAPI_REMOVE_OPERATION_DELEGATE_H_
10 #include "webkit/fileapi/recursive_operation_delegate.h"
14 class RemoveOperationDelegate
15 : public RecursiveOperationDelegate
,
16 public base::SupportsWeakPtr
<RemoveOperationDelegate
> {
18 RemoveOperationDelegate(FileSystemContext
* file_system_context
,
19 LocalFileSystemOperation
* operation
,
20 const FileSystemURL
& url
,
21 const StatusCallback
& callback
);
22 virtual ~RemoveOperationDelegate();
24 // RecursiveOperationDelegate overrides:
25 virtual void Run() OVERRIDE
;
26 virtual void RunRecursively() OVERRIDE
;
27 virtual void ProcessFile(const FileSystemURL
& url
,
28 const StatusCallback
& callback
) OVERRIDE
;
29 virtual void ProcessDirectory(const FileSystemURL
& url
,
30 const StatusCallback
& callback
) OVERRIDE
;
32 using base::SupportsWeakPtr
<RemoveOperationDelegate
>::AsWeakPtr
;
35 void DidTryRemoveFile(base::PlatformFileError error
);
36 void DidRemoveFile(const StatusCallback
& callback
,
37 base::PlatformFileError error
);
38 void RemoveNextDirectory(base::PlatformFileError error
);
41 StatusCallback callback_
;
43 std::stack
<FileSystemURL
> to_remove_directories_
;
45 DISALLOW_COPY_AND_ASSIGN(RemoveOperationDelegate
);
48 } // namespace fileapi
50 #endif // WEBKIT_FILEAPI_REMOVE_OPERATION_DELEGATE_H_