Index: Source/WebCore/platform/network/qt/ResourceHandleQt.cpp |
=================================================================== |
--- Source/WebCore/platform/network/qt/ResourceHandleQt.cpp (revision 141117) |
+++ Source/WebCore/platform/network/qt/ResourceHandleQt.cpp (working copy) |
@@ -125,6 +125,30 @@ |
return false; |
} |
+bool ResourceHandle::willLoadFromCache(ResourceRequest& request, Frame* frame) |
+{ |
+ if (!frame) |
+ return false; |
+ |
+ QNetworkAccessManager* manager = 0; |
+ QAbstractNetworkCache* cache = 0; |
+ if (frame->loader()->networkingContext()) { |
+ manager = frame->loader()->networkingContext()->networkAccessManager(); |
+ cache = manager->cache(); |
+ } |
+ |
+ if (!cache) |
+ return false; |
+ |
+ QNetworkCacheMetaData data = cache->metaData(request.url()); |
+ if (data.isValid()) { |
+ request.setCachePolicy(ReturnCacheDataDontLoad); |
+ return true; |
+ } |
+ |
+ return false; |
+} |
+ |
void ResourceHandle::loadResourceSynchronously(NetworkingContext* context, const ResourceRequest& request, StoredCredentials /*storedCredentials*/, ResourceError& error, ResourceResponse& response, Vector<char>& data) |
{ |
#if ENABLE(BLOB) |