OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_CHROME_SSL_HOST_STATE_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_SSL_CHROME_SSL_HOST_STATE_DELEGATE_H_ |
6 #define CHROME_BROWSER_SSL_CHROME_SSL_HOST_STATE_DELEGATE_H_ | 6 #define CHROME_BROWSER_SSL_CHROME_SSL_HOST_STATE_DELEGATE_H_ |
7 | 7 |
8 #include "base/gtest_prod_util.h" | 8 #include "base/gtest_prod_util.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 virtual void DenyCert(const std::string& host, | 31 virtual void DenyCert(const std::string& host, |
32 net::X509Certificate* cert, | 32 net::X509Certificate* cert, |
33 net::CertStatus error) OVERRIDE; | 33 net::CertStatus error) OVERRIDE; |
34 virtual void AllowCert(const std::string& host, | 34 virtual void AllowCert(const std::string& host, |
35 net::X509Certificate* cert, | 35 net::X509Certificate* cert, |
36 net::CertStatus error) OVERRIDE; | 36 net::CertStatus error) OVERRIDE; |
37 virtual void Clear() OVERRIDE; | 37 virtual void Clear() OVERRIDE; |
38 virtual net::CertPolicy::Judgment QueryPolicy(const std::string& host, | 38 virtual net::CertPolicy::Judgment QueryPolicy(const std::string& host, |
39 net::X509Certificate* cert, | 39 net::X509Certificate* cert, |
40 net::CertStatus error) OVERRIDE; | 40 net::CertStatus error) OVERRIDE; |
41 virtual void RevokeAllowAndDenyPreferences(const std::string& host) OVERRIDE; | 41 virtual void HostRanInsecureContent(const std::string& host, |
42 virtual bool HasAllowedOrDeniedCert(const std::string& host) OVERRIDE; | 42 int pid) OVERRIDE; |
| 43 virtual bool DidHostRunInsecureContent(const std::string& host, |
| 44 int pid) const OVERRIDE; |
| 45 |
| 46 // ChromeSSLHostStateDelegate implementation: |
| 47 // Revoke all user decisions for |host| in the given Profile. The |
| 48 // RevokeUserDecisionsHard version may close idle connections in the process. |
| 49 // This version should be used *only* for rare events, such as a user |
| 50 // controlled button, as it may be very disruptive to the networking stack. |
| 51 virtual void RevokeUserDecisions(const std::string& host); |
| 52 virtual void RevokeUserDecisionsHard(const std::string& host); |
| 53 |
| 54 // Returns true if any decisions has been recorded for |host| for the given |
| 55 // Profile, otherwise false. |
| 56 virtual bool HasUserDecision(const std::string& host); |
43 | 57 |
44 // Called on the UI thread when the profile is about to be destroyed. | 58 // Called on the UI thread when the profile is about to be destroyed. |
45 void ShutdownOnUIThread() {} | 59 void ShutdownOnUIThread() {} |
46 | 60 |
47 protected: | 61 protected: |
48 // SetClock takes ownership of the passed in clock. | 62 // SetClock takes ownership of the passed in clock. |
49 void SetClock(scoped_ptr<base::Clock> clock); | 63 void SetClock(scoped_ptr<base::Clock> clock); |
50 | 64 |
51 private: | 65 private: |
52 FRIEND_TEST_ALL_PREFIXES(ForgetInstantlySSLHostStateDelegateTest, | 66 FRIEND_TEST_ALL_PREFIXES(ForgetInstantlySSLHostStateDelegateTest, |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 // NULL if they do not exist. | 107 // NULL if they do not exist. |
94 base::DictionaryValue* GetValidCertDecisionsDict( | 108 base::DictionaryValue* GetValidCertDecisionsDict( |
95 base::DictionaryValue* dict, | 109 base::DictionaryValue* dict, |
96 CreateDictionaryEntriesDisposition create_entries); | 110 CreateDictionaryEntriesDisposition create_entries); |
97 | 111 |
98 scoped_ptr<base::Clock> clock_; | 112 scoped_ptr<base::Clock> clock_; |
99 RememberSSLExceptionDecisionsDisposition should_remember_ssl_decisions_; | 113 RememberSSLExceptionDecisionsDisposition should_remember_ssl_decisions_; |
100 base::TimeDelta default_ssl_cert_decision_expiration_delta_; | 114 base::TimeDelta default_ssl_cert_decision_expiration_delta_; |
101 Profile* profile_; | 115 Profile* profile_; |
102 | 116 |
| 117 // A BrokenHostEntry is a pair of (host, process_id) that indicates the host |
| 118 // contains insecure content in that renderer process. |
| 119 typedef std::pair<std::string, int> BrokenHostEntry; |
| 120 |
| 121 // Hosts which have been contaminated with insecure content in the |
| 122 // specified process. Note that insecure content can travel between |
| 123 // same-origin frames in one processs but cannot jump between processes. |
| 124 std::set<BrokenHostEntry> ran_insecure_content_hosts_; |
| 125 |
103 DISALLOW_COPY_AND_ASSIGN(ChromeSSLHostStateDelegate); | 126 DISALLOW_COPY_AND_ASSIGN(ChromeSSLHostStateDelegate); |
104 }; | 127 }; |
105 | 128 |
106 #endif // CHROME_BROWSER_SSL_CHROME_SSL_HOST_STATE_DELEGATE_H_ | 129 #endif // CHROME_BROWSER_SSL_CHROME_SSL_HOST_STATE_DELEGATE_H_ |
OLD | NEW |