| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "config.h" | 31 #include "config.h" |
| 32 #include "LocalFileSystemClient.h" | 32 #include "LocalFileSystemClient.h" |
| 33 | 33 |
| 34 #include "WebFileSystemCallbacksImpl.h" | |
| 35 #include "WebFrameImpl.h" | 34 #include "WebFrameImpl.h" |
| 36 #include "WebViewImpl.h" | 35 #include "WebViewImpl.h" |
| 37 #include "core/dom/Document.h" | 36 #include "core/dom/Document.h" |
| 38 #include "core/platform/AsyncFileSystemCallbacks.h" | 37 #include "core/platform/AsyncFileSystemCallbacks.h" |
| 39 #include "public/platform/Platform.h" | 38 #include "public/platform/Platform.h" |
| 40 #include "public/platform/WebFileError.h" | 39 #include "public/platform/WebFileError.h" |
| 41 #include "public/platform/WebFileSystem.h" | 40 #include "public/platform/WebFileSystem.h" |
| 42 #include "public/platform/WebFileSystemCallbacks.h" | 41 #include "public/platform/WebFileSystemCallbacks.h" |
| 43 #include "public/platform/WebFileSystemType.h" | 42 #include "public/platform/WebFileSystemType.h" |
| 44 #include "public/web/WebPermissionClient.h" | 43 #include "public/web/WebPermissionClient.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 63 Document* document = toDocument(context); | 62 Document* document = toDocument(context); |
| 64 WebFrameImpl* webFrame = WebFrameImpl::fromFrame(document->frame()); | 63 WebFrameImpl* webFrame = WebFrameImpl::fromFrame(document->frame()); |
| 65 WebKit::WebViewImpl* webView = webFrame->viewImpl(); | 64 WebKit::WebViewImpl* webView = webFrame->viewImpl(); |
| 66 | 65 |
| 67 return !webView->permissionClient() || webView->permissionClient()->allowFil
eSystem(webFrame); | 66 return !webView->permissionClient() || webView->permissionClient()->allowFil
eSystem(webFrame); |
| 68 } | 67 } |
| 69 | 68 |
| 70 void LocalFileSystemClient::openFileSystem(ScriptExecutionContext* context, WebC
ore::FileSystemType type, PassOwnPtr<AsyncFileSystemCallbacks> callbacks, long l
ong size, OpenFileSystemMode openMode) | 69 void LocalFileSystemClient::openFileSystem(ScriptExecutionContext* context, WebC
ore::FileSystemType type, PassOwnPtr<AsyncFileSystemCallbacks> callbacks, long l
ong size, OpenFileSystemMode openMode) |
| 71 { | 70 { |
| 72 KURL storagePartition = KURL(KURL(), context->securityOrigin()->toString()); | 71 KURL storagePartition = KURL(KURL(), context->securityOrigin()->toString()); |
| 73 // FIXME: fix this callbacks raw pointer. | 72 WebKit::Platform::current()->fileSystem()->openFileSystem(storagePartition,
static_cast<WebFileSystemType>(type), openMode == CreateFileSystemIfNotPresent,
callbacks); |
| 74 WebKit::Platform::current()->fileSystem()->openFileSystem(storagePartition,
static_cast<WebFileSystemType>(type), openMode == CreateFileSystemIfNotPresent,
new WebKit::WebFileSystemCallbacksImpl(callbacks)); | |
| 75 } | 73 } |
| 76 | 74 |
| 77 void LocalFileSystemClient::deleteFileSystem(ScriptExecutionContext* context, We
bCore::FileSystemType type, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) | 75 void LocalFileSystemClient::deleteFileSystem(ScriptExecutionContext* context, We
bCore::FileSystemType type, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) |
| 78 { | 76 { |
| 79 KURL storagePartition = KURL(KURL(), context->securityOrigin()->toString()); | 77 KURL storagePartition = KURL(KURL(), context->securityOrigin()->toString()); |
| 80 // FIXME: fix this callbacks raw pointer. | 78 WebKit::Platform::current()->fileSystem()->deleteFileSystem(storagePartition
, static_cast<WebFileSystemType>(type), callbacks); |
| 81 WebKit::Platform::current()->fileSystem()->deleteFileSystem(storagePartition
, static_cast<WebFileSystemType>(type), new WebFileSystemCallbacksImpl(callbacks
)); | |
| 82 | 79 |
| 83 } | 80 } |
| 84 | 81 |
| 85 LocalFileSystemClient::LocalFileSystemClient() | 82 LocalFileSystemClient::LocalFileSystemClient() |
| 86 { | 83 { |
| 87 } | 84 } |
| 88 | 85 |
| 89 } // namespace WebKit | 86 } // namespace WebKit |
| OLD | NEW |