| Index: chrome/browser/ssl/chrome_ssl_host_state_delegate.cc
|
| diff --git a/chrome/browser/ssl/chrome_ssl_host_state_delegate.cc b/chrome/browser/ssl/chrome_ssl_host_state_delegate.cc
|
| index e539310640e7ab1e837171f00e672c08ca936984..3f84971fdb235a67001cb8eb19ec57dd54847e87 100644
|
| --- a/chrome/browser/ssl/chrome_ssl_host_state_delegate.cc
|
| +++ b/chrome/browser/ssl/chrome_ssl_host_state_delegate.cc
|
| @@ -9,6 +9,7 @@
|
| #include "base/logging.h"
|
| #include "base/metrics/field_trial.h"
|
| #include "base/strings/string_number_conversions.h"
|
| +#include "base/threading/non_thread_safe.h"
|
| #include "base/time/clock.h"
|
| #include "base/time/default_clock.h"
|
| #include "base/time/time.h"
|
| @@ -240,16 +241,19 @@ ChromeSSLHostStateDelegate::~ChromeSSLHostStateDelegate() {
|
| void ChromeSSLHostStateDelegate::DenyCert(const std::string& host,
|
| net::X509Certificate* cert,
|
| net::CertStatus error) {
|
| + DCHECK(CalledOnValidThread());
|
| ChangeCertPolicy(host, cert, error, net::CertPolicy::DENIED);
|
| }
|
|
|
| void ChromeSSLHostStateDelegate::AllowCert(const std::string& host,
|
| net::X509Certificate* cert,
|
| net::CertStatus error) {
|
| + DCHECK(CalledOnValidThread());
|
| ChangeCertPolicy(host, cert, error, net::CertPolicy::ALLOWED);
|
| }
|
|
|
| void ChromeSSLHostStateDelegate::Clear() {
|
| + DCHECK(CalledOnValidThread());
|
| profile_->GetHostContentSettingsMap()->ClearSettingsForOneType(
|
| CONTENT_SETTINGS_TYPE_SSL_CERT_DECISIONS);
|
| }
|
| @@ -258,6 +262,7 @@ net::CertPolicy::Judgment ChromeSSLHostStateDelegate::QueryPolicy(
|
| const std::string& host,
|
| net::X509Certificate* cert,
|
| net::CertStatus error) {
|
| + DCHECK(CalledOnValidThread());
|
| HostContentSettingsMap* map = profile_->GetHostContentSettingsMap();
|
| GURL url = GetSecureGURLForHost(host);
|
| scoped_ptr<base::Value> value(map->GetWebsiteSetting(
|
| @@ -292,6 +297,7 @@ net::CertPolicy::Judgment ChromeSSLHostStateDelegate::QueryPolicy(
|
|
|
| void ChromeSSLHostStateDelegate::RevokeAllowAndDenyPreferences(
|
| const std::string& host) {
|
| + DCHECK(CalledOnValidThread());
|
| GURL url = GetSecureGURLForHost(host);
|
| const ContentSettingsPattern pattern =
|
| ContentSettingsPattern::FromURLNoWildcard(url);
|
| @@ -306,6 +312,7 @@ void ChromeSSLHostStateDelegate::RevokeAllowAndDenyPreferences(
|
|
|
| bool ChromeSSLHostStateDelegate::HasAllowedOrDeniedCert(
|
| const std::string& host) {
|
| + DCHECK(CalledOnValidThread());
|
| GURL url = GetSecureGURLForHost(host);
|
| const ContentSettingsPattern pattern =
|
| ContentSettingsPattern::FromURLNoWildcard(url);
|
| @@ -332,7 +339,20 @@ bool ChromeSSLHostStateDelegate::HasAllowedOrDeniedCert(
|
| return false;
|
| }
|
|
|
| +void ChromeSSLHostStateDelegate::HostRanInsecureContent(const std::string& host,
|
| + int pid) {
|
| + DCHECK(CalledOnValidThread());
|
| + ran_insecure_content_hosts_.insert(BrokenHostEntry(host, pid));
|
| +}
|
| +
|
| +bool ChromeSSLHostStateDelegate::DidHostRunInsecureContent(
|
| + const std::string& host,
|
| + int pid) const {
|
| + DCHECK(CalledOnValidThread());
|
| + return !!ran_insecure_content_hosts_.count(BrokenHostEntry(host, pid));
|
| +}
|
| void ChromeSSLHostStateDelegate::SetClock(scoped_ptr<base::Clock> clock) {
|
| + DCHECK(CalledOnValidThread());
|
| clock_.reset(clock.release());
|
| }
|
|
|
|
|