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

Unified Diff: net/http/http_pipelined_connection_impl.cc

Issue 8591037: Implement Drain() on HttpPipelinedStream. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix nits Created 9 years, 1 month 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
« no previous file with comments | « net/http/http_pipelined_connection_impl.h ('k') | net/http/http_pipelined_connection_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_pipelined_connection_impl.cc
diff --git a/net/http/http_pipelined_connection_impl.cc b/net/http/http_pipelined_connection_impl.cc
index 82c788f903edbaf88a8861f94bb81e3ea8dcd06d..7c45da878df45306fb3e150b63a44d3a9aa9a430 100644
--- a/net/http/http_pipelined_connection_impl.cc
+++ b/net/http/http_pipelined_connection_impl.cc
@@ -9,6 +9,8 @@
#include "net/base/io_buffer.h"
#include "net/http/http_pipelined_stream.h"
#include "net/http/http_request_info.h"
+#include "net/http/http_response_body_drainer.h"
+#include "net/http/http_response_headers.h"
#include "net/http/http_stream_parser.h"
#include "net/socket/client_socket_handle.h"
@@ -606,6 +608,21 @@ void HttpPipelinedConnectionImpl::GetSSLCertRequestInfo(
cert_request_info);
}
+void HttpPipelinedConnectionImpl::Drain(HttpPipelinedStream* stream,
+ HttpNetworkSession* session) {
+ HttpResponseHeaders* headers = stream->GetResponseInfo()->headers;
+ if (!stream->CanFindEndOfResponse() || headers->IsChunkEncoded()) {
mmenke 2011/11/30 00:52:59 One more comment. Feel free to worry about it lat
James Simonsen 2011/11/30 19:39:14 Done.
+ // TODO(simonjam): Drain chunk-encoded responses if they're relatively
+ // common.
+ stream->Close(true);
+ delete stream;
+ return;
+ }
+ HttpResponseBodyDrainer* drainer = new HttpResponseBodyDrainer(stream);
+ drainer->StartWithSize(session, headers->GetContentLength());
+ // |drainer| will delete itself when done.
+}
+
void HttpPipelinedConnectionImpl::QueueUserCallback(
int pipeline_id,
OldCompletionCallback* callback,
« no previous file with comments | « net/http/http_pipelined_connection_impl.h ('k') | net/http/http_pipelined_connection_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698