| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "net/http/http_basic_stream.h" | 5 #include "net/http/http_basic_stream.h" |
| 6 | 6 |
| 7 #include "base/format_macros.h" | 7 #include "base/format_macros.h" |
| 8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
| 9 #include "base/stringprintf.h" | 9 #include "base/stringprintf.h" |
| 10 #include "net/base/io_buffer.h" | 10 #include "net/base/io_buffer.h" |
| 11 #include "net/base/net_errors.h" | 11 #include "net/base/net_errors.h" |
| 12 #include "net/http/http_request_headers.h" | 12 #include "net/http/http_request_headers.h" |
| 13 #include "net/http/http_request_info.h" | 13 #include "net/http/http_request_info.h" |
| 14 #include "net/http/http_response_body_drainer.h" |
| 14 #include "net/http/http_stream_parser.h" | 15 #include "net/http/http_stream_parser.h" |
| 15 #include "net/http/http_util.h" | 16 #include "net/http/http_util.h" |
| 16 #include "net/socket/client_socket_handle.h" | 17 #include "net/socket/client_socket_handle.h" |
| 17 #include "net/socket/client_socket_pool_base.h" | 18 #include "net/socket/client_socket_pool_base.h" |
| 18 | 19 |
| 19 namespace net { | 20 namespace net { |
| 20 | 21 |
| 21 HttpBasicStream::HttpBasicStream(ClientSocketHandle* connection, | 22 HttpBasicStream::HttpBasicStream(ClientSocketHandle* connection, |
| 22 HttpStreamParser* parser, | 23 HttpStreamParser* parser, |
| 23 bool using_proxy) | 24 bool using_proxy) |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 VLOG(2) << StringPrintf("%s\nrtt = %f\tnum_rtt = %f\t" | 160 VLOG(2) << StringPrintf("%s\nrtt = %f\tnum_rtt = %f\t" |
| 160 "num_kb = %" PRId64 "\t" | 161 "num_kb = %" PRId64 "\t" |
| 161 "total bytes = %" PRId64 "\t" | 162 "total bytes = %" PRId64 "\t" |
| 162 "histogram = %s", | 163 "histogram = %s", |
| 163 request_line_.data(), | 164 request_line_.data(), |
| 164 rtt, num_rtt, num_kb, total_bytes_read, | 165 rtt, num_rtt, num_kb, total_bytes_read, |
| 165 histogram.data()); | 166 histogram.data()); |
| 166 } | 167 } |
| 167 } | 168 } |
| 168 | 169 |
| 170 void HttpBasicStream::Drain(HttpNetworkSession* session) { |
| 171 HttpResponseBodyDrainer* drainer = new HttpResponseBodyDrainer(this); |
| 172 drainer->Start(session); |
| 173 // |drainer| will delete itself. |
| 174 } |
| 175 |
| 169 } // namespace net | 176 } // namespace net |
| OLD | NEW |