summaryrefslogtreecommitdiff
path: root/Source/WebKit/chromium/src/LocalFileSystemChromium.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebKit/chromium/src/LocalFileSystemChromium.cpp')
-rw-r--r--Source/WebKit/chromium/src/LocalFileSystemChromium.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/Source/WebKit/chromium/src/LocalFileSystemChromium.cpp b/Source/WebKit/chromium/src/LocalFileSystemChromium.cpp
index 6fded29ff..d22412ac8 100644
--- a/Source/WebKit/chromium/src/LocalFileSystemChromium.cpp
+++ b/Source/WebKit/chromium/src/LocalFileSystemChromium.cpp
@@ -183,6 +183,11 @@ static void openFileSystemNotAllowed(ScriptExecutionContext*, PassOwnPtr<AsyncFi
callbacks->didFail(WebKit::WebFileErrorAbort);
}
+static void deleteFileSystemNotAllowed(ScriptExecutionContext*, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
+{
+ callbacks->didFail(WebKit::WebFileErrorAbort);
+}
+
static void openFileSystemHelper(ScriptExecutionContext* context, FileSystemType type, PassOwnPtr<AsyncFileSystemCallbacks> callbacks, FileSystemSynchronousType synchronousType, long long size, CreationFlag create)
{
bool allowed = true;
@@ -226,6 +231,22 @@ void LocalFileSystem::requestFileSystem(ScriptExecutionContext* context, FileSys
openFileSystemHelper(context, type, callbacks, synchronousType, size, CreateIfNotPresent);
}
+void LocalFileSystem::deleteFileSystem(ScriptExecutionContext* context, FileSystemType type, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
+{
+ ASSERT(context);
+ ASSERT(context->isDocument());
+
+ Document* document = static_cast<Document*>(context);
+ WebFrameImpl* webFrame = WebFrameImpl::fromFrame(document->frame());
+ WebKit::WebViewImpl* webView = webFrame->viewImpl();
+ if (webView->permissionClient() && !webView->permissionClient()->allowFileSystem(webFrame)) {
+ context->postTask(createCallbackTask(&deleteFileSystemNotAllowed, callbacks));
+ return;
+ }
+
+ webFrame->client()->deleteFileSystem(webFrame, static_cast<WebFileSystem::Type>(type), new WebFileSystemCallbacksImpl(callbacks));
+}
+
} // namespace WebCore
#endif // ENABLE(FILE_SYSTEM)