diff options
author | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-20 00:55:48 +0000 |
---|---|---|
committer | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-20 00:55:48 +0000 |
commit | 5210df35578c33208b5720d4fa7807b3a228540a (patch) | |
tree | 4d27011c3e01d8e706b98326980ca932a0669c6b /net/http/http_util.h | |
parent | d5defeb7c5fdb841c1156dea00f9ede833bee500 (diff) | |
download | chromium_src-5210df35578c33208b5720d4fa7807b3a228540a.zip chromium_src-5210df35578c33208b5720d4fa7807b3a228540a.tar.gz chromium_src-5210df35578c33208b5720d4fa7807b3a228540a.tar.bz2 |
Revert 59908 (breaks WebKit layout tests) - Add HttpResponseBodyDrainer. Use it for unfinished HttpStreams.
Hopefully this will improve our reuse of sockets, and thus performance, since many redirects have response bodies, so we end up discarding those sockets rather than draining the bodies and reusing the socket.
Fix a bunch of tests since we now try to read from the socket in HttpNetworkTransaction's destructor, which often executes after the StaticSocketDataProvider has already been destroyed, so we end up trying to invoke pure virtuals via stale pointers.
BUG=54277
TEST=
1) Start up chrome with an empty cache (I just use --user-data-dir=/tmp/newprofile).
2) Open up about:net-internals, browse to its socket tab.
3) In a separate Chrome tab, open up http://google.com (NOT www.google.com).
NOTE: This will get a 301 redirect with a response body for us to drain.
Previously we wouldn't drain it, so we wouldn't reuse the socket.
4) In the about:net-internals's socket page, wait for it to reload (or force a reload).
Look for the google.com row under tcp_socket_pool. If it doesn't exist, then that
means it failed. If it does exist _and_ the idle column says '1', then it worked.
Review URL: http://codereview.chromium.org/3293015
TBR=willchan@chromium.org
Review URL: http://codereview.chromium.org/3466003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59910 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http/http_util.h')
-rw-r--r-- | net/http/http_util.h | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/net/http/http_util.h b/net/http/http_util.h index 3179782..33da33d 100644 --- a/net/http/http_util.h +++ b/net/http/http_util.h @@ -10,7 +10,6 @@ #include "base/string_tokenizer.h" #include "googleurl/src/gurl.h" -#include "net/base/completion_callback.h" #include "net/http/http_byte_range.h" // This is a macro to support extending this string literal at compile time. @@ -19,8 +18,6 @@ namespace net { -class HttpStream; - class HttpUtil { public: // Returns the absolute path of the URL, to be used for the http request. @@ -250,10 +247,6 @@ class HttpUtil { std::string::const_iterator value_begin_; std::string::const_iterator value_end_; }; - - // Attempts to read all of the response body of |stream|. Closes |stream| and - // deletes it when complete. - static void DrainStreamBodyAndClose(HttpStream* stream); }; } // namespace net |