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

Unified Diff: webkit/tools/test_shell/simple_file_system.cc

Issue 10824305: Wire-up DeleteFileSystem to DumpRenderTree (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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/tools/test_shell/simple_file_system.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/tools/test_shell/simple_file_system.cc
diff --git a/webkit/tools/test_shell/simple_file_system.cc b/webkit/tools/test_shell/simple_file_system.cc
index 72a752bc114b1b57c127ce076d550724830e5683..a923211b9966ce78de00b1d8e11e0cdcf25197ff 100644
--- a/webkit/tools/test_shell/simple_file_system.cc
+++ b/webkit/tools/test_shell/simple_file_system.cc
@@ -118,6 +118,32 @@ void SimpleFileSystem::OpenFileSystem(
origin_url, type, create, OpenFileSystemHandler(callbacks));
}
+void SimpleFileSystem::DeleteFileSystem(
+ WebFrame* frame, WebFileSystem::Type web_filesystem_type,
+ WebFileSystemCallbacks* callbacks) {
+ if (!frame || !file_system_context_.get()) {
+ callbacks->didFail(WebKit::WebFileErrorSecurity);
+ return;
kinuko 2012/08/15 06:15:58 We silently return success in RenderViewImpl in th
tzik 2012/08/15 06:53:36 We return success in RVI if the origin is unique (
+ }
+
+ fileapi::FileSystemType type;
+ if (web_filesystem_type == WebFileSystem::TypeTemporary)
+ type = fileapi::kFileSystemTypeTemporary;
+ else if (web_filesystem_type == WebFileSystem::TypePersistent)
+ type = fileapi::kFileSystemTypePersistent;
+ else if (web_filesystem_type == WebFileSystem::TypeExternal)
+ type = fileapi::kFileSystemTypeExternal;
kinuko 2012/08/15 06:15:58 These explicit assignments are not really necessar
tzik 2012/08/15 06:53:36 Done.
+ else {
+ // Unknown type filesystem is requested.
+ callbacks->didFail(WebKit::WebFileErrorSecurity);
+ return;
+ }
+
+ GURL origin_url(frame->document().securityOrigin().toString());
+ file_system_context_->DeleteFileSystem(
+ origin_url, type, DeleteFileSystemHandler(callbacks));
+}
+
void SimpleFileSystem::move(
const WebURL& src_path,
const WebURL& dest_path, WebFileSystemCallbacks* callbacks) {
@@ -296,6 +322,12 @@ SimpleFileSystem::OpenFileSystemHandler(WebFileSystemCallbacks* callbacks) {
AsWeakPtr(), base::Unretained(callbacks));
}
+FileSystemContext::DeleteFileSystemCallback
+SimpleFileSystem::DeleteFileSystemHandler(WebFileSystemCallbacks* callbacks) {
+ return base::Bind(&SimpleFileSystem::DidDeleteFileSystem,
+ AsWeakPtr(), callbacks);
+}
+
FileSystemOperationInterface::SnapshotFileCallback
SimpleFileSystem::SnapshotFileHandler(const GURL& blob_url,
WebFileSystemCallbacks* callbacks) {
@@ -364,6 +396,15 @@ void SimpleFileSystem::DidOpenFileSystem(
}
}
+void SimpleFileSystem::DidDeleteFileSystem(
+ WebFileSystemCallbacks* callbacks,
+ base::PlatformFileError result) {
+ if (result == base::PLATFORM_FILE_OK)
+ callbacks->didSucceed();
+ else
+ callbacks->didFail(fileapi::PlatformFileErrorToWebFileError(result));
+}
+
void SimpleFileSystem::DidCreateSnapshotFile(
const GURL& blob_url,
WebFileSystemCallbacks* callbacks,
« no previous file with comments | « webkit/tools/test_shell/simple_file_system.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698