diff options
Diffstat (limited to 'Source/WebCore/loader/appcache/ApplicationCacheResource.cpp')
-rw-r--r-- | Source/WebCore/loader/appcache/ApplicationCacheResource.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
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<SharedBuffer> data, const String& path) - : SubstituteResource(url, response, data) +ApplicationCacheResource::ApplicationCacheResource(const URL& url, const ResourceResponse& response, unsigned type, Ref<SharedBuffer>&& 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); |