| 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/socks5_client_socket.h" | 5 #include "net/socket/socks5_client_socket.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 } | 182 } |
| 183 | 183 |
| 184 int SOCKS5ClientSocket::SetReceiveBufferSize(int32_t size) { | 184 int SOCKS5ClientSocket::SetReceiveBufferSize(int32_t size) { |
| 185 return transport_->socket()->SetReceiveBufferSize(size); | 185 return transport_->socket()->SetReceiveBufferSize(size); |
| 186 } | 186 } |
| 187 | 187 |
| 188 int SOCKS5ClientSocket::SetSendBufferSize(int32_t size) { | 188 int SOCKS5ClientSocket::SetSendBufferSize(int32_t size) { |
| 189 return transport_->socket()->SetSendBufferSize(size); | 189 return transport_->socket()->SetSendBufferSize(size); |
| 190 } | 190 } |
| 191 | 191 |
| 192 int SOCKS5ClientSocket::SetDoNotFragment(bool do_not_fragment) { |
| 193 return transport_->socket()->SetDoNotFragment(do_not_fragment); |
| 194 } |
| 195 |
| 192 void SOCKS5ClientSocket::DoCallback(int result) { | 196 void SOCKS5ClientSocket::DoCallback(int result) { |
| 193 DCHECK_NE(ERR_IO_PENDING, result); | 197 DCHECK_NE(ERR_IO_PENDING, result); |
| 194 DCHECK(!user_callback_.is_null()); | 198 DCHECK(!user_callback_.is_null()); |
| 195 | 199 |
| 196 // Since Run() may result in Read being called, | 200 // Since Run() may result in Read being called, |
| 197 // clear user_callback_ up front. | 201 // clear user_callback_ up front. |
| 198 base::ResetAndReturn(&user_callback_).Run(result); | 202 base::ResetAndReturn(&user_callback_).Run(result); |
| 199 } | 203 } |
| 200 | 204 |
| 201 void SOCKS5ClientSocket::OnIOComplete(int result) { | 205 void SOCKS5ClientSocket::OnIOComplete(int result) { |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 495 | 499 |
| 496 int SOCKS5ClientSocket::GetPeerAddress(IPEndPoint* address) const { | 500 int SOCKS5ClientSocket::GetPeerAddress(IPEndPoint* address) const { |
| 497 return transport_->socket()->GetPeerAddress(address); | 501 return transport_->socket()->GetPeerAddress(address); |
| 498 } | 502 } |
| 499 | 503 |
| 500 int SOCKS5ClientSocket::GetLocalAddress(IPEndPoint* address) const { | 504 int SOCKS5ClientSocket::GetLocalAddress(IPEndPoint* address) const { |
| 501 return transport_->socket()->GetLocalAddress(address); | 505 return transport_->socket()->GetLocalAddress(address); |
| 502 } | 506 } |
| 503 | 507 |
| 504 } // namespace net | 508 } // namespace net |
| OLD | NEW |