| Index: webkit/fileapi/file_system_operation.cc
|
| ===================================================================
|
| --- webkit/fileapi/file_system_operation.cc (revision 72915)
|
| +++ webkit/fileapi/file_system_operation.cc (working copy)
|
| @@ -4,6 +4,7 @@
|
|
|
| #include "webkit/fileapi/file_system_operation.h"
|
|
|
| +#include "base/file_util_proxy.h"
|
| #include "base/time.h"
|
| #include "net/url_request/url_request_context.h"
|
| #include "webkit/fileapi/file_system_callback_dispatcher.h"
|
| @@ -25,7 +26,8 @@
|
|
|
| FileSystemOperation::~FileSystemOperation() {
|
| if (file_writer_delegate_.get())
|
| - base::FileUtilProxy::Close(proxy_, file_writer_delegate_->file(), NULL);
|
| + file_util_proxy()->Close(
|
| + proxy_, file_writer_delegate_->file(), NULL);
|
| }
|
|
|
| void FileSystemOperation::CreateFile(const FilePath& path,
|
| @@ -35,7 +37,7 @@
|
| pending_operation_ = kOperationCreateFile;
|
| #endif
|
|
|
| - base::FileUtilProxy::EnsureFileExists(
|
| + file_util_proxy()->EnsureFileExists(
|
| proxy_, path, callback_factory_.NewCallback(
|
| exclusive ? &FileSystemOperation::DidEnsureFileExistsExclusive
|
| : &FileSystemOperation::DidEnsureFileExistsNonExclusive));
|
| @@ -49,7 +51,7 @@
|
| pending_operation_ = kOperationCreateDirectory;
|
| #endif
|
|
|
| - base::FileUtilProxy::CreateDirectory(
|
| + file_util_proxy()->CreateDirectory(
|
| proxy_, path, exclusive, recursive, callback_factory_.NewCallback(
|
| &FileSystemOperation::DidFinishFileOperation));
|
| }
|
| @@ -61,8 +63,8 @@
|
| pending_operation_ = kOperationCopy;
|
| #endif
|
|
|
| - base::FileUtilProxy::Copy(proxy_, src_path, dest_path,
|
| - callback_factory_.NewCallback(
|
| + file_util_proxy()->Copy(
|
| + proxy_, src_path, dest_path, callback_factory_.NewCallback(
|
| &FileSystemOperation::DidFinishFileOperation));
|
| }
|
|
|
| @@ -73,8 +75,8 @@
|
| pending_operation_ = kOperationMove;
|
| #endif
|
|
|
| - base::FileUtilProxy::Move(proxy_, src_path, dest_path,
|
| - callback_factory_.NewCallback(
|
| + file_util_proxy()->Move(
|
| + proxy_, src_path, dest_path, callback_factory_.NewCallback(
|
| &FileSystemOperation::DidFinishFileOperation));
|
| }
|
|
|
| @@ -84,8 +86,9 @@
|
| pending_operation_ = kOperationDirectoryExists;
|
| #endif
|
|
|
| - base::FileUtilProxy::GetFileInfo(proxy_, path, callback_factory_.NewCallback(
|
| - &FileSystemOperation::DidDirectoryExists));
|
| + file_util_proxy()->GetFileInfo(
|
| + proxy_, path, callback_factory_.NewCallback(
|
| + &FileSystemOperation::DidDirectoryExists));
|
| }
|
|
|
| void FileSystemOperation::FileExists(const FilePath& path) {
|
| @@ -94,8 +97,9 @@
|
| pending_operation_ = kOperationFileExists;
|
| #endif
|
|
|
| - base::FileUtilProxy::GetFileInfo(proxy_, path, callback_factory_.NewCallback(
|
| - &FileSystemOperation::DidFileExists));
|
| + file_util_proxy()->GetFileInfo(
|
| + proxy_, path, callback_factory_.NewCallback(
|
| + &FileSystemOperation::DidFileExists));
|
| }
|
|
|
| void FileSystemOperation::GetMetadata(const FilePath& path) {
|
| @@ -104,8 +108,9 @@
|
| pending_operation_ = kOperationGetMetadata;
|
| #endif
|
|
|
| - base::FileUtilProxy::GetFileInfo(proxy_, path, callback_factory_.NewCallback(
|
| - &FileSystemOperation::DidGetMetadata));
|
| + file_util_proxy()->GetFileInfo(
|
| + proxy_, path, callback_factory_.NewCallback(
|
| + &FileSystemOperation::DidGetMetadata));
|
| }
|
|
|
| void FileSystemOperation::ReadDirectory(const FilePath& path) {
|
| @@ -114,8 +119,8 @@
|
| pending_operation_ = kOperationReadDirectory;
|
| #endif
|
|
|
| - base::FileUtilProxy::ReadDirectory(proxy_, path,
|
| - callback_factory_.NewCallback(
|
| + file_util_proxy()->ReadDirectory(
|
| + proxy_, path, callback_factory_.NewCallback(
|
| &FileSystemOperation::DidReadDirectory));
|
| }
|
|
|
| @@ -125,8 +130,8 @@
|
| pending_operation_ = kOperationRemove;
|
| #endif
|
|
|
| - base::FileUtilProxy::Delete(proxy_, path, recursive,
|
| - callback_factory_.NewCallback(
|
| + file_util_proxy()->Delete(
|
| + proxy_, path, recursive, callback_factory_.NewCallback(
|
| &FileSystemOperation::DidFinishFileOperation));
|
| }
|
|
|
| @@ -144,7 +149,7 @@
|
| blob_request_.reset(
|
| new net::URLRequest(blob_url, file_writer_delegate_.get()));
|
| blob_request_->set_context(url_request_context);
|
| - base::FileUtilProxy::CreateOrOpen(
|
| + file_util_proxy()->CreateOrOpen(
|
| proxy_,
|
| path,
|
| base::PLATFORM_FILE_OPEN | base::PLATFORM_FILE_WRITE |
|
| @@ -170,8 +175,8 @@
|
| DCHECK(kOperationNone == pending_operation_);
|
| pending_operation_ = kOperationTruncate;
|
| #endif
|
| - base::FileUtilProxy::Truncate(proxy_, path, length,
|
| - callback_factory_.NewCallback(
|
| + file_util_proxy()->Truncate(
|
| + proxy_, path, length, callback_factory_.NewCallback(
|
| &FileSystemOperation::DidFinishFileOperation));
|
| }
|
|
|
| @@ -183,7 +188,7 @@
|
| pending_operation_ = kOperationTouchFile;
|
| #endif
|
|
|
| - base::FileUtilProxy::Touch(
|
| + file_util_proxy()->Touch(
|
| proxy_, path, last_access_time, last_modified_time,
|
| callback_factory_.NewCallback(&FileSystemOperation::DidTouchFile));
|
| }
|
| @@ -221,6 +226,10 @@
|
| }
|
| }
|
|
|
| +base::FileUtilProxyBase* FileSystemOperation::file_util_proxy() const {
|
| + return base::FileUtilProxy::GetInstance();
|
| +}
|
| +
|
| void FileSystemOperation::DidEnsureFileExistsExclusive(
|
| base::PlatformFileError rv, bool created) {
|
| if (rv == base::PLATFORM_FILE_OK && !created) {
|
| @@ -292,7 +301,7 @@
|
|
|
| void FileSystemOperation::DidReadDirectory(
|
| base::PlatformFileError rv,
|
| - const std::vector<base::FileUtilProxy::Entry>& entries) {
|
| + const std::vector<base::FileUtilProxyBase::Entry>& entries) {
|
| if (rv == base::PLATFORM_FILE_OK)
|
| dispatcher_->DidReadDirectory(entries, false /* has_more */);
|
| else
|
|
|