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

Unified Diff: webkit/fileapi/cross_operation_delegate.cc

Issue 14225022: fileapi: Pass virtual path to copy validator. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 7 years, 8 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 | « webkit/fileapi/cross_operation_delegate.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/fileapi/cross_operation_delegate.cc
diff --git a/webkit/fileapi/cross_operation_delegate.cc b/webkit/fileapi/cross_operation_delegate.cc
index 3ec57ec05076ea4a6e9f6333c8108d802669ec3e..8de48d56bc389e7e8aa330a754d0d60eeb50d4c3 100644
--- a/webkit/fileapi/cross_operation_delegate.cc
+++ b/webkit/fileapi/cross_operation_delegate.cc
@@ -55,14 +55,14 @@ void CrossOperationDelegate::RunRecursively() {
}
// First try to copy/move it as a file.
- CopyOrMoveFile(src_root_, dest_root_,
+ CopyOrMoveFile(URLPair(src_root_, dest_root_),
base::Bind(&CrossOperationDelegate::DidTryCopyOrMoveFile,
AsWeakPtr()));
}
void CrossOperationDelegate::ProcessFile(const FileSystemURL& src_url,
const StatusCallback& callback) {
- CopyOrMoveFile(src_url, CreateDestURL(src_url), callback);
+ CopyOrMoveFile(URLPair(src_url, CreateDestURL(src_url)), callback);
}
void CrossOperationDelegate::ProcessDirectory(const FileSystemURL& src_url,
@@ -114,16 +114,17 @@ void CrossOperationDelegate::DidTryRemoveDestRoot(
AsWeakPtr(), src_root_, callback_));
}
-void CrossOperationDelegate::CopyOrMoveFile(
- const FileSystemURL& src,
- const FileSystemURL& dest,
- const StatusCallback& callback) {
+void CrossOperationDelegate::CopyOrMoveFile(const URLPair& url_pair,
+ const StatusCallback& callback) {
// Same filesystem case.
if (same_file_system_) {
- if (operation_type_ == OPERATION_MOVE)
- NewSourceOperation()->MoveFileLocal(src, dest, callback);
- else
- NewSourceOperation()->CopyFileLocal(src, dest, callback);
+ if (operation_type_ == OPERATION_MOVE) {
+ NewSourceOperation()->MoveFileLocal(url_pair.src, url_pair.dest,
+ callback);
+ } else {
+ NewSourceOperation()->CopyFileLocal(url_pair.src, url_pair.dest,
+ callback);
+ }
return;
}
@@ -132,14 +133,15 @@ void CrossOperationDelegate::CopyOrMoveFile(
// copy_callback which removes the source file if operation_type == MOVE.
StatusCallback copy_callback =
base::Bind(&CrossOperationDelegate::DidFinishCopy, AsWeakPtr(),
- src, callback);
+ url_pair.src, callback);
NewSourceOperation()->CreateSnapshotFile(
- src, base::Bind(&CrossOperationDelegate::DidCreateSnapshot, AsWeakPtr(),
- dest, copy_callback));
+ url_pair.src,
+ base::Bind(&CrossOperationDelegate::DidCreateSnapshot, AsWeakPtr(),
+ url_pair, copy_callback));
}
void CrossOperationDelegate::DidCreateSnapshot(
- const FileSystemURL& dest,
+ const URLPair& url_pair,
const StatusCallback& callback,
base::PlatformFileError error,
const base::PlatformFileInfo& file_info,
@@ -163,14 +165,15 @@ void CrossOperationDelegate::DidCreateSnapshot(
return;
}
if (!factory) {
- DidValidateFile(dest, callback, file_info, platform_path, error);
+ DidValidateFile(url_pair.dest, callback, file_info, platform_path, error);
return;
}
- validator_.reset(factory->CreateCopyOrMoveFileValidator(platform_path));
+ validator_.reset(
+ factory->CreateCopyOrMoveFileValidator(url_pair.src, platform_path));
validator_->StartValidation(
base::Bind(&CrossOperationDelegate::DidValidateFile, AsWeakPtr(),
- dest, callback, file_info, platform_path));
+ url_pair.dest, callback, file_info, platform_path));
}
void CrossOperationDelegate::DidValidateFile(
« no previous file with comments | « webkit/fileapi/cross_operation_delegate.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698