OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef BLIMP_NET_SSL_CLIENT_TRANSPORT_H_ | 5 #ifndef BLIMP_NET_SSL_CLIENT_TRANSPORT_H_ |
6 #define BLIMP_NET_SSL_CLIENT_TRANSPORT_H_ | 6 #define BLIMP_NET_SSL_CLIENT_TRANSPORT_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 11 matching lines...) Expand all Loading... |
22 class ClientSocketFactory; | 22 class ClientSocketFactory; |
23 class NetLog; | 23 class NetLog; |
24 class StreamSocket; | 24 class StreamSocket; |
25 class TCPClientSocket; | 25 class TCPClientSocket; |
26 class TransportSecurityState; | 26 class TransportSecurityState; |
27 } // namespace net | 27 } // namespace net |
28 | 28 |
29 namespace blimp { | 29 namespace blimp { |
30 | 30 |
31 class BlimpConnection; | 31 class BlimpConnection; |
| 32 class BlimpConnectionStatistics; |
32 | 33 |
33 // Creates and connects SSL socket connections to an Engine. | 34 // Creates and connects SSL socket connections to an Engine. |
34 class BLIMP_NET_EXPORT SSLClientTransport : public TCPClientTransport { | 35 class BLIMP_NET_EXPORT SSLClientTransport : public TCPClientTransport { |
35 public: | 36 public: |
36 // |ip_endpoint|: the address to connect to. | 37 // |ip_endpoint|: the address to connect to. |
37 // |cert|: the certificate required from the remote peer. | 38 // |cert|: the certificate required from the remote peer. |
38 // SSL connections that use different certificates are rejected. | 39 // SSL connections that use different certificates are rejected. |
39 // |net_log|: the socket event log (optional). | 40 // |net_log|: the socket event log (optional). |
40 SSLClientTransport(const net::IPEndPoint& ip_endpoint, | 41 SSLClientTransport(const net::IPEndPoint& ip_endpoint, |
41 scoped_refptr<net::X509Certificate> cert, | 42 scoped_refptr<net::X509Certificate> cert, |
| 43 BlimpConnectionStatistics* statistics, |
42 net::NetLog* net_log); | 44 net::NetLog* net_log); |
43 | 45 |
44 ~SSLClientTransport() override; | 46 ~SSLClientTransport() override; |
45 | 47 |
46 // BlimpTransport implementation. | 48 // BlimpTransport implementation. |
47 const char* GetName() const override; | 49 const char* GetName() const override; |
48 | 50 |
49 private: | 51 private: |
50 // Method called after TCPClientSocket::Connect finishes. | 52 // Method called after TCPClientSocket::Connect finishes. |
51 void OnTCPConnectComplete(int result) override; | 53 void OnTCPConnectComplete(int result) override; |
52 | 54 |
53 // Method called after SSLClientSocket::Connect finishes. | 55 // Method called after SSLClientSocket::Connect finishes. |
54 void OnSSLConnectComplete(int result); | 56 void OnSSLConnectComplete(int result); |
55 | 57 |
56 net::IPEndPoint ip_endpoint_; | 58 net::IPEndPoint ip_endpoint_; |
57 std::unique_ptr<ExactMatchCertVerifier> cert_verifier_; | 59 std::unique_ptr<ExactMatchCertVerifier> cert_verifier_; |
58 net::TransportSecurityState transport_security_state_; | 60 net::TransportSecurityState transport_security_state_; |
59 | 61 |
60 DISALLOW_COPY_AND_ASSIGN(SSLClientTransport); | 62 DISALLOW_COPY_AND_ASSIGN(SSLClientTransport); |
61 }; | 63 }; |
62 | 64 |
63 } // namespace blimp | 65 } // namespace blimp |
64 | 66 |
65 #endif // BLIMP_NET_SSL_CLIENT_TRANSPORT_H_ | 67 #endif // BLIMP_NET_SSL_CLIENT_TRANSPORT_H_ |
OLD | NEW |