OLD | NEW |
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 #ifndef CONTENT_BROWSER_SSL_SSL_HOST_STATE_H_ | 5 #ifndef CONTENT_BROWSER_SSL_SSL_HOST_STATE_H_ |
6 #define CONTENT_BROWSER_SSL_SSL_HOST_STATE_H_ | 6 #define CONTENT_BROWSER_SSL_SSL_HOST_STATE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 | 51 |
52 // Records that |cert| is permitted to be used for |host| in the future, for | 52 // Records that |cert| is permitted to be used for |host| in the future, for |
53 // a specified |error| type. | 53 // a specified |error| type. |
54 void AllowCertForHost(net::X509Certificate* cert, | 54 void AllowCertForHost(net::X509Certificate* cert, |
55 const std::string& host, | 55 const std::string& host, |
56 net::CertStatus error); | 56 net::CertStatus error); |
57 | 57 |
58 // Clear all allow/deny preferences. | 58 // Clear all allow/deny preferences. |
59 void Clear(); | 59 void Clear(); |
60 | 60 |
| 61 // Revoke all allow/deny preferences for a given host. May close idle |
| 62 // HTTP/HTTPS connections in the process. |
| 63 void RevokeAllowAndDenyPreferences(const std::string& host); |
| 64 |
| 65 bool HasAllowedOrDeniedCert(const std::string& host); |
| 66 |
61 // Queries whether |cert| is allowed or denied for |host| and |error|. | 67 // Queries whether |cert| is allowed or denied for |host| and |error|. |
62 net::CertPolicy::Judgment QueryPolicy(net::X509Certificate* cert, | 68 net::CertPolicy::Judgment QueryPolicy(net::X509Certificate* cert, |
63 const std::string& host, | 69 const std::string& host, |
64 net::CertStatus error); | 70 net::CertStatus error); |
65 | 71 |
66 private: | 72 private: |
67 // A BrokenHostEntry is a pair of (host, process_id) that indicates the host | 73 // A BrokenHostEntry is a pair of (host, process_id) that indicates the host |
68 // contains insecure content in that renderer process. | 74 // contains insecure content in that renderer process. |
69 typedef std::pair<std::string, int> BrokenHostEntry; | 75 typedef std::pair<std::string, int> BrokenHostEntry; |
70 | 76 |
71 // Hosts which have been contaminated with insecure content in the | 77 // Hosts which have been contaminated with insecure content in the |
72 // specified process. Note that insecure content can travel between | 78 // specified process. Note that insecure content can travel between |
73 // same-origin frames in one processs but cannot jump between processes. | 79 // same-origin frames in one processs but cannot jump between processes. |
74 std::set<BrokenHostEntry> ran_insecure_content_hosts_; | 80 std::set<BrokenHostEntry> ran_insecure_content_hosts_; |
75 | 81 |
76 // Certificate policies for each host. | 82 // Certificate policies for each host. |
77 std::map<std::string, net::CertPolicy> cert_policy_for_host_; | 83 std::map<std::string, net::CertPolicy> cert_policy_for_host_; |
78 | 84 |
| 85 // BrowserContext that the state was created on. |
| 86 BrowserContext* browser_context_; |
| 87 |
79 DISALLOW_COPY_AND_ASSIGN(SSLHostState); | 88 DISALLOW_COPY_AND_ASSIGN(SSLHostState); |
80 }; | 89 }; |
81 | 90 |
82 } // namespace content | 91 } // namespace content |
83 | 92 |
84 #endif // CONTENT_BROWSER_SSL_SSL_HOST_STATE_H_ | 93 #endif // CONTENT_BROWSER_SSL_SSL_HOST_STATE_H_ |
OLD | NEW |