Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(596)

Unified Diff: webkit/fileapi/file_system_context.cc

Issue 10828043: Wire up the deleteFileSystem operation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Adds comment. Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/fileapi/file_system_context.h ('k') | webkit/fileapi/file_system_mount_point_provider.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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())
« no previous file with comments | « webkit/fileapi/file_system_context.h ('k') | webkit/fileapi/file_system_mount_point_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698