| 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 "content/browser/renderer_host/pepper/pepper_tcp_socket.h" | 5 #include "content/browser/renderer_host/pepper/pepper_tcp_socket.h" |
| 6 | 6 |
| 7 #include <string.h> | 7 #include <string.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 | 145 |
| 146 scoped_ptr<net::ClientSocketHandle> handle(new net::ClientSocketHandle()); | 146 scoped_ptr<net::ClientSocketHandle> handle(new net::ClientSocketHandle()); |
| 147 handle->SetSocket(socket_.Pass()); | 147 handle->SetSocket(socket_.Pass()); |
| 148 net::ClientSocketFactory* factory = | 148 net::ClientSocketFactory* factory = |
| 149 net::ClientSocketFactory::GetDefaultFactory(); | 149 net::ClientSocketFactory::GetDefaultFactory(); |
| 150 net::HostPortPair host_port_pair(server_name, server_port); | 150 net::HostPortPair host_port_pair(server_name, server_port); |
| 151 net::SSLClientSocketContext ssl_context; | 151 net::SSLClientSocketContext ssl_context; |
| 152 ssl_context.cert_verifier = manager_->GetCertVerifier(); | 152 ssl_context.cert_verifier = manager_->GetCertVerifier(); |
| 153 ssl_context.transport_security_state = manager_->GetTransportSecurityState(); | 153 ssl_context.transport_security_state = manager_->GetTransportSecurityState(); |
| 154 socket_ = factory->CreateSSLClientSocket( | 154 socket_ = factory->CreateSSLClientSocket( |
| 155 handle.Pass(), host_port_pair, manager_->ssl_config(), ssl_context); | 155 handle.Pass(), host_port_pair, manager_->ssl_config(), NULL, ssl_context); |
| 156 if (!socket_) { | 156 if (!socket_) { |
| 157 LOG(WARNING) << "Failed to create an SSL client socket."; | 157 LOG(WARNING) << "Failed to create an SSL client socket."; |
| 158 OnSSLHandshakeCompleted(net::ERR_UNEXPECTED); | 158 OnSSLHandshakeCompleted(net::ERR_UNEXPECTED); |
| 159 return; | 159 return; |
| 160 } | 160 } |
| 161 | 161 |
| 162 int net_result = socket_->Connect( | 162 int net_result = socket_->Connect( |
| 163 base::Bind(&PepperTCPSocket::OnSSLHandshakeCompleted, | 163 base::Bind(&PepperTCPSocket::OnSSLHandshakeCompleted, |
| 164 base::Unretained(this))); | 164 base::Unretained(this))); |
| 165 if (net_result != net::ERR_IO_PENDING) | 165 if (net_result != net::ERR_IO_PENDING) |
| (...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 518 | 518 |
| 519 int net_result = socket_->Write( | 519 int net_result = socket_->Write( |
| 520 write_buffer_.get(), | 520 write_buffer_.get(), |
| 521 write_buffer_->BytesRemaining(), | 521 write_buffer_->BytesRemaining(), |
| 522 base::Bind(&PepperTCPSocket::OnWriteCompleted, base::Unretained(this))); | 522 base::Bind(&PepperTCPSocket::OnWriteCompleted, base::Unretained(this))); |
| 523 if (net_result != net::ERR_IO_PENDING) | 523 if (net_result != net::ERR_IO_PENDING) |
| 524 OnWriteCompleted(net_result); | 524 OnWriteCompleted(net_result); |
| 525 } | 525 } |
| 526 | 526 |
| 527 } // namespace content | 527 } // namespace content |
| OLD | NEW |