summaryrefslogtreecommitdiffstats
path: root/webkit/fileapi/file_system_context.cc
diff options
context:
space:
mode:
Diffstat (limited to 'webkit/fileapi/file_system_context.cc')
-rw-r--r--webkit/fileapi/file_system_context.cc47
1 files changed, 26 insertions, 21 deletions
diff --git a/webkit/fileapi/file_system_context.cc b/webkit/fileapi/file_system_context.cc
index 53afbb1..3e3679e 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*
@@ -151,7 +142,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 =
@@ -169,6 +160,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())