Support creating File object from FileSystem URL for files in FileSystem API
authorkinuko@chromium.org <kinuko@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 13 Aug 2012 06:21:28 +0000 (06:21 +0000)
committerkinuko@chromium.org <kinuko@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 13 Aug 2012 06:21:28 +0000 (06:21 +0000)
commitfe537cdd672530dd830ed086e174d76c5f027b65
tree3eeb6fc150b3285bca672ece02867d3dceb51c39
parent17e193cbcd9f2e2fbbec5bdd6a2c99f7c1b3aab8
Support creating File object from FileSystem URL for files in FileSystem API
https://bugs.webkit.org/show_bug.cgi?id=93706

Reviewed by Darin Fisher.

Source/Platform:

* chromium/public/WebBlobData.h:
* chromium/public/WebHTTPBody.h:
(WebHTTPBody):

Source/WebCore:

Current File code assumes the existence of local file (i.e. requires a platform local file path) but for FileSystem
files it may not be always the case. For example some implementation may want to use in-memory filesystem to realize
sandboxed filesystem, or others may have the filesystem in remote servers.

This patch adds basic support for making File object constructible not only from a file path but from a FileSystem URL.
Since File can be appended to FormData or included in another Blob this patch also extends BlobData and FormData to support URL.

FileChooser and Drag-and-drop changes are not included in this patch.

No new tests: will add tests when we implement the platform side changes to wire this change.

* Modules/filesystem/DOMFileSystem.cpp:
(WebCore::DOMFileSystem::createFile):
* Modules/filesystem/DOMFileSystemSync.cpp:
(WebCore::DOMFileSystemSync::createFile):
* fileapi/Blob.cpp:
(WebCore::Blob::sliceInternal):
* fileapi/File.cpp:
(WebCore::createBlobDataForFileSystemURL): Added.
(WebCore::File::File):
* fileapi/File.h:
(WebCore::File::createForFileSystemFile):
(WebCore::File::fileSystemURL): Added.
* fileapi/WebKitBlobBuilder.cpp:
(WebCore::WebKitBlobBuilder::append):
* platform/chromium/support/WebHTTPBody.cpp:
(WebKit::WebHTTPBody::elementAt):
(WebKit::WebHTTPBody::appendURL): Added.
(WebKit::WebHTTPBody::appendURLRange): Added.
(WebKit::WebHTTPBody::appendBlob):
* platform/network/BlobData.cpp:
(WebCore::BlobData::appendURL):
* platform/network/BlobData.h:
(BlobDataItem):
(WebCore::BlobDataItem::BlobDataItem):
* platform/network/BlobRegistryImpl.cpp:
(WebCore::BlobRegistryImpl::appendStorageItems):
(WebCore::BlobRegistryImpl::registerBlobURL):
* platform/network/FormData.cpp:
(WebCore::FormData::deepCopy):
(WebCore::FormData::appendURL): Added.
(WebCore::FormData::appendURLRange): Added.
(WebCore::FormData::appendKeyValuePairItems):
* platform/network/FormData.h:
(WebCore::FormDataElement::FormDataElement):
(FormDataElement):
(WebCore::operator==):

Source/WebKit/chromium:

* src/WebBlobData.cpp:
(WebKit::WebBlobData::itemAt):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@125391 268f45cc-cd09-0410-ab3c-d52691b4dbfc
21 files changed:
Source/Platform/ChangeLog
Source/Platform/chromium/public/WebBlobData.h
Source/Platform/chromium/public/WebHTTPBody.h
Source/WebCore/ChangeLog
Source/WebCore/Modules/filesystem/DOMFileSystem.cpp
Source/WebCore/Modules/filesystem/DOMFileSystemSync.cpp
Source/WebCore/fileapi/Blob.cpp
Source/WebCore/fileapi/File.cpp
Source/WebCore/fileapi/File.h
Source/WebCore/fileapi/WebKitBlobBuilder.cpp
Source/WebCore/platform/chromium/support/WebHTTPBody.cpp
Source/WebCore/platform/network/BlobData.cpp
Source/WebCore/platform/network/BlobData.h
Source/WebCore/platform/network/BlobRegistryImpl.cpp
Source/WebCore/platform/network/FormData.cpp
Source/WebCore/platform/network/FormData.h
Source/WebCore/platform/network/blackberry/ResourceRequestBlackBerry.cpp
Source/WebCore/platform/network/cf/FormDataStreamCFNet.cpp
Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/src/WebBlobData.cpp