| 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/gtest_prod_util.h" |
| 10 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "net/base/hash_value.h" |
| 11 | 13 |
| 12 namespace net { | 14 namespace net { |
| 13 class X509Certificate; | 15 class X509Certificate; |
| 14 } | 16 } |
| 15 | 17 |
| 16 namespace web { | 18 namespace web { |
| 17 | 19 |
| 18 // Holds certificate-host pair. Implements operator less, hence can act as a key | 20 // Holds certificate-host pair. Implements operator less, hence can act as a key |
| 19 // for a container. | 21 // for a container. |
| 20 struct CertHostPair { | 22 class CertHostPair { |
| 21 CertHostPair(const scoped_refptr<net::X509Certificate>& cert, | 23 public: |
| 22 const std::string& host); | 24 CertHostPair(scoped_refptr<net::X509Certificate> cert, std::string host); |
| 23 CertHostPair(const CertHostPair& other); | 25 CertHostPair(const CertHostPair& other); |
| 24 ~CertHostPair(); | 26 ~CertHostPair(); |
| 25 | 27 |
| 26 bool operator<(const CertHostPair& other) const; | 28 bool operator<(const CertHostPair& other) const; |
| 27 | 29 |
| 28 scoped_refptr<net::X509Certificate> cert; | 30 private: |
| 29 std::string host; | 31 FRIEND_TEST_ALL_PREFIXES(CertHostPairTest, Construction); |
| 32 |
| 33 const scoped_refptr<net::X509Certificate> cert_; |
| 34 const std::string host_; |
| 35 const net::SHA256HashValue cert_hash_; |
| 30 }; | 36 }; |
| 31 | 37 |
| 32 } // namespace web | 38 } // namespace web |
| 33 | 39 |
| 34 #endif // IOS_WEB_NET_CERT_HOST_PAIR_H_ | 40 #endif // IOS_WEB_NET_CERT_HOST_PAIR_H_ |
| OLD | NEW |