summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorricea@chromium.org <ricea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-02 03:37:06 +0000
committerricea@chromium.org <ricea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-02 03:37:06 +0000
commitb0c35141bc4e7b368bb3d5e11f3cd504fefa22fb (patch)
treecb5a0f33e4febf693633c59f07e64f029bc892e7
parent99759ea92d569b5f8927c287901ae79a559b9de0 (diff)
downloadchromium_src-b0c35141bc4e7b368bb3d5e11f3cd504fefa22fb.zip
chromium_src-b0c35141bc4e7b368bb3d5e11f3cd504fefa22fb.tar.gz
chromium_src-b0c35141bc4e7b368bb3d5e11f3cd504fefa22fb.tar.bz2
The method net::HttpBasicStream::RenewStreamForAuth() deletes the
HttpStreamParser it holds before creating a copy of itself. The reason for this is non-obvious, so add a comment to clarify it. BUG=311917 TEST=net_unittests NOTRY=true Review URL: https://codereview.chromium.org/45313004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@232567 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--net/http/http_basic_stream.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/http/http_basic_stream.cc b/net/http/http_basic_stream.cc
index 729e9c3..41ace61 100644
--- a/net/http/http_basic_stream.cc
+++ b/net/http/http_basic_stream.cc
@@ -59,7 +59,9 @@ void HttpBasicStream::Close(bool not_reusable) {
HttpStream* HttpBasicStream::RenewStreamForAuth() {
DCHECK(IsResponseBodyComplete());
DCHECK(!parser()->IsMoreDataBuffered());
- // TODO(ricea): Why delete the parser here? crbug.com/311917
+ // The HttpStreamParser object still has a pointer to the connection. Just to
+ // be extra-sure it doesn't touch the connection again, delete it here rather
+ // than leaving it until the destructor is called.
state_.DeleteParser();
return new HttpBasicStream(state_.ReleaseConnection().release(),
state_.using_proxy());