Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(94)

Unified Diff: Source/WebCore/platform/network/qt/ResourceHandleQt.cpp

Issue 12090050: Revert 138962 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1397/
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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)
« no previous file with comments | « Source/WebCore/platform/network/mac/ResourceHandleMac.mm ('k') | Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698