From 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c Mon Sep 17 00:00:00 2001 From: Lorry Tar Creator Date: Tue, 27 Jun 2017 06:07:23 +0000 Subject: webkitgtk-2.16.5 --- Source/WebCore/loader/appcache/ApplicationCacheResource.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'Source/WebCore/loader/appcache/ApplicationCacheResource.cpp') diff --git a/Source/WebCore/loader/appcache/ApplicationCacheResource.cpp b/Source/WebCore/loader/appcache/ApplicationCacheResource.cpp index 2d9a8f1e6..f854a7212 100644 --- a/Source/WebCore/loader/appcache/ApplicationCacheResource.cpp +++ b/Source/WebCore/loader/appcache/ApplicationCacheResource.cpp @@ -29,8 +29,8 @@ namespace WebCore { -ApplicationCacheResource::ApplicationCacheResource(const URL& url, const ResourceResponse& response, unsigned type, PassRefPtr data, const String& path) - : SubstituteResource(url, response, data) +ApplicationCacheResource::ApplicationCacheResource(const URL& url, const ResourceResponse& response, unsigned type, Ref&& data, const String& path) + : SubstituteResource(url, response, WTFMove(data)) , m_type(type) , m_storageID(0) , m_estimatedSizeInStorage(0) @@ -38,6 +38,11 @@ ApplicationCacheResource::ApplicationCacheResource(const URL& url, const Resourc { } +void ApplicationCacheResource::deliver(ResourceLoader& loader) +{ + loader.deliverResponseAndData(response(), m_path.isEmpty() ? data().copy() : SharedBuffer::createWithContentsOfFile(m_path)); +} + void ApplicationCacheResource::addType(unsigned type) { // Caller should take care of storing the new type in database. @@ -49,8 +54,7 @@ int64_t ApplicationCacheResource::estimatedSizeInStorage() if (m_estimatedSizeInStorage) return m_estimatedSizeInStorage; - if (data()) - m_estimatedSizeInStorage = data()->size(); + m_estimatedSizeInStorage = data().size(); for (const auto& headerField : response().httpHeaderFields()) m_estimatedSizeInStorage += (headerField.key.length() + headerField.value.length() + 2) * sizeof(UChar); -- cgit v1.2.1