Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 IOS_WEB_NET_CERT_HOST_PAIR_H_ | 5 #ifndef IOS_WEB_NET_CERT_HOST_PAIR_H_ |
| 6 #define IOS_WEB_NET_CERT_HOST_PAIR_H_ | 6 #define IOS_WEB_NET_CERT_HOST_PAIR_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| 11 #include "net/base/hash_value.h" | |
| 11 | 12 |
| 12 namespace net { | 13 namespace net { |
| 13 class X509Certificate; | 14 class X509Certificate; |
| 14 } | 15 } |
| 15 | 16 |
| 16 namespace web { | 17 namespace web { |
| 17 | 18 |
| 18 // Holds certificate-host pair. Implements operator less, hence can act as a key | 19 // Holds certificate-host pair. Implements operator less, hence can act as a key |
| 19 // for a container. | 20 // for a container. |
| 20 struct CertHostPair { | 21 struct CertHostPair { |
| 21 CertHostPair(const scoped_refptr<net::X509Certificate>& cert, | 22 CertHostPair(const scoped_refptr<net::X509Certificate>& cert, |
| 22 const std::string& host); | 23 const std::string& host); |
| 23 CertHostPair(const CertHostPair& other); | 24 CertHostPair(const CertHostPair& other); |
| 24 ~CertHostPair(); | 25 ~CertHostPair(); |
| 25 | 26 |
| 26 bool operator<(const CertHostPair& other) const; | 27 bool operator<(const CertHostPair& other) const; |
| 27 | 28 |
| 28 scoped_refptr<net::X509Certificate> cert; | 29 scoped_refptr<net::X509Certificate> cert; |
| 29 std::string host; | 30 std::string host; |
| 31 const net::SHA256HashValue cert_hash; | |
|
Eugene But (OOO till 7-30)
2016/06/16 01:14:34
Should |cert| field be private or at least const?
Ryan Sleevi
2016/06/16 01:19:44
Actually making CertHostPair a proper class, with
Eugene But (OOO till 7-30)
2016/06/16 01:36:23
That sounds even better and totally reasonable to
| |
| 30 }; | 32 }; |
| 31 | 33 |
| 32 } // namespace web | 34 } // namespace web |
| 33 | 35 |
| 34 #endif // IOS_WEB_NET_CERT_HOST_PAIR_H_ | 36 #endif // IOS_WEB_NET_CERT_HOST_PAIR_H_ |
| OLD | NEW |