Index: net/http/transport_security_state.cc |
diff --git a/net/http/transport_security_state.cc b/net/http/transport_security_state.cc |
index f4d5916675e3f033ebde2f7a49ace39270f19e32..ab678ee99aaca6021dee3bb32eba69b14e7be97a 100644 |
--- a/net/http/transport_security_state.cc |
+++ b/net/http/transport_security_state.cc |
@@ -85,6 +85,7 @@ bool AddHash(const char* sha1_hash, |
TransportSecurityState::TransportSecurityState() |
: delegate_(NULL) { |
+ DCHECK(CalledOnValidThread()); |
} |
TransportSecurityState::Iterator::Iterator(const TransportSecurityState& state) |
@@ -96,6 +97,7 @@ TransportSecurityState::Iterator::~Iterator() {} |
void TransportSecurityState::SetDelegate( |
TransportSecurityState::Delegate* delegate) { |
+ DCHECK(CalledOnValidThread()); |
delegate_ = delegate; |
} |
@@ -197,6 +199,7 @@ bool TransportSecurityState::GetDomainState(const std::string& host, |
} |
void TransportSecurityState::ClearDynamicData() { |
+ DCHECK(CalledOnValidThread()); |
enabled_hosts_.clear(); |
} |
@@ -219,7 +222,9 @@ void TransportSecurityState::DeleteAllDynamicDataSince(const base::Time& time) { |
DirtyNotify(); |
} |
-TransportSecurityState::~TransportSecurityState() {} |
+TransportSecurityState::~TransportSecurityState() { |
+ DCHECK(CalledOnValidThread()); |
+} |
void TransportSecurityState::DirtyNotify() { |
DCHECK(CalledOnValidThread()); |
@@ -613,6 +618,8 @@ static const struct HSTSPreload* GetHSTSPreload( |
bool TransportSecurityState::AddHSTSHeader(const std::string& host, |
const std::string& value) { |
+ DCHECK(CalledOnValidThread()); |
+ |
base::Time now = base::Time::Now(); |
base::TimeDelta max_age; |
TransportSecurityState::DomainState domain_state; |
@@ -633,6 +640,8 @@ bool TransportSecurityState::AddHSTSHeader(const std::string& host, |
bool TransportSecurityState::AddHPKPHeader(const std::string& host, |
const std::string& value, |
const SSLInfo& ssl_info) { |
+ DCHECK(CalledOnValidThread()); |
+ |
base::Time now = base::Time::Now(); |
base::TimeDelta max_age; |
TransportSecurityState::DomainState domain_state; |
@@ -651,6 +660,8 @@ bool TransportSecurityState::AddHPKPHeader(const std::string& host, |
bool TransportSecurityState::AddHSTS(const std::string& host, |
const base::Time& expiry, |
bool include_subdomains) { |
+ DCHECK(CalledOnValidThread()); |
+ |
// Copy-and-modify the existing DomainState for this host (if any). |
TransportSecurityState::DomainState domain_state; |
const std::string canonicalized_host = CanonicalizeHost(host); |
@@ -672,6 +683,8 @@ bool TransportSecurityState::AddHPKP(const std::string& host, |
const base::Time& expiry, |
bool include_subdomains, |
const HashValueVector& hashes) { |
+ DCHECK(CalledOnValidThread()); |
+ |
// Copy-and-modify the existing DomainState for this host (if any). |
TransportSecurityState::DomainState domain_state; |
const std::string canonicalized_host = CanonicalizeHost(host); |
@@ -775,6 +788,7 @@ bool TransportSecurityState::GetStaticDomainState( |
void TransportSecurityState::AddOrUpdateEnabledHosts( |
const std::string& hashed_host, const DomainState& state) { |
+ DCHECK(CalledOnValidThread()); |
enabled_hosts_[hashed_host] = state; |
} |