OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_state.h" | 5 #include "net/http/http_basic_state.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "net/base/io_buffer.h" | 10 #include "net/base/io_buffer.h" |
11 #include "net/http/http_request_info.h" | 11 #include "net/http/http_request_info.h" |
12 #include "net/http/http_response_body_drainer.h" | 12 #include "net/http/http_response_body_drainer.h" |
13 #include "net/http/http_stream_parser.h" | 13 #include "net/http/http_stream_parser.h" |
14 #include "net/http/http_util.h" | 14 #include "net/http/http_util.h" |
15 #include "net/socket/client_socket_handle.h" | 15 #include "net/socket/client_socket_handle.h" |
16 #include "url/gurl.h" | 16 #include "url/gurl.h" |
17 | 17 |
18 namespace net { | 18 namespace net { |
19 | 19 |
20 HttpBasicState::HttpBasicState(ClientSocketHandle* connection, bool using_proxy) | 20 HttpBasicState::HttpBasicState(std::unique_ptr<ClientSocketHandle> connection, |
| 21 bool using_proxy) |
21 : read_buf_(new GrowableIOBuffer()), | 22 : read_buf_(new GrowableIOBuffer()), |
22 connection_(connection), | 23 connection_(std::move(connection)), |
23 using_proxy_(using_proxy), | 24 using_proxy_(using_proxy), |
24 request_info_(NULL) {} | 25 request_info_(NULL) {} |
25 | 26 |
26 HttpBasicState::~HttpBasicState() {} | 27 HttpBasicState::~HttpBasicState() {} |
27 | 28 |
28 int HttpBasicState::Initialize(const HttpRequestInfo* request_info, | 29 int HttpBasicState::Initialize(const HttpRequestInfo* request_info, |
29 RequestPriority priority, | 30 RequestPriority priority, |
30 const BoundNetLog& net_log, | 31 const BoundNetLog& net_log, |
31 const CompletionCallback& callback) { | 32 const CompletionCallback& callback) { |
32 DCHECK(!parser_.get()); | 33 DCHECK(!parser_.get()); |
(...skipping 27 matching lines...) Expand all Loading... |
60 request_line.reserve(expected_size); | 61 request_line.reserve(expected_size); |
61 request_line.append(request_info_->method); | 62 request_line.append(request_info_->method); |
62 request_line.append(1, ' '); | 63 request_line.append(1, ' '); |
63 request_line.append(path); | 64 request_line.append(path); |
64 request_line.append(kSuffix, kSuffixLen); | 65 request_line.append(kSuffix, kSuffixLen); |
65 DCHECK_EQ(expected_size, request_line.size()); | 66 DCHECK_EQ(expected_size, request_line.size()); |
66 return request_line; | 67 return request_line; |
67 } | 68 } |
68 | 69 |
69 } // namespace net | 70 } // namespace net |
OLD | NEW |