| 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 "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/sys_byteorder.h" | 10 #include "base/sys_byteorder.h" |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 } | 157 } |
| 158 | 158 |
| 159 bool SOCKSClientSocket::UsingTCPFastOpen() const { | 159 bool SOCKSClientSocket::UsingTCPFastOpen() const { |
| 160 if (transport_.get() && transport_->socket()) { | 160 if (transport_.get() && transport_->socket()) { |
| 161 return transport_->socket()->UsingTCPFastOpen(); | 161 return transport_->socket()->UsingTCPFastOpen(); |
| 162 } | 162 } |
| 163 NOTREACHED(); | 163 NOTREACHED(); |
| 164 return false; | 164 return false; |
| 165 } | 165 } |
| 166 | 166 |
| 167 int64 SOCKSClientSocket::NumBytesRead() const { | |
| 168 if (transport_.get() && transport_->socket()) { | |
| 169 return transport_->socket()->NumBytesRead(); | |
| 170 } | |
| 171 NOTREACHED(); | |
| 172 return -1; | |
| 173 } | |
| 174 | |
| 175 base::TimeDelta SOCKSClientSocket::GetConnectTimeMicros() const { | |
| 176 if (transport_.get() && transport_->socket()) { | |
| 177 return transport_->socket()->GetConnectTimeMicros(); | |
| 178 } | |
| 179 NOTREACHED(); | |
| 180 return base::TimeDelta::FromMicroseconds(-1); | |
| 181 } | |
| 182 | |
| 183 bool SOCKSClientSocket::WasNpnNegotiated() const { | 167 bool SOCKSClientSocket::WasNpnNegotiated() const { |
| 184 if (transport_.get() && transport_->socket()) { | 168 if (transport_.get() && transport_->socket()) { |
| 185 return transport_->socket()->WasNpnNegotiated(); | 169 return transport_->socket()->WasNpnNegotiated(); |
| 186 } | 170 } |
| 187 NOTREACHED(); | 171 NOTREACHED(); |
| 188 return false; | 172 return false; |
| 189 } | 173 } |
| 190 | 174 |
| 191 NextProto SOCKSClientSocket::GetNegotiatedProtocol() const { | 175 NextProto SOCKSClientSocket::GetNegotiatedProtocol() const { |
| 192 if (transport_.get() && transport_->socket()) { | 176 if (transport_.get() && transport_->socket()) { |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 | 434 |
| 451 int SOCKSClientSocket::GetPeerAddress(IPEndPoint* address) const { | 435 int SOCKSClientSocket::GetPeerAddress(IPEndPoint* address) const { |
| 452 return transport_->socket()->GetPeerAddress(address); | 436 return transport_->socket()->GetPeerAddress(address); |
| 453 } | 437 } |
| 454 | 438 |
| 455 int SOCKSClientSocket::GetLocalAddress(IPEndPoint* address) const { | 439 int SOCKSClientSocket::GetLocalAddress(IPEndPoint* address) const { |
| 456 return transport_->socket()->GetLocalAddress(address); | 440 return transport_->socket()->GetLocalAddress(address); |
| 457 } | 441 } |
| 458 | 442 |
| 459 } // namespace net | 443 } // namespace net |
| OLD | NEW |