OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 HttpUtil::SpecForRequest(request_info_->url) : | 55 HttpUtil::SpecForRequest(request_info_->url) : |
56 HttpUtil::PathForRequest(request_info_->url); | 56 HttpUtil::PathForRequest(request_info_->url); |
57 request_line_ = base::StringPrintf("%s %s HTTP/1.1\r\n", | 57 request_line_ = base::StringPrintf("%s %s HTTP/1.1\r\n", |
58 request_info_->method.c_str(), | 58 request_info_->method.c_str(), |
59 path.c_str()); | 59 path.c_str()); |
60 response_ = response; | 60 response_ = response; |
61 return parser_->SendRequest(request_line_, headers, request_body.Pass(), | 61 return parser_->SendRequest(request_line_, headers, request_body.Pass(), |
62 response, callback); | 62 response, callback); |
63 } | 63 } |
64 | 64 |
65 uint64 HttpBasicStream::GetUploadProgress() const { | 65 UploadProgress HttpBasicStream::GetUploadProgress() const { |
66 return parser_->GetUploadProgress(); | 66 return parser_->GetUploadProgress(); |
67 } | 67 } |
68 | 68 |
69 int HttpBasicStream::ReadResponseHeaders(const CompletionCallback& callback) { | 69 int HttpBasicStream::ReadResponseHeaders(const CompletionCallback& callback) { |
70 return parser_->ReadResponseHeaders(callback); | 70 return parser_->ReadResponseHeaders(callback); |
71 } | 71 } |
72 | 72 |
73 const HttpResponseInfo* HttpBasicStream::GetResponseInfo() const { | 73 const HttpResponseInfo* HttpBasicStream::GetResponseInfo() const { |
74 return parser_->GetResponseInfo(); | 74 return parser_->GetResponseInfo(); |
75 } | 75 } |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 // Log rtt metrics here. | 131 // Log rtt metrics here. |
132 } | 132 } |
133 | 133 |
134 void HttpBasicStream::Drain(HttpNetworkSession* session) { | 134 void HttpBasicStream::Drain(HttpNetworkSession* session) { |
135 HttpResponseBodyDrainer* drainer = new HttpResponseBodyDrainer(this); | 135 HttpResponseBodyDrainer* drainer = new HttpResponseBodyDrainer(this); |
136 drainer->Start(session); | 136 drainer->Start(session); |
137 // |drainer| will delete itself. | 137 // |drainer| will delete itself. |
138 } | 138 } |
139 | 139 |
140 } // namespace net | 140 } // namespace net |
OLD | NEW |