summaryrefslogtreecommitdiffstats
path: root/net/http/http_transaction.h
diff options
context:
space:
mode:
authordavidben@chromium.org <davidben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-19 17:58:39 +0000
committerdavidben@chromium.org <davidben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-19 17:58:39 +0000
commit5b2bacc2429b852755a2d40298adb23faa639edc (patch)
tree0b46441f0d8e3d77ad1ef145f43652d2ea0db150 /net/http/http_transaction.h
parentc3bd2973974dda9c3af6f15e4acf34491faf4c71 (diff)
downloadchromium_src-5b2bacc2429b852755a2d40298adb23faa639edc.zip
chromium_src-5b2bacc2429b852755a2d40298adb23faa639edc.tar.gz
chromium_src-5b2bacc2429b852755a2d40298adb23faa639edc.tar.bz2
Release the cache entry on deferred redirect.
If a redirect is deferred in the warm cache case, the HTTP transaction currently doesn't release the cache entry until after the redirect continues. This prevents other requests from accessing the cache entry. Reuse the DoneReading() signal for the URLRequestJob to notify the transaction that the response body is to be discarded. This matches the redirect-specific logic in HttpCache::Transaction which does not cache redirect bodies. In addition, now that this signal exists at a higher level, remove that logic in HttpCache::Transaction. It is now the caller's job to decide which response bodies are and aren't truncated away. Fixup and add new tests for this behavior. BUG=292879 TEST=HttpCache.CachedRedirect, HttpCache.DoneReading, URLRequestJob.RedirectTransactionNotifiedWhenDone Review URL: https://chromiumcodereview.appspot.com/23710059 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@224161 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http/http_transaction.h')
-rw-r--r--net/http/http_transaction.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/http/http_transaction.h b/net/http/http_transaction.h
index ec3fc08..d440500 100644
--- a/net/http/http_transaction.h
+++ b/net/http/http_transaction.h
@@ -109,6 +109,9 @@ class NET_EXPORT_PRIVATE HttpTransaction {
// of the stream. This is equivalent to performing an extra Read() at the end
// that should return 0 bytes. This method should not be called if the
// transaction is busy processing a previous operation (like a pending Read).
+ //
+ // DoneReading may also be called before the first Read() to notify that the
+ // entire response body is to be ignored (e.g., in a redirect).
virtual void DoneReading() = 0;
// Returns the response info for this transaction or NULL if the response