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

Unified Diff: Source/WebCore/platform/network/chromium/ResourceHandle.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/chromium/ResourceHandle.cpp
===================================================================
--- Source/WebCore/platform/network/chromium/ResourceHandle.cpp (revision 141117)
+++ Source/WebCore/platform/network/chromium/ResourceHandle.cpp (working copy)
@@ -277,6 +277,22 @@
}
// static
+bool ResourceHandle::willLoadFromCache(ResourceRequest& request, Frame*)
+{
+ // This method is used to determine if a POST request can be repeated from
+ // cache, but you cannot really know until you actually try to read from the
+ // cache. Even if we checked now, something else could come along and wipe
+ // out the cache entry by the time we fetch it.
+ //
+ // So, we always say yes here, to prevent the FrameLoader from initiating a
+ // reload. Then in FrameLoaderClientImpl::dispatchWillSendRequest, we
+ // fix-up the cache policy of the request to force a load from the cache.
+ //
+ ASSERT(request.httpMethod() == "POST");
+ return true;
+}
+
+// static
void ResourceHandle::cacheMetadata(const ResourceResponse& response, const Vector<char>& data)
{
WebKit::Platform::current()->cacheMetadata(response.url(), response.responseTime(), data.data(), data.size());

Powered by Google App Engine
This is Rietveld 408576698