| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/ssl_client_socket_win.h" | 5 #include "net/socket/ssl_client_socket_win.h" |
| 6 | 6 |
| 7 #include <schnlsp.h> | 7 #include <schnlsp.h> |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 713 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 724 } | 724 } |
| 725 | 725 |
| 726 bool SSLClientSocketWin::UsingTCPFastOpen() const { | 726 bool SSLClientSocketWin::UsingTCPFastOpen() const { |
| 727 if (transport_.get() && transport_->socket()) { | 727 if (transport_.get() && transport_->socket()) { |
| 728 return transport_->socket()->UsingTCPFastOpen(); | 728 return transport_->socket()->UsingTCPFastOpen(); |
| 729 } | 729 } |
| 730 NOTREACHED(); | 730 NOTREACHED(); |
| 731 return false; | 731 return false; |
| 732 } | 732 } |
| 733 | 733 |
| 734 int64 SSLClientSocketWin::NumBytesRead() const { | |
| 735 if (transport_.get() && transport_->socket()) { | |
| 736 return transport_->socket()->NumBytesRead(); | |
| 737 } | |
| 738 NOTREACHED(); | |
| 739 return -1; | |
| 740 } | |
| 741 | |
| 742 base::TimeDelta SSLClientSocketWin::GetConnectTimeMicros() const { | |
| 743 if (transport_.get() && transport_->socket()) { | |
| 744 return transport_->socket()->GetConnectTimeMicros(); | |
| 745 } | |
| 746 NOTREACHED(); | |
| 747 return base::TimeDelta::FromMicroseconds(-1); | |
| 748 } | |
| 749 | |
| 750 int SSLClientSocketWin::Read(IOBuffer* buf, int buf_len, | 734 int SSLClientSocketWin::Read(IOBuffer* buf, int buf_len, |
| 751 CompletionCallback* callback) { | 735 CompletionCallback* callback) { |
| 752 DCHECK(completed_handshake()); | 736 DCHECK(completed_handshake()); |
| 753 DCHECK(!user_read_callback_); | 737 DCHECK(!user_read_callback_); |
| 754 | 738 |
| 755 // If we have surplus decrypted plaintext, satisfy the Read with it without | 739 // If we have surplus decrypted plaintext, satisfy the Read with it without |
| 756 // reading more ciphertext from the transport socket. | 740 // reading more ciphertext from the transport socket. |
| 757 if (bytes_decrypted_ != 0) { | 741 if (bytes_decrypted_ != 0) { |
| 758 int len = std::min(buf_len, bytes_decrypted_); | 742 int len = std::min(buf_len, bytes_decrypted_); |
| 759 net_log_.AddByteTransferEvent(NetLog::TYPE_SSL_SOCKET_BYTES_RECEIVED, len, | 743 net_log_.AddByteTransferEvent(NetLog::TYPE_SSL_SOCKET_BYTES_RECEIVED, len, |
| (...skipping 786 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1546 UpdateConnectionTypeHistograms(CONNECTION_SSL_MD2_CA); | 1530 UpdateConnectionTypeHistograms(CONNECTION_SSL_MD2_CA); |
| 1547 } | 1531 } |
| 1548 | 1532 |
| 1549 void SSLClientSocketWin::FreeSendBuffer() { | 1533 void SSLClientSocketWin::FreeSendBuffer() { |
| 1550 SECURITY_STATUS status = FreeContextBuffer(send_buffer_.pvBuffer); | 1534 SECURITY_STATUS status = FreeContextBuffer(send_buffer_.pvBuffer); |
| 1551 DCHECK(status == SEC_E_OK); | 1535 DCHECK(status == SEC_E_OK); |
| 1552 memset(&send_buffer_, 0, sizeof(send_buffer_)); | 1536 memset(&send_buffer_, 0, sizeof(send_buffer_)); |
| 1553 } | 1537 } |
| 1554 | 1538 |
| 1555 } // namespace net | 1539 } // namespace net |
| OLD | NEW |