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..d30cc749352ba5154787a1df7c94eb2066a74362 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); |
| @@ -309,6 +303,13 @@ void ValidateRootOnFileThread( |
| // this method is called or not. |
| } |
| +base::PlatformFileError DeleteFileSystemOnFileThread( |
| + const GURL& origin_url, |
| + FileSystemType type, |
| + FileSystemContext* context) { |
| + return context->DeleteDataForOriginAndTypeOnFileThread(origin_url, type); |
| +} |
| + |
| } // anonymous namespace |
| const FilePath::CharType SandboxMountPointProvider::kOldFileSystemDirectory[] = |
| @@ -459,6 +460,21 @@ FileSystemQuotaUtil* SandboxMountPointProvider::GetQuotaUtil() { |
| return this; |
| } |
| +void SandboxMountPointProvider::DeleteFileSystem( |
| + const GURL& origin_url, |
| + FileSystemType type, |
| + FileSystemContext* context, |
| + const DeleteFileSystemCallback& callback) const { |
| + base::PostTaskAndReplyWithResult( |
| + context->file_task_runner(), |
| + FROM_HERE, |
| + base::Bind(&DeleteFileSystemOnFileThread, |
| + origin_url, |
| + type, |
| + make_scoped_refptr(context)), |
|
kinuko
2012/08/01 05:52:04
base::Bind(&FileSystemContext::DeleteDataForOrigin
nhiroki (google)
2012/08/01 20:37:45
The second case looks like difficult because WeakC
kinuko
2012/08/01 20:48:46
I see, then is it possible to pass an unretained p
nhiroki (google)
2012/08/01 22:35:43
All right. I changed it to pass unretained pointer
|
| + callback); |
| +} |
| + |
| FilePath SandboxMountPointProvider::old_base_path() const { |
| return profile_path_.Append(kOldFileSystemDirectory); |
| } |