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..58555b92f9e745537fb453dd164b410edf6eb1aa 100644 |
| --- a/webkit/fileapi/sandbox_mount_point_provider.cc |
| +++ b/webkit/fileapi/sandbox_mount_point_provider.cc |
| @@ -309,6 +309,24 @@ void ValidateRootOnFileThread( |
| // this method is called or not. |
| } |
| +void DidDeleteFileSystem( |
| + const base::Callback<void(PlatformFileError)>& callback, |
| + base::PlatformFileError* error) { |
| + callback.Run(*error); |
| +} |
| + |
| +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 base::Callback<void(PlatformFileError)>& callback) const { |
|
tzik
2012/07/28 00:36:46
Can we use DeleteFileSystemCallback here?
nhiroki (google)
2012/07/28 02:01:56
Done.
|
| + base::PlatformFileError* error_ptr = new base::PlatformFileError; |
| + file_task_runner_->PostTaskAndReply( |
| + FROM_HERE, |
| + base::Bind(&DeleteFileSystemOnFileThread, |
| + origin_url, |
| + type, |
| + base::Unretained(context), |
| + base::Unretained(error_ptr)), |
| + base::Bind(&DidDeleteFileSystem, callback, base::Owned(error_ptr))); |
| +} |
| + |
| FilePath SandboxMountPointProvider::old_base_path() const { |
| return profile_path_.Append(kOldFileSystemDirectory); |
| } |