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..d100a994660c5915359f79e26f0ae8e3c55b7754 100644 |
| --- a/webkit/fileapi/sandbox_mount_point_provider.cc |
| +++ b/webkit/fileapi/sandbox_mount_point_provider.cc |
| @@ -13,6 +13,7 @@ |
| #include "base/sequenced_task_runner.h" |
| #include "base/string_util.h" |
| #include "base/stringprintf.h" |
| +#include "base/task_runner_util.h" |
| #include "googleurl/src/gurl.h" |
| #include "net/base/net_util.h" |
| #include "webkit/fileapi/file_system_file_stream_reader.h" |
| @@ -268,16 +269,9 @@ void MigrateIfNeeded( |
| MigrateAllOldFileSystems(file_util, old_base_path); |
| } |
| -void PassPointerErrorByValue( |
| - const base::Callback<void(PlatformFileError)>& callback, |
| - PlatformFileError* error_ptr) { |
| - DCHECK(error_ptr); |
| - callback.Run(*error_ptr); |
| -} |
| - |
| 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); |
| @@ -459,6 +453,23 @@ FileSystemQuotaUtil* SandboxMountPointProvider::GetQuotaUtil() { |
| return this; |
| } |
| +void SandboxMountPointProvider::DeleteFileSystem( |
| + const GURL& origin_url, |
| + FileSystemType type, |
| + FileSystemContext* context, |
| + const DeleteFileSystemCallback& callback) { |
| + base::PostTaskAndReplyWithResult( |
| + context->file_task_runner(), |
| + FROM_HERE, |
| + base::Bind(&SandboxMountPointProvider::DeleteOriginDataOnFileThread, |
|
kinuko
2012/08/02 00:38:35
nit: could you add a brief comment that it's safe
nhiroki (google)
2012/08/02 17:38:38
Done.
|
| + base::Unretained(this), |
| + make_scoped_refptr(context), |
| + base::Unretained(context->quota_manager_proxy()), |
|
kinuko
2012/08/02 00:38:35
nit: I guess you don't need this Unretained decora
nhiroki (google)
2012/08/02 17:38:38
In this case, we need to decorate it since QuotaMa
|
| + origin_url, |
| + type), |
| + callback); |
| +} |
| + |
| FilePath SandboxMountPointProvider::old_base_path() const { |
| return profile_path_.Append(kOldFileSystemDirectory); |
| } |
| @@ -490,7 +501,8 @@ FilePath SandboxMountPointProvider::GetBaseDirectoryForOriginAndType( |
| return path; |
| } |
| -bool SandboxMountPointProvider::DeleteOriginDataOnFileThread( |
| +base::PlatformFileError |
| +SandboxMountPointProvider::DeleteOriginDataOnFileThread( |
| FileSystemContext* file_system_context, |
| QuotaManagerProxy* proxy, |
| const GURL& origin_url, |
| @@ -509,7 +521,10 @@ bool SandboxMountPointProvider::DeleteOriginDataOnFileThread( |
| FileSystemTypeToQuotaStorageType(type), |
| -usage); |
| } |
| - return result; |
| + |
| + if (result) |
| + return base::PLATFORM_FILE_OK; |
| + return base::PLATFORM_FILE_ERROR_FAILED; |
| } |
| void SandboxMountPointProvider::GetOriginsForTypeOnFileThread( |