| Index: Source/WebCore/loader/ResourceLoader.cpp
|
| ===================================================================
|
| --- Source/WebCore/loader/ResourceLoader.cpp (revision 148397)
|
| +++ Source/WebCore/loader/ResourceLoader.cpp (working copy)
|
| @@ -466,6 +466,7 @@
|
| RefPtr<ResourceBuffer> buffer = resourceData();
|
| if (m_loadingMultipartContent && buffer && buffer->size()) {
|
| sendDataToResource(buffer->data(), buffer->size());
|
| + m_resource->finishOnePart();
|
| clearResourceData();
|
| // Since a subresource loader does not load multipart sections progressively, data was delivered to the loader all at once.
|
| // After the first multipart section is complete, signal to delegates that this load is "finished"
|
| @@ -516,11 +517,12 @@
|
| // (2) Our client requested that the data not be buffered at the ResourceLoader level via ResourceLoaderOptions. In this case,
|
| // ResourceLoader::resourceData() will be null. However, unlike the multipart case, we don't want to tell the CachedResource
|
| // that all data has been received yet.
|
| - if (m_loadingMultipartContent || !resourceData()) {
|
| - RefPtr<ResourceBuffer> copiedData = ResourceBuffer::create(data, length);
|
| - m_resource->data(copiedData.release(), m_loadingMultipartContent);
|
| - } else
|
| - m_resource->data(resourceData(), false);
|
| + RefPtr<ResourceBuffer> buffer;
|
| + if (m_loadingMultipartContent || !resourceData())
|
| + buffer = ResourceBuffer::create(data, length);
|
| + else
|
| + buffer = resourceData();
|
| + m_resource->data(buffer.release());
|
| }
|
|
|
| void ResourceLoader::didFinishLoading(ResourceHandle*, double finishTime)
|
| @@ -536,7 +538,6 @@
|
| CachedResourceHandle<CachedResource> protectResource(m_resource);
|
| m_state = Finishing;
|
| m_resource->setLoadFinishTime(finishTime);
|
| - m_resource->data(resourceData(), true);
|
| m_resource->finish();
|
| didFinishLoadingOnePart(finishTime);
|
|
|
|
|