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

Unified Diff: webkit/browser/fileapi/copy_or_move_operation_delegate.h

Issue 23621026: Extract CopyOrMoveFile operation into classes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webkit/browser/fileapi/copy_or_move_operation_delegate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/browser/fileapi/copy_or_move_operation_delegate.h
diff --git a/webkit/browser/fileapi/copy_or_move_operation_delegate.h b/webkit/browser/fileapi/copy_or_move_operation_delegate.h
index ceceb97136742320ce83aa57088a8e1b905c4f9b..5f629ca64d695c6c1951261ed1955d90840c5a6c 100644
--- a/webkit/browser/fileapi/copy_or_move_operation_delegate.h
+++ b/webkit/browser/fileapi/copy_or_move_operation_delegate.h
@@ -23,6 +23,8 @@ class CopyOrMoveFileValidator;
class CopyOrMoveOperationDelegate
: public RecursiveOperationDelegate {
public:
+ class CopyOrMoveImpl;
+
enum OperationType {
OPERATION_COPY,
OPERATION_MOVE
@@ -45,60 +47,23 @@ class CopyOrMoveOperationDelegate
const StatusCallback& callback) OVERRIDE;
private:
- struct URLPair {
- URLPair(const FileSystemURL& src, const FileSystemURL& dest)
- : src(src),
- dest(dest) {
- }
- FileSystemURL src;
- FileSystemURL dest;
- };
-
void DidTryCopyOrMoveFile(base::PlatformFileError error);
void DidTryRemoveDestRoot(base::PlatformFileError error);
- void CopyOrMoveFile(
- const URLPair& url_pair,
- const StatusCallback& callback);
- void DidCreateSnapshot(
- const URLPair& url_pair,
- const StatusCallback& callback,
- base::PlatformFileError error,
- const base::PlatformFileInfo& file_info,
- const base::FilePath& platform_path,
- const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref);
- void DidValidateFile(
- const FileSystemURL& dest,
- const StatusCallback& callback,
- const base::PlatformFileInfo& file_info,
- const base::FilePath& platform_path,
- base::PlatformFileError error);
- void DidFinishRecursiveCopyDir(
- const FileSystemURL& src,
- const StatusCallback& callback,
- base::PlatformFileError error);
- void DidFinishCopy(
- const URLPair& url_pair,
- const StatusCallback& callback,
- base::PlatformFileError error);
- void DoPostWriteValidation(
- const URLPair& url_pair,
- const StatusCallback& callback,
- base::PlatformFileError error,
- const base::PlatformFileInfo& file_info,
- const base::FilePath& platform_path,
- const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref);
- void DidPostWriteValidation(
- const URLPair& url_pair,
- const StatusCallback& callback,
- const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref,
- base::PlatformFileError error);
- void DidRemoveSourceForMove(
- const StatusCallback& callback,
- base::PlatformFileError error);
- void DidRemoveDestForError(
- base::PlatformFileError prior_error,
- const StatusCallback& callback,
- base::PlatformFileError error);
+ void DidFinishRecursiveCopyDir(const FileSystemURL& src,
+ const StatusCallback& callback,
+ base::PlatformFileError error);
+ void DidRemoveSourceForMove(const StatusCallback& callback,
+ base::PlatformFileError error);
+
+ // Starts Copy (or Move based on |operation_type_|) from |src_url| to
+ // |dest_url|. Upon completion |callback| is invoked.
+ // This can be run for multiple files in parallel.
+ void CopyOrMoveFile(const FileSystemURL& src_url,
+ const FileSystemURL& dest_url,
+ const StatusCallback& callback);
+ void DidCopyOrMoveFile(CopyOrMoveImpl* impl,
+ const StatusCallback& callback,
+ base::PlatformFileError error);
FileSystemURL CreateDestURL(const FileSystemURL& src_url) const;
@@ -108,10 +73,7 @@ class CopyOrMoveOperationDelegate
OperationType operation_type_;
StatusCallback callback_;
- scoped_refptr<webkit_blob::ShareableFileReference> current_file_ref_;
-
- scoped_ptr<CopyOrMoveFileValidator> validator_;
-
+ std::set<CopyOrMoveImpl*> running_copy_set_;
base::WeakPtrFactory<CopyOrMoveOperationDelegate> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(CopyOrMoveOperationDelegate);
« no previous file with comments | « no previous file | webkit/browser/fileapi/copy_or_move_operation_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698