diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
commit | 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch) | |
tree | 46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/WebCore/loader/appcache/ApplicationCacheResource.cpp | |
parent | 32761a6cee1d0dee366b885b7b9c777e67885688 (diff) | |
download | WebKitGtk-tarball-master.tar.gz |
webkitgtk-2.16.5HEADwebkitgtk-2.16.5master
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); |