[Attachment Support] Introduce data structures and IPC support for writing promised...
authorwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 3 Jan 2018 02:54:47 +0000 (02:54 +0000)
committerwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 3 Jan 2018 02:54:47 +0000 (02:54 +0000)
commitaae910b6282c00b1b4f2d0689ff2a4aa185f146f
treeb80fc72eff2231096a586eef380fc16407a3053c
parent015de731014aad1eb3e082105b17170efcc2d383
[Attachment Support] Introduce data structures and IPC support for writing promised blobs
https://bugs.webkit.org/show_bug.cgi?id=181189

Reviewed by Tim Horton.

Source/WebCore:

Introduces a new header containing structs to be used for writing blob data when dragging. PromisedBlobInfo
represents information needed to declare data on the pasteboard that will eventually be provided via a Blob.
This includes the type and filename of the Blob-backed content. PromisedBlobData represents information needed
to actually deliver the Blob's content to the platform, and is sent some time after its corresponding
PromisedBlobInfo. The content may either be in the form of a file path (as is the case using the previous
declareAndWriteAttachment codepath) or a data buffer (which we would use if the Blob is not already backed by a
file on disk).

No new tests, since there is no observable change in functionality yet.

* WebCore.xcodeproj/project.pbxproj:
* platform/PromisedBlobInfo.h: Added.
(WebCore::PromisedBlobInfo::operator bool const):
(WebCore::PromisedBlobData::hasData const):
(WebCore::PromisedBlobData::hasFile const):
(WebCore::PromisedBlobData::operator bool const):
(WebCore::PromisedBlobData::fulfills const):

Source/WebKit:

Add IPC support for PromisedBlobInfo and PromisedBlobData. See WebCore/ChangeLog for more detail.

* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<PromisedBlobData>::encode):
(IPC::ArgumentCoder<PromisedBlobData>::decode):
(IPC::ArgumentCoder<PromisedBlobInfo>::encode):
(IPC::ArgumentCoder<PromisedBlobInfo>::decode):
* Shared/WebCoreArgumentCoders.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@226348 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/platform/PromisedBlobInfo.h [new file with mode: 0644]
Source/WebKit/ChangeLog
Source/WebKit/Shared/WebCoreArgumentCoders.cpp
Source/WebKit/Shared/WebCoreArgumentCoders.h