Index: webkit/fileapi/file_system_context.cc |
diff --git a/webkit/fileapi/file_system_context.cc b/webkit/fileapi/file_system_context.cc |
index 2b8c7fa9a53ac484fc8c00076001f3f16e7be418..c4f652d4b41db1d82558474de6e9bc8980f77690 100644 |
--- a/webkit/fileapi/file_system_context.cc |
+++ b/webkit/fileapi/file_system_context.cc |
@@ -36,10 +36,11 @@ QuotaClient* CreateQuotaClient( |
return new FileSystemQuotaClient(context, is_incognito); |
} |
-void DidOpenFileSystem(FileSystemContext::OpenFileSystemCallback callback, |
- const GURL& filesystem_root, |
- const std::string& filesystem_name, |
- base::PlatformFileError error) { |
+void DidOpenFileSystem( |
+ const FileSystemContext::OpenFileSystemCallback& callback, |
+ const GURL& filesystem_root, |
+ const std::string& filesystem_name, |
+ base::PlatformFileError error) { |
callback.Run(error, filesystem_name, filesystem_root); |
} |
@@ -78,22 +79,12 @@ bool FileSystemContext::DeleteDataForOriginOnFileThread( |
// Delete temporary and persistent data. |
return |
- sandbox_provider()->DeleteOriginDataOnFileThread( |
- this, quota_manager_proxy(), origin_url, kFileSystemTypeTemporary) && |
- sandbox_provider()->DeleteOriginDataOnFileThread( |
- this, quota_manager_proxy(), origin_url, kFileSystemTypePersistent); |
-} |
- |
-bool FileSystemContext::DeleteDataForOriginAndTypeOnFileThread( |
- const GURL& origin_url, FileSystemType type) { |
- DCHECK(file_task_runner_->RunsTasksOnCurrentThread()); |
- if (type == fileapi::kFileSystemTypeTemporary || |
- type == fileapi::kFileSystemTypePersistent) { |
- DCHECK(sandbox_provider()); |
- return sandbox_provider()->DeleteOriginDataOnFileThread( |
- this, quota_manager_proxy(), origin_url, type); |
- } |
- return false; |
+ (sandbox_provider()->DeleteOriginDataOnFileThread( |
+ this, quota_manager_proxy(), origin_url, kFileSystemTypeTemporary) == |
+ base::PLATFORM_FILE_OK) && |
+ (sandbox_provider()->DeleteOriginDataOnFileThread( |
+ this, quota_manager_proxy(), origin_url, kFileSystemTypePersistent) == |
+ base::PLATFORM_FILE_OK); |
} |
FileSystemQuotaUtil* |
@@ -149,7 +140,7 @@ void FileSystemContext::OpenFileSystem( |
const GURL& origin_url, |
FileSystemType type, |
bool create, |
- OpenFileSystemCallback callback) { |
+ const OpenFileSystemCallback& callback) { |
DCHECK(!callback.is_null()); |
FileSystemMountPointProvider* mount_point_provider = |
@@ -167,6 +158,20 @@ void FileSystemContext::OpenFileSystem( |
base::Bind(&DidOpenFileSystem, callback, root_url, name)); |
} |
+void FileSystemContext::DeleteFileSystem( |
+ const GURL& origin_url, |
+ FileSystemType type, |
+ const DeleteFileSystemCallback& callback) { |
+ FileSystemMountPointProvider* mount_point_provider = |
+ GetMountPointProvider(type); |
+ if (!mount_point_provider) { |
+ callback.Run(base::PLATFORM_FILE_ERROR_SECURITY); |
+ return; |
+ } |
+ |
+ mount_point_provider->DeleteFileSystem(origin_url, type, this, callback); |
+} |
+ |
FileSystemOperationInterface* FileSystemContext::CreateFileSystemOperation( |
const FileSystemURL& url) { |
if (!url.is_valid()) |