Cached file backed resources don't make it to the Web Process when NETWORK_CFDATA_ARR...
authorpsolanki@apple.com <psolanki@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Aug 2014 22:50:40 +0000 (22:50 +0000)
committerpsolanki@apple.com <psolanki@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Aug 2014 22:50:40 +0000 (22:50 +0000)
commit69169528fbbebde66a5ed1127410e1cac9c67bc5
treeeb2836e22f1be23c50fbc1adc36e53ad1a2dc3e8
parenta8aa0cae4a76312b54625f19bff0b58117d4df42
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
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/platform/SharedBuffer.h
Source/WebCore/platform/mac/SharedBufferMac.mm
Source/WebKit2/ChangeLog
Source/WebKit2/NetworkProcess/mac/NetworkResourceLoaderMac.mm