Cached file backed resources don't make it to the Web Process when NETWORK_CFDATA_ARRAY_CALLBACK is enabled
https://bugs.webkit.org/show_bug.cgi?id=135727
<rdar://problem/
17947880>
Reviewed by Darin Adler.
Source/WebCore:
Add SharedBuffer::existingCFData() which returns CFDataRef if it has one. Refactor
this code out of createCFData().
* WebCore.exp.in:
* platform/SharedBuffer.h:
* platform/mac/SharedBufferMac.mm:
(WebCore::SharedBuffer::existingCFData): Added.
(WebCore::SharedBuffer::createCFData):
Source/WebKit2:
tryGetShareableHandleFromSharedBuffer() assumed that we have a file backed resource only if
we had a CFDataRef (platformData()) in SharedBuffer. This is wrong when we use the data
array callbacks since the file backed buffer could be in the data array. Instead of relying
on hasPlatformData(), explicitly ask the SharedBuffer to give us a CFDataRef if it has one
so that SharedBuffer can take care of the data array case.
* NetworkProcess/mac/NetworkResourceLoaderMac.mm:
(WebKit::NetworkResourceLoader::tryGetShareableHandleFromSharedBuffer):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@172502
268f45cc-cd09-0410-ab3c-
d52691b4dbfc