| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "net/http/http_request_info.h" | 9 #include "net/http/http_request_info.h" |
| 10 #include "net/http/http_response_body_drainer.h" | 10 #include "net/http/http_response_body_drainer.h" |
| 11 #include "net/http/http_stream_parser.h" | 11 #include "net/http/http_stream_parser.h" |
| 12 #include "net/socket/client_socket_handle.h" | 12 #include "net/socket/client_socket_handle.h" |
| 13 | 13 |
| 14 namespace net { | 14 namespace net { |
| 15 | 15 |
| 16 HttpBasicStream::HttpBasicStream(std::unique_ptr<ClientSocketHandle> connection, | 16 HttpBasicStream::HttpBasicStream(std::unique_ptr<ClientSocketHandle> connection, |
| 17 bool using_proxy, | 17 bool using_proxy, |
| 18 bool http_09_on_non_default_ports_enabled) | 18 bool http_09_on_non_default_ports_enabled) |
| 19 : state_(std::move(connection), | 19 : state_(std::move(connection), |
| 20 using_proxy, | 20 using_proxy, |
| 21 http_09_on_non_default_ports_enabled) {} | 21 http_09_on_non_default_ports_enabled) {} |
| 22 | 22 |
| 23 HttpBasicStream::~HttpBasicStream() {} | 23 HttpBasicStream::~HttpBasicStream() {} |
| 24 | 24 |
| 25 int HttpBasicStream::InitializeStream(const HttpRequestInfo* request_info, | 25 int HttpBasicStream::InitializeStream(const HttpRequestInfo* request_info, |
| 26 RequestPriority priority, | 26 RequestPriority priority, |
| 27 const BoundNetLog& net_log, | 27 const NetLogWithSource& net_log, |
| 28 const CompletionCallback& callback) { | 28 const CompletionCallback& callback) { |
| 29 state_.Initialize(request_info, priority, net_log, callback); | 29 state_.Initialize(request_info, priority, net_log, callback); |
| 30 return OK; | 30 return OK; |
| 31 } | 31 } |
| 32 | 32 |
| 33 int HttpBasicStream::SendRequest(const HttpRequestHeaders& headers, | 33 int HttpBasicStream::SendRequest(const HttpRequestHeaders& headers, |
| 34 HttpResponseInfo* response, | 34 HttpResponseInfo* response, |
| 35 const CompletionCallback& callback) { | 35 const CompletionCallback& callback) { |
| 36 DCHECK(parser()); | 36 DCHECK(parser()); |
| 37 return parser()->SendRequest( | 37 return parser()->SendRequest( |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 // like the right version should be reported, if headers were received. | 128 // like the right version should be reported, if headers were received. |
| 129 details->connection_info = HttpResponseInfo::CONNECTION_INFO_HTTP1_1; | 129 details->connection_info = HttpResponseInfo::CONNECTION_INFO_HTTP1_1; |
| 130 return; | 130 return; |
| 131 } | 131 } |
| 132 | 132 |
| 133 void HttpBasicStream::SetPriority(RequestPriority priority) { | 133 void HttpBasicStream::SetPriority(RequestPriority priority) { |
| 134 // TODO(akalin): Plumb this through to |connection_|. | 134 // TODO(akalin): Plumb this through to |connection_|. |
| 135 } | 135 } |
| 136 | 136 |
| 137 } // namespace net | 137 } // namespace net |
| OLD | NEW |