Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(76)

Side by Side Diff: chrome/browser/extensions/api/cast_channel/cast_socket.cc

Issue 135373002: Added SSLHostInfo. Storing of server host info to our standard disk cache. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge with TOT Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "chrome/browser/extensions/api/cast_channel/cast_socket.h" 5 #include "chrome/browser/extensions/api/cast_channel/cast_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/callback_helpers.h" 10 #include "base/callback_helpers.h"
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 // context object. 128 // context object.
129 context.cert_verifier = cert_verifier_.get(); 129 context.cert_verifier = cert_verifier_.get();
130 context.transport_security_state = transport_security_state_.get(); 130 context.transport_security_state = transport_security_state_.get();
131 131
132 scoped_ptr<net::ClientSocketHandle> connection(new net::ClientSocketHandle); 132 scoped_ptr<net::ClientSocketHandle> connection(new net::ClientSocketHandle);
133 connection->SetSocket(tcp_socket_.PassAs<net::StreamSocket>()); 133 connection->SetSocket(tcp_socket_.PassAs<net::StreamSocket>());
134 net::HostPortPair host_and_port = net::HostPortPair::FromIPEndPoint( 134 net::HostPortPair host_and_port = net::HostPortPair::FromIPEndPoint(
135 ip_endpoint_); 135 ip_endpoint_);
136 136
137 return net::ClientSocketFactory::GetDefaultFactory()->CreateSSLClientSocket( 137 return net::ClientSocketFactory::GetDefaultFactory()->CreateSSLClientSocket(
138 connection.Pass(), host_and_port, ssl_config, context); 138 connection.Pass(), host_and_port, ssl_config, NULL, context);
139 } 139 }
140 140
141 bool CastSocket::ExtractPeerCert(std::string* cert) { 141 bool CastSocket::ExtractPeerCert(std::string* cert) {
142 DCHECK(cert); 142 DCHECK(cert);
143 DCHECK(peer_cert_.empty()); 143 DCHECK(peer_cert_.empty());
144 net::SSLInfo ssl_info; 144 net::SSLInfo ssl_info;
145 if (!socket_->GetSSLInfo(&ssl_info) || !ssl_info.cert.get()) 145 if (!socket_->GetSSLInfo(&ssl_info) || !ssl_info.cert.get())
146 return false; 146 return false;
147 bool result = net::X509Certificate::GetDEREncoded( 147 bool result = net::X509Certificate::GetDEREncoded(
148 ssl_info.cert->os_cert_handle(), cert); 148 ssl_info.cert->os_cert_handle(), cert);
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after
670 io_buffer = new net::DrainableIOBuffer(new net::StringIOBuffer(message_data), 670 io_buffer = new net::DrainableIOBuffer(new net::StringIOBuffer(message_data),
671 message_data.size()); 671 message_data.size());
672 return true; 672 return true;
673 } 673 }
674 674
675 CastSocket::WriteRequest::~WriteRequest() { } 675 CastSocket::WriteRequest::~WriteRequest() { }
676 676
677 } // namespace cast_channel 677 } // namespace cast_channel
678 } // namespace api 678 } // namespace api
679 } // namespace extensions 679 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698