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

Side by Side Diff: content/browser/renderer_host/pepper/pepper_tcp_socket.cc

Issue 16501002: Give more request types a TransportSecurityState. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Enforce CalledOnValidThread in all non-static methods. Created 7 years, 6 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 (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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 connection_state_ = SSL_HANDSHAKE_IN_PROGRESS; 131 connection_state_ = SSL_HANDSHAKE_IN_PROGRESS;
132 // TODO(raymes,rsleevi): Use trusted/untrusted certificates when connecting. 132 // TODO(raymes,rsleevi): Use trusted/untrusted certificates when connecting.
133 133
134 net::ClientSocketHandle* handle = new net::ClientSocketHandle(); 134 net::ClientSocketHandle* handle = new net::ClientSocketHandle();
135 handle->set_socket(socket_.release()); 135 handle->set_socket(socket_.release());
136 net::ClientSocketFactory* factory = 136 net::ClientSocketFactory* factory =
137 net::ClientSocketFactory::GetDefaultFactory(); 137 net::ClientSocketFactory::GetDefaultFactory();
138 net::HostPortPair host_port_pair(server_name, server_port); 138 net::HostPortPair host_port_pair(server_name, server_port);
139 net::SSLClientSocketContext ssl_context; 139 net::SSLClientSocketContext ssl_context;
140 ssl_context.cert_verifier = manager_->GetCertVerifier(); 140 ssl_context.cert_verifier = manager_->GetCertVerifier();
141 ssl_context.transport_security_state = manager_->GetTransportSecurityState();
141 socket_.reset(factory->CreateSSLClientSocket( 142 socket_.reset(factory->CreateSSLClientSocket(
142 handle, host_port_pair, manager_->ssl_config(), ssl_context)); 143 handle, host_port_pair, manager_->ssl_config(), ssl_context));
143 if (!socket_) { 144 if (!socket_) {
144 LOG(WARNING) << "Failed to create an SSL client socket."; 145 LOG(WARNING) << "Failed to create an SSL client socket.";
145 OnSSLHandshakeCompleted(net::ERR_UNEXPECTED); 146 OnSSLHandshakeCompleted(net::ERR_UNEXPECTED);
146 return; 147 return;
147 } 148 }
148 149
149 int result = socket_->Connect( 150 int result = socket_->Connect(
150 base::Bind(&PepperTCPSocket::OnSSLHandshakeCompleted, 151 base::Bind(&PepperTCPSocket::OnSSLHandshakeCompleted,
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
447 448
448 int result = socket_->Write( 449 int result = socket_->Write(
449 write_buffer_.get(), 450 write_buffer_.get(),
450 write_buffer_->BytesRemaining(), 451 write_buffer_->BytesRemaining(),
451 base::Bind(&PepperTCPSocket::OnWriteCompleted, base::Unretained(this))); 452 base::Bind(&PepperTCPSocket::OnWriteCompleted, base::Unretained(this)));
452 if (result != net::ERR_IO_PENDING) 453 if (result != net::ERR_IO_PENDING)
453 OnWriteCompleted(result); 454 OnWriteCompleted(result);
454 } 455 }
455 456
456 } // namespace content 457 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/pepper/pepper_message_filter.cc ('k') | content/shell/shell_url_request_context_getter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698