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

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: Replaced "typedef" by "using". 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..ad96ee3a613665899906a12114cabc839e68d928 100644
--- a/webkit/fileapi/sandbox_mount_point_provider.cc
+++ b/webkit/fileapi/sandbox_mount_point_provider.cc
@@ -277,7 +277,7 @@ void PassPointerErrorByValue(
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 +309,24 @@ void ValidateRootOnFileThread(
// this method is called or not.
}
+void DidDeleteFileSystem(
+ const FileSystemMountPointProvider::DeleteFileSystemCallback& callback,
+ base::PlatformFileError* error) {
+ callback.Run(*error);
kinuko 2012/07/30 21:53:38 Please consider using PostTaskAndReplyWithResult t
nhiroki (google) 2012/07/31 15:50:32 I think we cannot get rid of like this adapter by
kinuko 2012/07/31 16:59:19 Can we just pass callback there?
nhiroki (google) 2012/07/31 17:17:12 I'm really sorry I misunderstood. I modified to pa
+}
+
+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 DeleteFileSystemCallback& callback) const {
+ base::PlatformFileError* error_ptr = new base::PlatformFileError;
+ file_task_runner_->PostTaskAndReply(
+ FROM_HERE,
+ base::Bind(&DeleteFileSystemOnFileThread,
kinuko 2012/07/30 21:53:38 Wonder if we should rather make FSC::DeleteDataFor
nhiroki (google) 2012/07/31 15:50:32 Done.
+ origin_url,
+ type,
+ base::Unretained(context),
kinuko 2012/07/30 21:53:38 Should we rather pass this with make_ref_ptr?
nhiroki (google) 2012/07/31 17:17:12 I forgot a reply. Done.
+ 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