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

Unified Diff: webkit/fileapi/sandbox_mount_point_provider.cc

Issue 10828043: Wire up the deleteFileSystem operation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Modified CrosMountPointProvider too. 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
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..58555b92f9e745537fb453dd164b410edf6eb1aa 100644
--- a/webkit/fileapi/sandbox_mount_point_provider.cc
+++ b/webkit/fileapi/sandbox_mount_point_provider.cc
@@ -309,6 +309,24 @@ void ValidateRootOnFileThread(
// this method is called or not.
}
+void DidDeleteFileSystem(
+ const base::Callback<void(PlatformFileError)>& callback,
+ base::PlatformFileError* error) {
+ callback.Run(*error);
+}
+
+void DeleteFileSystemOnFileThread(
+ const GURL& origin_url,
+ FileSystemType type,
+ FileSystemContext* context,
+ base::PlatformFileError* error_ptr) {
+ bool result =
+ context->DeleteDataForOriginAndTypeOnFileThread(origin_url, type);
+ *error_ptr = result ?
+ base::PLATFORM_FILE_OK :
+ base::PLATFORM_FILE_ERROR_FAILED;
+}
+
} // anonymous namespace
const FilePath::CharType SandboxMountPointProvider::kOldFileSystemDirectory[] =
@@ -459,6 +477,22 @@ FileSystemQuotaUtil* SandboxMountPointProvider::GetQuotaUtil() {
return this;
}
+void SandboxMountPointProvider::DeleteFileSystem(
+ const GURL& origin_url,
+ FileSystemType type,
+ FileSystemContext* context,
+ const base::Callback<void(PlatformFileError)>& callback) const {
tzik 2012/07/28 00:36:46 Can we use DeleteFileSystemCallback here?
nhiroki (google) 2012/07/28 02:01:56 Done.
+ base::PlatformFileError* error_ptr = new base::PlatformFileError;
+ file_task_runner_->PostTaskAndReply(
+ FROM_HERE,
+ base::Bind(&DeleteFileSystemOnFileThread,
+ origin_url,
+ type,
+ base::Unretained(context),
+ base::Unretained(error_ptr)),
+ base::Bind(&DidDeleteFileSystem, callback, base::Owned(error_ptr)));
+}
+
FilePath SandboxMountPointProvider::old_base_path() const {
return profile_path_.Append(kOldFileSystemDirectory);
}

Powered by Google App Engine
This is Rietveld 408576698