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

Unified Diff: net/http/http_stream_parser.h

Issue 1320683003: Move logic to figure out if a socket can be reused into HttpStream. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 4 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_stream_parser.h
diff --git a/net/http/http_stream_parser.h b/net/http/http_stream_parser.h
index 471d9f10c39ba9c5e04dc3268af2c7fc8d8e2a40..cb18cc81cf2e3f74b0b4336bdbbd4b397da5bf05 100644
--- a/net/http/http_stream_parser.h
+++ b/net/http/http_stream_parser.h
@@ -73,7 +73,15 @@ class NET_EXPORT_PRIVATE HttpStreamParser {
void SetConnectionReused();
- bool IsConnectionReusable() const;
+ // Returns true if the underlying connection can be reused.
+ // The connection can be reused if:
+ // * It's still connected.
+ // * The response headers indicate the connection can be kept alive.
+ // * The end of the response can be found.
+ //
+ // Note that if response headers have yet to be received, this will return
+ // false.
+ bool CanReuseConnection() const;
int64 received_bytes() const { return received_bytes_; }

Powered by Google App Engine
This is Rietveld 408576698