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

Side by Side Diff: chrome/browser/chromeos/web_socket_proxy.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
« no previous file with comments | « no previous file | chrome/browser/net/connection_tester.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "chrome/browser/chromeos/web_socket_proxy.h" 5 #include "chrome/browser/chromeos/web_socket_proxy.h"
6 6
7 #include <stdio.h> 7 #include <stdio.h>
8 #include <stdlib.h> 8 #include <stdlib.h>
9 #include <string.h> 9 #include <string.h>
10 10
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 #include "content/public/browser/notification_types.h" 47 #include "content/public/browser/notification_types.h"
48 #include "content/public/common/url_constants.h" 48 #include "content/public/common/url_constants.h"
49 #include "extensions/common/constants.h" 49 #include "extensions/common/constants.h"
50 #include "googleurl/src/gurl.h" 50 #include "googleurl/src/gurl.h"
51 #include "googleurl/src/url_parse.h" 51 #include "googleurl/src/url_parse.h"
52 #include "net/base/address_list.h" 52 #include "net/base/address_list.h"
53 #include "net/base/host_port_pair.h" 53 #include "net/base/host_port_pair.h"
54 #include "net/base/io_buffer.h" 54 #include "net/base/io_buffer.h"
55 #include "net/base/net_errors.h" 55 #include "net/base/net_errors.h"
56 #include "net/cert/cert_verifier.h" 56 #include "net/cert/cert_verifier.h"
57 #include "net/http/transport_security_state.h"
57 #include "net/socket/client_socket_factory.h" 58 #include "net/socket/client_socket_factory.h"
58 #include "net/socket/client_socket_handle.h" 59 #include "net/socket/client_socket_handle.h"
59 #include "net/socket/ssl_client_socket.h" 60 #include "net/socket/ssl_client_socket.h"
60 #include "net/socket/stream_socket.h" 61 #include "net/socket/stream_socket.h"
61 #include "net/ssl/ssl_config_service.h" 62 #include "net/ssl/ssl_config_service.h"
62 #include "third_party/libevent/evdns.h" 63 #include "third_party/libevent/evdns.h"
63 #include "third_party/libevent/event.h" 64 #include "third_party/libevent/event.h"
64 65
65 using content::BrowserThread; 66 using content::BrowserThread;
66 67
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after
610 return; 611 return;
611 } 612 }
612 net::ClientSocketHandle* handle = new net::ClientSocketHandle(); 613 net::ClientSocketHandle* handle = new net::ClientSocketHandle();
613 handle->set_socket(socket_.release()); 614 handle->set_socket(socket_.release());
614 net::ClientSocketFactory* factory = 615 net::ClientSocketFactory* factory =
615 net::ClientSocketFactory::GetDefaultFactory(); 616 net::ClientSocketFactory::GetDefaultFactory();
616 net::SSLClientSocketContext ssl_context; 617 net::SSLClientSocketContext ssl_context;
617 if (!cert_verifier_.get()) 618 if (!cert_verifier_.get())
618 cert_verifier_.reset(net::CertVerifier::CreateDefault()); 619 cert_verifier_.reset(net::CertVerifier::CreateDefault());
619 ssl_context.cert_verifier = cert_verifier_.get(); 620 ssl_context.cert_verifier = cert_verifier_.get();
621 if (!transport_security_state_.get())
622 transport_security_state_.reset(new net::TransportSecurityState);
623 ssl_context.transport_security_state = transport_security_state_.get();
620 socket_.reset(factory->CreateSSLClientSocket( 624 socket_.reset(factory->CreateSSLClientSocket(
621 handle, host_port_pair_, ssl_config_, ssl_context)); 625 handle, host_port_pair_, ssl_config_, ssl_context));
622 if (!socket_.get()) { 626 if (!socket_.get()) {
623 LOG(WARNING) << "Failed to create an SSL client socket."; 627 LOG(WARNING) << "Failed to create an SSL client socket.";
624 OnSSLHandshakeCompleted(net::ERR_UNEXPECTED); 628 OnSSLHandshakeCompleted(net::ERR_UNEXPECTED);
625 return; 629 return;
626 } 630 }
627 result = socket_->Connect(base::Bind(&SSLChan::OnSSLHandshakeCompleted, 631 result = socket_->Connect(base::Bind(&SSLChan::OnSSLHandshakeCompleted,
628 base::Unretained(this))); 632 base::Unretained(this)));
629 if (result != net::ERR_IO_PENDING) 633 if (result != net::ERR_IO_PENDING)
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
774 Shut(0); 778 Shut(0);
775 } 779 }
776 } 780 }
777 } 781 }
778 } 782 }
779 783
780 Phase phase_; 784 Phase phase_;
781 scoped_ptr<net::StreamSocket> socket_; 785 scoped_ptr<net::StreamSocket> socket_;
782 net::HostPortPair host_port_pair_; 786 net::HostPortPair host_port_pair_;
783 scoped_ptr<net::CertVerifier> cert_verifier_; 787 scoped_ptr<net::CertVerifier> cert_verifier_;
788 scoped_ptr<net::TransportSecurityState> transport_security_state_;
784 net::SSLConfig ssl_config_; 789 net::SSLConfig ssl_config_;
785 IOBufferQueue inbound_stream_; 790 IOBufferQueue inbound_stream_;
786 IOBufferQueue outbound_stream_; 791 IOBufferQueue outbound_stream_;
787 int read_pipe_; 792 int read_pipe_;
788 int write_pipe_; 793 int write_pipe_;
789 bool is_socket_read_pending_; 794 bool is_socket_read_pending_;
790 bool is_socket_write_pending_; 795 bool is_socket_write_pending_;
791 bool is_read_pipe_blocked_; 796 bool is_read_pipe_blocked_;
792 bool is_write_pipe_blocked_; 797 bool is_write_pipe_blocked_;
793 base::WeakPtrFactory<SSLChan> weak_factory_; 798 base::WeakPtrFactory<SSLChan> weak_factory_;
(...skipping 1107 matching lines...) Expand 10 before | Expand all | Expand 10 after
1901 1906
1902 void WebSocketProxy::Shutdown() { 1907 void WebSocketProxy::Shutdown() {
1903 static_cast<Serv*>(impl_)->Shutdown(); 1908 static_cast<Serv*>(impl_)->Shutdown();
1904 } 1909 }
1905 1910
1906 void WebSocketProxy::OnNetworkChange() { 1911 void WebSocketProxy::OnNetworkChange() {
1907 static_cast<Serv*>(impl_)->OnNetworkChange(); 1912 static_cast<Serv*>(impl_)->OnNetworkChange();
1908 } 1913 }
1909 1914
1910 } // namespace chromeos 1915 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/net/connection_tester.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698