| 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())) {
|
|
|