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

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..9272001eee585254aebb2794b8f9d677944d8d9e 100644
--- a/webkit/tools/test_shell/simple_file_system.cc
+++ b/webkit/tools/test_shell/simple_file_system.cc
@@ -91,7 +91,7 @@ SimpleFileSystem::~SimpleFileSystem() {
}
void SimpleFileSystem::OpenFileSystem(
- WebFrame* frame, WebFileSystem::Type web_filesystem_type,
+ WebFrame* frame, WebFileSystem::Type type,
long long, bool create,
WebFileSystemCallbacks* callbacks) {
if (!frame || !file_system_context_.get()) {
@@ -100,22 +100,24 @@ void SimpleFileSystem::OpenFileSystem(
return;
}
- 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;
- else {
- // Unknown type filesystem is requested.
+ GURL origin_url(frame->document().securityOrigin().toString());
+ file_system_context_->OpenFileSystem(
+ origin_url, static_cast<fileapi::FileSystemType>(type), create,
+ OpenFileSystemHandler(callbacks));
+}
+
+void SimpleFileSystem::DeleteFileSystem(
+ WebFrame* frame, WebFileSystem::Type type,
+ WebFileSystemCallbacks* callbacks) {
+ if (!frame || !file_system_context_.get()) {
callbacks->didFail(WebKit::WebFileErrorSecurity);
return;
}
GURL origin_url(frame->document().securityOrigin().toString());
- file_system_context_->OpenFileSystem(
- origin_url, type, create, OpenFileSystemHandler(callbacks));
+ file_system_context_->DeleteFileSystem(
+ origin_url, static_cast<fileapi::FileSystemType>(type),
+ DeleteFileSystemHandler(callbacks));
}
void SimpleFileSystem::move(
@@ -296,6 +298,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 +372,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