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

Unified Diff: third_party/WebKit/WebCore/platform/network/cf/ResourceHandleCFNet.cpp

Issue 39293: WebKit merge 41447:41498 [third_party/WebKit] (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: remove CRLF Created 11 years, 10 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: third_party/WebKit/WebCore/platform/network/cf/ResourceHandleCFNet.cpp
===================================================================
--- third_party/WebKit/WebCore/platform/network/cf/ResourceHandleCFNet.cpp (revision 11154)
+++ third_party/WebKit/WebCore/platform/network/cf/ResourceHandleCFNet.cpp (working copy)
@@ -519,12 +519,22 @@
return false;
}
-bool ResourceHandle::willLoadFromCache(ResourceRequest&)
+bool ResourceHandle::willLoadFromCache(ResourceRequest& request)
{
- // Not having this function means that we'll ask the user about re-posting a form
- // even when we go back to a page that's still in the cache.
- notImplemented();
- return false;
+ request.setCachePolicy(ReturnCacheDataDontLoad);
+
+ CFURLResponseRef cfResponse = 0;
+ CFErrorRef cfError = 0;
+ RetainPtr<CFURLRequestRef> cfRequest(AdoptCF, makeFinalRequest(request, true));
+ RetainPtr<CFDataRef> data(AdoptCF, CFURLConnectionSendSynchronousRequest(cfRequest.get(), &cfResponse, &cfError, request.timeoutInterval()));
+ bool cached = cfResponse && !cfError;
+
+ if (cfError)
+ CFRelease(cfError);
+ if (cfResponse)
+ CFRelease(cfResponse);
+
+ return cached;
}
} // namespace WebCore

Powered by Google App Engine
This is Rietveld 408576698