Chromium Code Reviews| Index: webkit/fileapi/file_system_operation.cc |
| =================================================================== |
| --- webkit/fileapi/file_system_operation.cc (revision 74905) |
| +++ webkit/fileapi/file_system_operation.cc (working copy) |
| @@ -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 @@ |
| : proxy_(proxy), |
| dispatcher_(dispatcher), |
| file_system_context_(file_system_context), |
| + file_system_operation_context_( |
| + new FileSystemOperationContext(file_system_context)), |
| callback_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { |
| DCHECK(dispatcher); |
| #ifndef NDEBUG |
| @@ -30,7 +34,9 @@ |
| 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); |
|
Dai Mikurube (google.com)
2011/02/22 10:13:53
It's to be fixed as follows :
base::FileUtilProxy:
|
| } |
| void FileSystemOperation::OpenFileSystem( |
| @@ -58,15 +64,16 @@ |
| 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) { |
| #ifndef NDEBUG |
| DCHECK(kOperationNone == pending_operation_); |
| pending_operation_ = kOperationCreateDirectory; |
| @@ -76,8 +83,9 @@ |
| 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 @@ |
| 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 @@ |
| 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 @@ |
| 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 @@ |
| 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 @@ |
| 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 @@ |
| 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 @@ |
| 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 @@ |
| 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 @@ |
| 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 @@ |
| 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)); |
| } |
| @@ -408,7 +429,7 @@ |
| // We may want do more checks, but for now it just checks if the given |
| // |path| is under the valid FileSystem root path for this host context. |
| if (!file_system_context_->path_manager()->CrackFileSystemPath( |
| - path, NULL, NULL, NULL)) { |
| + path, NULL, NULL, NULL, NULL)) { |
| dispatcher_->DidFail(base::PLATFORM_FILE_ERROR_SECURITY); |
| return false; |
| } |
| @@ -425,7 +446,7 @@ |
| return true; |
| if (!file_system_context_->path_manager()->CrackFileSystemPath( |
| - path, &origin_url, NULL, &virtual_path)) { |
| + path, &origin_url, NULL, NULL, &virtual_path)) { |
| dispatcher_->DidFail(base::PLATFORM_FILE_ERROR_SECURITY); |
| return false; |
| } |