From 89e2486a48b739f8d771d69ede5a6a1b244a10fc Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Mon, 30 Jul 2012 11:37:48 +0200 Subject: Imported WebKit commit 0282df8ca7c11d8c8a66ea18543695c69f545a27 (http://svn.webkit.org/repository/webkit/trunk@124002) New snapshot with prospective Mountain Lion build fix --- .../WebKit/chromium/src/LocalFileSystemChromium.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'Source/WebKit/chromium/src/LocalFileSystemChromium.cpp') 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*, PassOwnPtrdidFail(WebKit::WebFileErrorAbort); } +static void deleteFileSystemNotAllowed(ScriptExecutionContext*, PassOwnPtr callbacks) +{ + callbacks->didFail(WebKit::WebFileErrorAbort); +} + static void openFileSystemHelper(ScriptExecutionContext* context, FileSystemType type, PassOwnPtr 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 callbacks) +{ + ASSERT(context); + ASSERT(context->isDocument()); + + Document* document = static_cast(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(type), new WebFileSystemCallbacksImpl(callbacks)); +} + } // namespace WebCore #endif // ENABLE(FILE_SYSTEM) -- cgit v1.2.1