Chromium Code Reviews| Index: webkit/fileapi/file_system_operation.cc |
| diff --git a/webkit/fileapi/file_system_operation.cc b/webkit/fileapi/file_system_operation.cc |
| index b01f4d5cac3446cff4d09a4ec141c44b7a307733..7fdf798170d8ee8f5cae7b8ba8e3b0c44a7a27c9 100644 |
| --- a/webkit/fileapi/file_system_operation.cc |
| +++ b/webkit/fileapi/file_system_operation.cc |
| @@ -8,6 +8,8 @@ |
| #include "net/url_request/url_request_context.h" |
| #include "webkit/fileapi/file_system_callback_dispatcher.h" |
| #include "webkit/fileapi/file_system_context.h" |
| +#include "webkit/fileapi/file_system_file_util_proxy.h" |
| +#include "webkit/fileapi/file_system_operation_context.h" |
| #include "webkit/fileapi/file_system_path_manager.h" |
| #include "webkit/fileapi/file_system_quota_manager.h" |
| #include "webkit/fileapi/file_writer_delegate.h" |
| @@ -21,6 +23,8 @@ FileSystemOperation::FileSystemOperation( |
| : proxy_(proxy), |
| dispatcher_(dispatcher), |
| file_system_context_(file_system_context), |
| + file_system_operation_context_(new FileSystemOperationContext( |
| + FileSystemFileUtil::GetInstance())), |
| callback_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { |
| DCHECK(dispatcher); |
| #ifndef NDEBUG |
| @@ -30,7 +34,9 @@ FileSystemOperation::FileSystemOperation( |
| FileSystemOperation::~FileSystemOperation() { |
| if (file_writer_delegate_.get()) |
| - base::FileUtilProxy::Close(proxy_, file_writer_delegate_->file(), NULL); |
| + FileSystemFileUtilProxy::Close( |
| + file_system_operation_context_.get(), |
| + proxy_, file_writer_delegate_->file(), NULL); |
| } |
| void FileSystemOperation::OpenFileSystem( |
| @@ -58,15 +64,16 @@ void FileSystemOperation::CreateFile(const FilePath& path, |
| delete this; |
| return; |
| } |
| - base::FileUtilProxy::EnsureFileExists( |
| - proxy_, path, callback_factory_.NewCallback( |
| - exclusive ? &FileSystemOperation::DidEnsureFileExistsExclusive |
| - : &FileSystemOperation::DidEnsureFileExistsNonExclusive)); |
| + FileSystemFileUtilProxy::EnsureFileExists( |
| + file_system_operation_context_.get(), |
| + proxy_, path, callback_factory_.NewCallback( |
| + exclusive ? &FileSystemOperation::DidEnsureFileExistsExclusive |
| + : &FileSystemOperation::DidEnsureFileExistsNonExclusive)); |
| } |
| void FileSystemOperation::CreateDirectory(const FilePath& path, |
| bool exclusive, |
| - bool recursive) { |
| + bool unused) { |
|
kinuko
2011/03/03 21:29:22
The parameter still exists in the caller side.
If
Dai Mikurube (google.com)
2011/03/03 22:19:10
Added DCHECK(!unused). Verified it passed in unit
|
| #ifndef NDEBUG |
| DCHECK(kOperationNone == pending_operation_); |
| pending_operation_ = kOperationCreateDirectory; |
| @@ -76,8 +83,9 @@ void FileSystemOperation::CreateDirectory(const FilePath& path, |
| delete this; |
| return; |
| } |
| - base::FileUtilProxy::CreateDirectory( |
| - proxy_, path, exclusive, recursive, callback_factory_.NewCallback( |
| + FileSystemFileUtilProxy::CreateDirectory( |
| + file_system_operation_context_.get(), |
| + proxy_, path, exclusive, callback_factory_.NewCallback( |
| &FileSystemOperation::DidFinishFileOperation)); |
| } |
| @@ -94,8 +102,9 @@ void FileSystemOperation::Copy(const FilePath& src_path, |
| delete this; |
| return; |
| } |
| - base::FileUtilProxy::Copy(proxy_, src_path, dest_path, |
| - callback_factory_.NewCallback( |
| + FileSystemFileUtilProxy::Copy( |
| + file_system_operation_context_.get(), |
| + proxy_, src_path, dest_path, callback_factory_.NewCallback( |
| &FileSystemOperation::DidFinishFileOperation)); |
| } |
| @@ -112,8 +121,9 @@ void FileSystemOperation::Move(const FilePath& src_path, |
| delete this; |
| return; |
| } |
| - base::FileUtilProxy::Move(proxy_, src_path, dest_path, |
| - callback_factory_.NewCallback( |
| + FileSystemFileUtilProxy::Move( |
| + file_system_operation_context_.get(), |
| + proxy_, src_path, dest_path, callback_factory_.NewCallback( |
| &FileSystemOperation::DidFinishFileOperation)); |
| } |
| @@ -127,8 +137,10 @@ void FileSystemOperation::DirectoryExists(const FilePath& path) { |
| delete this; |
| return; |
| } |
| - base::FileUtilProxy::GetFileInfo(proxy_, path, callback_factory_.NewCallback( |
| - &FileSystemOperation::DidDirectoryExists)); |
| + FileSystemFileUtilProxy::GetFileInfo( |
| + file_system_operation_context_.get(), |
| + proxy_, path, callback_factory_.NewCallback( |
| + &FileSystemOperation::DidDirectoryExists)); |
| } |
| void FileSystemOperation::FileExists(const FilePath& path) { |
| @@ -141,8 +153,10 @@ void FileSystemOperation::FileExists(const FilePath& path) { |
| delete this; |
| return; |
| } |
| - base::FileUtilProxy::GetFileInfo(proxy_, path, callback_factory_.NewCallback( |
| - &FileSystemOperation::DidFileExists)); |
| + FileSystemFileUtilProxy::GetFileInfo( |
| + file_system_operation_context_.get(), |
| + proxy_, path, callback_factory_.NewCallback( |
| + &FileSystemOperation::DidFileExists)); |
| } |
| void FileSystemOperation::GetMetadata(const FilePath& path) { |
| @@ -155,8 +169,10 @@ void FileSystemOperation::GetMetadata(const FilePath& path) { |
| delete this; |
| return; |
| } |
| - base::FileUtilProxy::GetFileInfo(proxy_, path, callback_factory_.NewCallback( |
| - &FileSystemOperation::DidGetMetadata)); |
| + FileSystemFileUtilProxy::GetFileInfo( |
| + file_system_operation_context_.get(), |
| + proxy_, path, callback_factory_.NewCallback( |
| + &FileSystemOperation::DidGetMetadata)); |
| } |
| void FileSystemOperation::ReadDirectory(const FilePath& path) { |
| @@ -169,8 +185,9 @@ void FileSystemOperation::ReadDirectory(const FilePath& path) { |
| delete this; |
| return; |
| } |
| - base::FileUtilProxy::ReadDirectory(proxy_, path, |
| - callback_factory_.NewCallback( |
| + FileSystemFileUtilProxy::ReadDirectory( |
| + file_system_operation_context_.get(), |
| + proxy_, path, callback_factory_.NewCallback( |
| &FileSystemOperation::DidReadDirectory)); |
| } |
| @@ -184,8 +201,9 @@ void FileSystemOperation::Remove(const FilePath& path, bool recursive) { |
| delete this; |
| return; |
| } |
| - base::FileUtilProxy::Delete(proxy_, path, recursive, |
| - callback_factory_.NewCallback( |
| + FileSystemFileUtilProxy::Delete( |
| + file_system_operation_context_.get(), |
| + proxy_, path, recursive, callback_factory_.NewCallback( |
| &FileSystemOperation::DidFinishFileOperation)); |
| } |
| @@ -208,7 +226,8 @@ void FileSystemOperation::Write( |
| blob_request_.reset( |
| new net::URLRequest(blob_url, file_writer_delegate_.get())); |
| blob_request_->set_context(url_request_context); |
| - base::FileUtilProxy::CreateOrOpen( |
| + FileSystemFileUtilProxy::CreateOrOpen( |
| + file_system_operation_context_.get(), |
| proxy_, |
| path, |
| base::PLATFORM_FILE_OPEN | base::PLATFORM_FILE_WRITE | |
| @@ -226,8 +245,9 @@ void FileSystemOperation::Truncate(const FilePath& path, int64 length) { |
| delete this; |
| return; |
| } |
| - base::FileUtilProxy::Truncate(proxy_, path, length, |
| - callback_factory_.NewCallback( |
| + FileSystemFileUtilProxy::Truncate( |
| + file_system_operation_context_.get(), |
| + proxy_, path, length, callback_factory_.NewCallback( |
| &FileSystemOperation::DidFinishFileOperation)); |
| } |
| @@ -243,7 +263,8 @@ void FileSystemOperation::TouchFile(const FilePath& path, |
| delete this; |
| return; |
| } |
| - base::FileUtilProxy::Touch( |
| + FileSystemFileUtilProxy::Touch( |
| + file_system_operation_context_.get(), |
| proxy_, path, last_access_time, last_modified_time, |
| callback_factory_.NewCallback(&FileSystemOperation::DidTouchFile)); |
| } |