OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 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 | 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_FILEAPI_CROSS_OPERATION_DELEGATE_H_ | 5 #ifndef WEBKIT_FILEAPI_CROSS_OPERATION_DELEGATE_H_ |
6 #define WEBKIT_FILEAPI_CROSS_OPERATION_DELEGATE_H_ | 6 #define WEBKIT_FILEAPI_CROSS_OPERATION_DELEGATE_H_ |
7 | 7 |
8 #include <stack> | 8 #include <stack> |
9 | 9 |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 virtual void Run() OVERRIDE; | 43 virtual void Run() OVERRIDE; |
44 virtual void RunRecursively() OVERRIDE; | 44 virtual void RunRecursively() OVERRIDE; |
45 virtual void ProcessFile(const FileSystemURL& url, | 45 virtual void ProcessFile(const FileSystemURL& url, |
46 const StatusCallback& callback) OVERRIDE; | 46 const StatusCallback& callback) OVERRIDE; |
47 virtual void ProcessDirectory(const FileSystemURL& url, | 47 virtual void ProcessDirectory(const FileSystemURL& url, |
48 const StatusCallback& callback) OVERRIDE; | 48 const StatusCallback& callback) OVERRIDE; |
49 | 49 |
50 using base::SupportsWeakPtr<CrossOperationDelegate>::AsWeakPtr; | 50 using base::SupportsWeakPtr<CrossOperationDelegate>::AsWeakPtr; |
51 | 51 |
52 private: | 52 private: |
| 53 struct URLPair { |
| 54 URLPair(const FileSystemURL& src, const FileSystemURL& dest) |
| 55 : src(src), |
| 56 dest(dest) { |
| 57 } |
| 58 FileSystemURL src; |
| 59 FileSystemURL dest; |
| 60 }; |
| 61 |
53 void DidTryCopyOrMoveFile(base::PlatformFileError error); | 62 void DidTryCopyOrMoveFile(base::PlatformFileError error); |
54 void DidTryRemoveDestRoot(base::PlatformFileError error); | 63 void DidTryRemoveDestRoot(base::PlatformFileError error); |
55 void CopyOrMoveFile( | 64 void CopyOrMoveFile( |
56 const FileSystemURL& src, | 65 const URLPair& url_pair, |
57 const FileSystemURL& dest, | |
58 const StatusCallback& callback); | 66 const StatusCallback& callback); |
59 void DidCreateSnapshot( | 67 void DidCreateSnapshot( |
60 const FileSystemURL& dest, | 68 const URLPair& url_pair, |
61 const StatusCallback& callback, | 69 const StatusCallback& callback, |
62 base::PlatformFileError error, | 70 base::PlatformFileError error, |
63 const base::PlatformFileInfo& file_info, | 71 const base::PlatformFileInfo& file_info, |
64 const base::FilePath& platform_path, | 72 const base::FilePath& platform_path, |
65 const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref); | 73 const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref); |
66 void DidValidateFile( | 74 void DidValidateFile( |
67 const FileSystemURL& dest, | 75 const FileSystemURL& dest, |
68 const StatusCallback& callback, | 76 const StatusCallback& callback, |
69 const base::PlatformFileInfo& file_info, | 77 const base::PlatformFileInfo& file_info, |
70 const base::FilePath& platform_path, | 78 const base::FilePath& platform_path, |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 scoped_refptr<webkit_blob::ShareableFileReference> current_file_ref_; | 114 scoped_refptr<webkit_blob::ShareableFileReference> current_file_ref_; |
107 | 115 |
108 scoped_ptr<CopyOrMoveFileValidator> validator_; | 116 scoped_ptr<CopyOrMoveFileValidator> validator_; |
109 | 117 |
110 DISALLOW_COPY_AND_ASSIGN(CrossOperationDelegate); | 118 DISALLOW_COPY_AND_ASSIGN(CrossOperationDelegate); |
111 }; | 119 }; |
112 | 120 |
113 } // namespace fileapi | 121 } // namespace fileapi |
114 | 122 |
115 #endif // WEBKIT_FILEAPI_CROSS_OPERATION_DELEGATE_H_ | 123 #endif // WEBKIT_FILEAPI_CROSS_OPERATION_DELEGATE_H_ |
OLD | NEW |