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

Unified Diff: webkit/browser/fileapi/file_system_operation_runner.cc

Issue 23135019: Make SyncableFileSystemOperation not inherit from FileSystemOperationImpl (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 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/browser/fileapi/file_system_operation_runner.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/browser/fileapi/file_system_operation_runner.cc
diff --git a/webkit/browser/fileapi/file_system_operation_runner.cc b/webkit/browser/fileapi/file_system_operation_runner.cc
index 351536b6226dddd505c8e031c670ff8a2c37975a..b899e1b598058191f6af1942e7aaf4ac732727b6 100644
--- a/webkit/browser/fileapi/file_system_operation_runner.cc
+++ b/webkit/browser/fileapi/file_system_operation_runner.cc
@@ -348,14 +348,14 @@ OperationID FileSystemOperationRunner::CopyInForeignFile(
const FileSystemURL& dest_url,
const StatusCallback& callback) {
base::PlatformFileError error = base::PLATFORM_FILE_OK;
- FileSystemOperation* operation = CreateFileSystemOperationImpl(
- dest_url, &error);
+ FileSystemOperation* operation =
+ file_system_context_->CreateFileSystemOperation(dest_url, &error);
if (!operation) {
callback.Run(error);
return kErrorOperationID;
}
OperationID id = operations_.Add(operation);
- operation->AsFileSystemOperationImpl()->CopyInForeignFile(
+ operation->CopyInForeignFile(
src_local_disk_path, dest_url,
base::Bind(&FileSystemOperationRunner::DidFinish, AsWeakPtr(),
id, callback));
@@ -366,13 +366,14 @@ OperationID FileSystemOperationRunner::RemoveFile(
const FileSystemURL& url,
const StatusCallback& callback) {
base::PlatformFileError error = base::PLATFORM_FILE_OK;
- FileSystemOperation* operation = CreateFileSystemOperationImpl(url, &error);
+ FileSystemOperation* operation =
+ file_system_context_->CreateFileSystemOperation(url, &error);
if (!operation) {
callback.Run(error);
return kErrorOperationID;
}
OperationID id = operations_.Add(operation);
- operation->AsFileSystemOperationImpl()->RemoveFile(
+ operation->RemoveFile(
url,
base::Bind(&FileSystemOperationRunner::DidFinish, AsWeakPtr(),
id, callback));
@@ -383,13 +384,14 @@ OperationID FileSystemOperationRunner::RemoveDirectory(
const FileSystemURL& url,
const StatusCallback& callback) {
base::PlatformFileError error = base::PLATFORM_FILE_OK;
- FileSystemOperation* operation = CreateFileSystemOperationImpl(url, &error);
+ FileSystemOperation* operation =
+ file_system_context_->CreateFileSystemOperation(url, &error);
if (!operation) {
callback.Run(error);
return kErrorOperationID;
}
OperationID id = operations_.Add(operation);
- operation->AsFileSystemOperationImpl()->RemoveDirectory(
+ operation->RemoveDirectory(
url,
base::Bind(&FileSystemOperationRunner::DidFinish, AsWeakPtr(),
id, callback));
@@ -401,14 +403,14 @@ OperationID FileSystemOperationRunner::CopyFileLocal(
const FileSystemURL& dest_url,
const StatusCallback& callback) {
base::PlatformFileError error = base::PLATFORM_FILE_OK;
- FileSystemOperation* operation = CreateFileSystemOperationImpl(
- src_url, &error);
+ FileSystemOperation* operation =
+ file_system_context_->CreateFileSystemOperation(src_url, &error);
if (!operation) {
callback.Run(error);
return kErrorOperationID;
}
OperationID id = operations_.Add(operation);
- operation->AsFileSystemOperationImpl()->CopyFileLocal(
+ operation->CopyFileLocal(
src_url, dest_url,
base::Bind(&FileSystemOperationRunner::DidFinish, AsWeakPtr(),
id, callback));
@@ -420,14 +422,14 @@ OperationID FileSystemOperationRunner::MoveFileLocal(
const FileSystemURL& dest_url,
const StatusCallback& callback) {
base::PlatformFileError error = base::PLATFORM_FILE_OK;
- FileSystemOperation* operation = CreateFileSystemOperationImpl(
- src_url, &error);
+ FileSystemOperation* operation =
+ file_system_context_->CreateFileSystemOperation(src_url, &error);
if (!operation) {
callback.Run(error);
return kErrorOperationID;
}
OperationID id = operations_.Add(operation);
- operation->AsFileSystemOperationImpl()->MoveFileLocal(
+ operation->MoveFileLocal(
src_url, dest_url,
base::Bind(&FileSystemOperationRunner::DidFinish, AsWeakPtr(),
id, callback));
@@ -438,12 +440,11 @@ base::PlatformFileError FileSystemOperationRunner::SyncGetPlatformPath(
const FileSystemURL& url,
base::FilePath* platform_path) {
base::PlatformFileError error = base::PLATFORM_FILE_OK;
- FileSystemOperation* operation = CreateFileSystemOperationImpl(url, &error);
+ FileSystemOperation* operation =
+ file_system_context_->CreateFileSystemOperation(url, &error);
if (!operation)
return error;
-
- return operation->AsFileSystemOperationImpl()->SyncGetPlatformPath(
- url, platform_path);
+ return operation->SyncGetPlatformPath(url, platform_path);
}
FileSystemOperationRunner::FileSystemOperationRunner(
@@ -511,21 +512,6 @@ void FileSystemOperationRunner::DidCreateSnapshot(
FinishOperation(id);
}
-FileSystemOperation*
-FileSystemOperationRunner::CreateFileSystemOperationImpl(
- const FileSystemURL& url, base::PlatformFileError* error) {
- FileSystemOperation* operation =
- file_system_context_->CreateFileSystemOperation(url, error);
- if (!operation)
- return NULL;
- if (!operation->AsFileSystemOperationImpl()) {
- *error = base::PLATFORM_FILE_ERROR_INVALID_OPERATION;
- delete operation;
- return NULL;
- }
- return operation;
-}
-
void FileSystemOperationRunner::PrepareForWrite(OperationID id,
const FileSystemURL& url) {
if (file_system_context_->GetUpdateObservers(url.type())) {
« no previous file with comments | « webkit/browser/fileapi/file_system_operation_runner.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698