Chromium Code Reviews| Index: webkit/fileapi/sandbox_mount_point_provider.cc |
| diff --git a/webkit/fileapi/sandbox_mount_point_provider.cc b/webkit/fileapi/sandbox_mount_point_provider.cc |
| index 30f6a97f60103ddbfc8ddc80e28189a41eb9bb5d..ad96ee3a613665899906a12114cabc839e68d928 100644 |
| --- a/webkit/fileapi/sandbox_mount_point_provider.cc |
| +++ b/webkit/fileapi/sandbox_mount_point_provider.cc |
| @@ -277,7 +277,7 @@ void PassPointerErrorByValue( |
| void DidValidateFileSystemRoot( |
| base::WeakPtr<SandboxMountPointProvider> mount_point_provider, |
| - const base::Callback<void(PlatformFileError)>& callback, |
| + const FileSystemMountPointProvider::ValidateFileSystemCallback& callback, |
| base::PlatformFileError* error) { |
| if (mount_point_provider.get()) |
| mount_point_provider.get()->CollectOpenFileSystemMetrics(*error); |
| @@ -309,6 +309,24 @@ void ValidateRootOnFileThread( |
| // this method is called or not. |
| } |
| +void DidDeleteFileSystem( |
| + const FileSystemMountPointProvider::DeleteFileSystemCallback& callback, |
| + base::PlatformFileError* error) { |
| + callback.Run(*error); |
|
kinuko
2012/07/30 21:53:38
Please consider using PostTaskAndReplyWithResult t
nhiroki (google)
2012/07/31 15:50:32
I think we cannot get rid of like this adapter by
kinuko
2012/07/31 16:59:19
Can we just pass callback there?
nhiroki (google)
2012/07/31 17:17:12
I'm really sorry I misunderstood.
I modified to pa
|
| +} |
| + |
| +void DeleteFileSystemOnFileThread( |
| + const GURL& origin_url, |
| + FileSystemType type, |
| + FileSystemContext* context, |
| + base::PlatformFileError* error_ptr) { |
| + bool result = |
| + context->DeleteDataForOriginAndTypeOnFileThread(origin_url, type); |
| + *error_ptr = result ? |
| + base::PLATFORM_FILE_OK : |
| + base::PLATFORM_FILE_ERROR_FAILED; |
| +} |
| + |
| } // anonymous namespace |
| const FilePath::CharType SandboxMountPointProvider::kOldFileSystemDirectory[] = |
| @@ -459,6 +477,22 @@ FileSystemQuotaUtil* SandboxMountPointProvider::GetQuotaUtil() { |
| return this; |
| } |
| +void SandboxMountPointProvider::DeleteFileSystem( |
| + const GURL& origin_url, |
| + FileSystemType type, |
| + FileSystemContext* context, |
| + const DeleteFileSystemCallback& callback) const { |
| + base::PlatformFileError* error_ptr = new base::PlatformFileError; |
| + file_task_runner_->PostTaskAndReply( |
| + FROM_HERE, |
| + base::Bind(&DeleteFileSystemOnFileThread, |
|
kinuko
2012/07/30 21:53:38
Wonder if we should rather make FSC::DeleteDataFor
nhiroki (google)
2012/07/31 15:50:32
Done.
|
| + origin_url, |
| + type, |
| + base::Unretained(context), |
|
kinuko
2012/07/30 21:53:38
Should we rather pass this with make_ref_ptr?
nhiroki (google)
2012/07/31 17:17:12
I forgot a reply. Done.
|
| + base::Unretained(error_ptr)), |
| + base::Bind(&DidDeleteFileSystem, callback, base::Owned(error_ptr))); |
| +} |
| + |
| FilePath SandboxMountPointProvider::old_base_path() const { |
| return profile_path_.Append(kOldFileSystemDirectory); |
| } |