Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(31)

Unified Diff: net/http/transport_security_state.cc

Issue 16501002: Give more request types a TransportSecurityState. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Enforce CalledOnValidThread in all non-static methods. Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/http/http_stream_factory_impl_unittest.cc ('k') | net/proxy/proxy_script_fetcher_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « net/http/http_stream_factory_impl_unittest.cc ('k') | net/proxy/proxy_script_fetcher_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698