| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 CHROME_BROWSER_SSL_SSL_HOST_STATE_H_ | 5 #ifndef CHROME_BROWSER_SSL_SSL_HOST_STATE_H_ |
| 6 #define CHROME_BROWSER_SSL_SSL_HOST_STATE_H_ | 6 #define CHROME_BROWSER_SSL_SSL_HOST_STATE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 // Returns whether the specified host ran insecure content. | 33 // Returns whether the specified host ran insecure content. |
| 34 bool DidHostRunInsecureContent(const std::string& host, int pid) const; | 34 bool DidHostRunInsecureContent(const std::string& host, int pid) const; |
| 35 | 35 |
| 36 // Records that |cert| is permitted to be used for |host| in the future. | 36 // Records that |cert| is permitted to be used for |host| in the future. |
| 37 void DenyCertForHost(net::X509Certificate* cert, const std::string& host); | 37 void DenyCertForHost(net::X509Certificate* cert, const std::string& host); |
| 38 | 38 |
| 39 // Records that |cert| is not permitted to be used for |host| in the future. | 39 // Records that |cert| is not permitted to be used for |host| in the future. |
| 40 void AllowCertForHost(net::X509Certificate* cert, const std::string& host); | 40 void AllowCertForHost(net::X509Certificate* cert, const std::string& host); |
| 41 | 41 |
| 42 // Queries whether |cert| is allowed or denied for |host|. | 42 // Queries whether |cert| is allowed or denied for |host|. |
| 43 net::X509Certificate::Policy::Judgment QueryPolicy( | 43 net::CertPolicy::Judgment QueryPolicy( |
| 44 net::X509Certificate* cert, const std::string& host); | 44 net::X509Certificate* cert, const std::string& host); |
| 45 | 45 |
| 46 private: | 46 private: |
| 47 // A BrokenHostEntry is a pair of (host, process_id) that indicates the host | 47 // A BrokenHostEntry is a pair of (host, process_id) that indicates the host |
| 48 // contains insecure content in that renderer process. | 48 // contains insecure content in that renderer process. |
| 49 typedef std::pair<std::string, int> BrokenHostEntry; | 49 typedef std::pair<std::string, int> BrokenHostEntry; |
| 50 | 50 |
| 51 // Hosts which have been contaminated with insecure content in the | 51 // Hosts which have been contaminated with insecure content in the |
| 52 // specified process. Note that insecure content can travel between | 52 // specified process. Note that insecure content can travel between |
| 53 // same-origin frames in one processs but cannot jump between processes. | 53 // same-origin frames in one processs but cannot jump between processes. |
| 54 std::set<BrokenHostEntry> ran_insecure_content_hosts_; | 54 std::set<BrokenHostEntry> ran_insecure_content_hosts_; |
| 55 | 55 |
| 56 // Certificate policies for each host. | 56 // Certificate policies for each host. |
| 57 std::map<std::string, net::X509Certificate::Policy> cert_policy_for_host_; | 57 std::map<std::string, net::CertPolicy> cert_policy_for_host_; |
| 58 | 58 |
| 59 DISALLOW_COPY_AND_ASSIGN(SSLHostState); | 59 DISALLOW_COPY_AND_ASSIGN(SSLHostState); |
| 60 }; | 60 }; |
| 61 | 61 |
| 62 #endif // CHROME_BROWSER_SSL_SSL_HOST_STATE_H_ | 62 #endif // CHROME_BROWSER_SSL_SSL_HOST_STATE_H_ |
| OLD | NEW |