| 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/ssl_server_socket_nss.h" | 5 #include "net/socket/ssl_server_socket_nss.h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <winsock2.h> | 8 #include <winsock2.h> |
| 9 #endif | 9 #endif |
| 10 | 10 |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 } | 238 } |
| 239 | 239 |
| 240 int64 SSLServerSocketNSS::NumBytesRead() const { | 240 int64 SSLServerSocketNSS::NumBytesRead() const { |
| 241 return transport_socket_->NumBytesRead(); | 241 return transport_socket_->NumBytesRead(); |
| 242 } | 242 } |
| 243 | 243 |
| 244 base::TimeDelta SSLServerSocketNSS::GetConnectTimeMicros() const { | 244 base::TimeDelta SSLServerSocketNSS::GetConnectTimeMicros() const { |
| 245 return transport_socket_->GetConnectTimeMicros(); | 245 return transport_socket_->GetConnectTimeMicros(); |
| 246 } | 246 } |
| 247 | 247 |
| 248 NextProto SSLServerSocketNSS::GetNegotiatedProtocol() const { |
| 249 // NPN is not supported by this class. |
| 250 return kProtoUnknown; |
| 251 } |
| 252 |
| 248 int SSLServerSocketNSS::InitializeSSLOptions() { | 253 int SSLServerSocketNSS::InitializeSSLOptions() { |
| 249 // Transport connected, now hook it up to nss | 254 // Transport connected, now hook it up to nss |
| 250 // TODO(port): specify rx and tx buffer sizes separately | 255 // TODO(port): specify rx and tx buffer sizes separately |
| 251 nss_fd_ = memio_CreateIOLayer(kRecvBufferSize); | 256 nss_fd_ = memio_CreateIOLayer(kRecvBufferSize); |
| 252 if (nss_fd_ == NULL) { | 257 if (nss_fd_ == NULL) { |
| 253 return ERR_OUT_OF_MEMORY; // TODO(port): map NSPR error code. | 258 return ERR_OUT_OF_MEMORY; // TODO(port): map NSPR error code. |
| 254 } | 259 } |
| 255 | 260 |
| 256 // Grab pointer to buffers | 261 // Grab pointer to buffers |
| 257 nss_bufs_ = memio_GetSecret(nss_fd_); | 262 nss_bufs_ = memio_GetSecret(nss_fd_); |
| (...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 764 // Initialize the NSS SSL library in a threadsafe way. This also | 769 // Initialize the NSS SSL library in a threadsafe way. This also |
| 765 // initializes the NSS base library. | 770 // initializes the NSS base library. |
| 766 EnsureNSSSSLInit(); | 771 EnsureNSSSSLInit(); |
| 767 if (!NSS_IsInitialized()) | 772 if (!NSS_IsInitialized()) |
| 768 return ERR_UNEXPECTED; | 773 return ERR_UNEXPECTED; |
| 769 | 774 |
| 770 return OK; | 775 return OK; |
| 771 } | 776 } |
| 772 | 777 |
| 773 } // namespace net | 778 } // namespace net |
| OLD | NEW |