| OLD | NEW |
| (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_ |
| OLD | NEW |