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

Unified Diff: net/http/http_response_body_drainer.h

Issue 1884943003: HttpStreamParser: Don't reuse sockets which receive unparsed data. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix drainer test ('True' means closed...) Created 4 years, 8 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: net/http/http_response_body_drainer.h
diff --git a/net/http/http_response_body_drainer.h b/net/http/http_response_body_drainer.h
index 2ff4a767f95ad7519d6e817d077b6941996ca0a2..9cfbbb3046a463b5fb29fd9108100569b904b285 100644
--- a/net/http/http_response_body_drainer.h
+++ b/net/http/http_response_body_drainer.h
@@ -15,6 +15,7 @@
namespace net {
+class HttpResponseInfo;
class HttpStream;
class IOBuffer;
@@ -27,7 +28,10 @@ class NET_EXPORT_PRIVATE HttpResponseBodyDrainer {
static const int kDrainBodyBufferSize = 16384;
static const int kTimeoutInSeconds = 5;
- explicit HttpResponseBodyDrainer(HttpStream* stream);
+ // |response_info| is the HttpResponseInfo passed to the |stream|, which may
+ // still be holding on to pointers to it.
+ HttpResponseBodyDrainer(HttpStream* stream,
+ scoped_ptr<HttpResponseInfo> response_info);
~HttpResponseBodyDrainer();
// Starts reading the body until completion, or we hit the buffer limit, or we
@@ -52,6 +56,7 @@ class NET_EXPORT_PRIVATE HttpResponseBodyDrainer {
void Finish(int result);
scoped_refptr<IOBuffer> read_buf_;
+ scoped_ptr<HttpResponseInfo> response_info_;
const scoped_ptr<HttpStream> stream_;
State next_state_;
int total_read_;

Powered by Google App Engine
This is Rietveld 408576698