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/socket/socks_client_socket.h" | 5 #include "net/socket/socks_client_socket.h" |
6 | 6 |
| 7 #include <utility> |
| 8 |
7 #include "base/bind.h" | 9 #include "base/bind.h" |
8 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
9 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
10 #include "base/sys_byteorder.h" | 12 #include "base/sys_byteorder.h" |
11 #include "net/base/io_buffer.h" | 13 #include "net/base/io_buffer.h" |
12 #include "net/base/net_util.h" | 14 #include "net/base/net_util.h" |
13 #include "net/log/net_log.h" | 15 #include "net/log/net_log.h" |
14 #include "net/socket/client_socket_handle.h" | 16 #include "net/socket/client_socket_handle.h" |
15 | 17 |
16 namespace net { | 18 namespace net { |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 uint8_t ip[4]; | 55 uint8_t ip[4]; |
54 }; | 56 }; |
55 static_assert(sizeof(SOCKS4ServerResponse) == kReadHeaderSize, | 57 static_assert(sizeof(SOCKS4ServerResponse) == kReadHeaderSize, |
56 "socks4 server response struct has incorrect size"); | 58 "socks4 server response struct has incorrect size"); |
57 | 59 |
58 SOCKSClientSocket::SOCKSClientSocket( | 60 SOCKSClientSocket::SOCKSClientSocket( |
59 scoped_ptr<ClientSocketHandle> transport_socket, | 61 scoped_ptr<ClientSocketHandle> transport_socket, |
60 const HostResolver::RequestInfo& req_info, | 62 const HostResolver::RequestInfo& req_info, |
61 RequestPriority priority, | 63 RequestPriority priority, |
62 HostResolver* host_resolver) | 64 HostResolver* host_resolver) |
63 : transport_(transport_socket.Pass()), | 65 : transport_(std::move(transport_socket)), |
64 next_state_(STATE_NONE), | 66 next_state_(STATE_NONE), |
65 completed_handshake_(false), | 67 completed_handshake_(false), |
66 bytes_sent_(0), | 68 bytes_sent_(0), |
67 bytes_received_(0), | 69 bytes_received_(0), |
68 was_ever_used_(false), | 70 was_ever_used_(false), |
69 host_resolver_(host_resolver), | 71 host_resolver_(host_resolver), |
70 host_request_info_(req_info), | 72 host_request_info_(req_info), |
71 priority_(priority), | 73 priority_(priority), |
72 net_log_(transport_->socket()->NetLog()) {} | 74 net_log_(transport_->socket()->NetLog()) {} |
73 | 75 |
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 | 454 |
453 int SOCKSClientSocket::GetPeerAddress(IPEndPoint* address) const { | 455 int SOCKSClientSocket::GetPeerAddress(IPEndPoint* address) const { |
454 return transport_->socket()->GetPeerAddress(address); | 456 return transport_->socket()->GetPeerAddress(address); |
455 } | 457 } |
456 | 458 |
457 int SOCKSClientSocket::GetLocalAddress(IPEndPoint* address) const { | 459 int SOCKSClientSocket::GetLocalAddress(IPEndPoint* address) const { |
458 return transport_->socket()->GetLocalAddress(address); | 460 return transport_->socket()->GetLocalAddress(address); |
459 } | 461 } |
460 | 462 |
461 } // namespace net | 463 } // namespace net |
OLD | NEW |