| 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 <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 const net::X509Certificate& cert, | 33 const net::X509Certificate& cert, |
| 34 net::CertStatus error) override; | 34 net::CertStatus error) override; |
| 35 void Clear() override; | 35 void Clear() override; |
| 36 CertJudgment QueryPolicy(const std::string& host, | 36 CertJudgment QueryPolicy(const std::string& host, |
| 37 const net::X509Certificate& cert, | 37 const net::X509Certificate& cert, |
| 38 net::CertStatus error, | 38 net::CertStatus error, |
| 39 bool* expired_previous_decision) override; | 39 bool* expired_previous_decision) override; |
| 40 void HostRanInsecureContent(const std::string& host, int pid) override; | 40 void HostRanInsecureContent(const std::string& host, int pid) override; |
| 41 bool DidHostRunInsecureContent(const std::string& host, | 41 bool DidHostRunInsecureContent(const std::string& host, |
| 42 int pid) const override; | 42 int pid) const override; |
| 43 void HostRanContentWithCertificateErrors(const std::string& host, |
| 44 int pid) override; |
| 45 bool DidHostRunContentWithCertificateErrors(const std::string& host, |
| 46 int pid) const override; |
| 43 | 47 |
| 44 // Revokes all SSL certificate error allow exceptions made by the user for | 48 // Revokes all SSL certificate error allow exceptions made by the user for |
| 45 // |host| in the given Profile. | 49 // |host| in the given Profile. |
| 46 void RevokeUserAllowExceptions(const std::string& host) override; | 50 void RevokeUserAllowExceptions(const std::string& host) override; |
| 47 | 51 |
| 48 // RevokeUserAllowExceptionsHard is the same as RevokeUserAllowExceptions but | 52 // RevokeUserAllowExceptionsHard is the same as RevokeUserAllowExceptions but |
| 49 // additionally may close idle connections in the process. This should be used | 53 // additionally may close idle connections in the process. This should be used |
| 50 // *only* for rare events, such as a user controlled button, as it may be very | 54 // *only* for rare events, such as a user controlled button, as it may be very |
| 51 // disruptive to the networking stack. | 55 // disruptive to the networking stack. |
| 52 virtual void RevokeUserAllowExceptionsHard(const std::string& host); | 56 virtual void RevokeUserAllowExceptionsHard(const std::string& host); |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 bool* expired_previous_decision); | 107 bool* expired_previous_decision); |
| 104 | 108 |
| 105 std::unique_ptr<base::Clock> clock_; | 109 std::unique_ptr<base::Clock> clock_; |
| 106 RememberSSLExceptionDecisionsDisposition should_remember_ssl_decisions_; | 110 RememberSSLExceptionDecisionsDisposition should_remember_ssl_decisions_; |
| 107 Profile* profile_; | 111 Profile* profile_; |
| 108 | 112 |
| 109 // A BrokenHostEntry is a pair of (host, process_id) that indicates the host | 113 // A BrokenHostEntry is a pair of (host, process_id) that indicates the host |
| 110 // contains insecure content in that renderer process. | 114 // contains insecure content in that renderer process. |
| 111 typedef std::pair<std::string, int> BrokenHostEntry; | 115 typedef std::pair<std::string, int> BrokenHostEntry; |
| 112 | 116 |
| 113 // Hosts which have been contaminated with insecure content in the | 117 // Hosts which have been contaminated with insecure (HTTP) content in the |
| 114 // specified process. Note that insecure content can travel between | 118 // specified process. Note that insecure content can travel between |
| 115 // same-origin frames in one processs but cannot jump between processes. | 119 // same-origin frames in one processs but cannot jump between processes. |
| 116 std::set<BrokenHostEntry> ran_insecure_content_hosts_; | 120 std::set<BrokenHostEntry> ran_insecure_content_hosts_; |
| 117 | 121 |
| 122 // Hosts which have been contaminated with content loaded with |
| 123 // certificate errors in the specified process. |
| 124 std::set<BrokenHostEntry> ran_content_with_certificate_errors_hosts_; |
| 125 |
| 118 // This is a GUID to mark this unique session. Whenever a certificate decision | 126 // This is a GUID to mark this unique session. Whenever a certificate decision |
| 119 // expiration is set, the GUID is saved as well so Chrome can tell if it was | 127 // expiration is set, the GUID is saved as well so Chrome can tell if it was |
| 120 // last set during the current session. This is used by the | 128 // last set during the current session. This is used by the |
| 121 // FORGET_SSL_EXCEPTION_DECISIONS_AT_SESSION_END experimental group to | 129 // FORGET_SSL_EXCEPTION_DECISIONS_AT_SESSION_END experimental group to |
| 122 // determine if the expired_previous_decision bit should be set on queries. | 130 // determine if the expired_previous_decision bit should be set on queries. |
| 123 // | 131 // |
| 124 // Why not just iterate over the set of current extensions and mark them all | 132 // Why not just iterate over the set of current extensions and mark them all |
| 125 // as expired when the session starts, rather than storing a GUID for the | 133 // as expired when the session starts, rather than storing a GUID for the |
| 126 // current session? Glad you asked! Unfortunately, content settings does not | 134 // current session? Glad you asked! Unfortunately, content settings does not |
| 127 // currently support iterating over all current *compound* content setting | 135 // currently support iterating over all current *compound* content setting |
| 128 // values (iteration only works for simple content settings). While this could | 136 // values (iteration only works for simple content settings). While this could |
| 129 // be added, it would be a fair amount of work for what amounts to a temporary | 137 // be added, it would be a fair amount of work for what amounts to a temporary |
| 130 // measurement problem, so it's not worth the complexity. | 138 // measurement problem, so it's not worth the complexity. |
| 131 // | 139 // |
| 132 // TODO(jww): This is only used by the default and disable groups of the | 140 // TODO(jww): This is only used by the default and disable groups of the |
| 133 // certificate memory decisions experiment to tell if a decision has expired | 141 // certificate memory decisions experiment to tell if a decision has expired |
| 134 // since the last session. Since this is only used for UMA purposes, this | 142 // since the last session. Since this is only used for UMA purposes, this |
| 135 // should be removed after the experiment has finished, and a call to Clear() | 143 // should be removed after the experiment has finished, and a call to Clear() |
| 136 // should be added to the constructor and destructor for members of the | 144 // should be added to the constructor and destructor for members of the |
| 137 // FORGET_SSL_EXCEPTION_DECISIONS_AT_SESSION_END groups. See | 145 // FORGET_SSL_EXCEPTION_DECISIONS_AT_SESSION_END groups. See |
| 138 // https://crbug.com/418631 for more details. | 146 // https://crbug.com/418631 for more details. |
| 139 const std::string current_expiration_guid_; | 147 const std::string current_expiration_guid_; |
| 140 | 148 |
| 141 DISALLOW_COPY_AND_ASSIGN(ChromeSSLHostStateDelegate); | 149 DISALLOW_COPY_AND_ASSIGN(ChromeSSLHostStateDelegate); |
| 142 }; | 150 }; |
| 143 | 151 |
| 144 #endif // CHROME_BROWSER_SSL_CHROME_SSL_HOST_STATE_DELEGATE_H_ | 152 #endif // CHROME_BROWSER_SSL_CHROME_SSL_HOST_STATE_DELEGATE_H_ |
| OLD | NEW |