From 4cc5a8747adf8327ba0df645237c1d5f52690caf Mon Sep 17 00:00:00 2001 From: "abarth@chromium.org" Date: Sun, 14 Mar 2010 00:16:15 +0000 Subject: Remove locks from StrictTransportSecurityState. These locks can cause the IO thread to block on the FILE thread writing to disk, which is bad news bears. BUG=21518 TEST=No behavior change. Review URL: http://codereview.chromium.org/904005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41538 0039d316-1c4b-4281-b951-d872f2087c98 --- net/base/transport_security_state.cc | 11 ----------- net/base/transport_security_state.h | 3 --- 2 files changed, 14 deletions(-) (limited to 'net') diff --git a/net/base/transport_security_state.cc b/net/base/transport_security_state.cc index d033b94..c8b86f5 100644 --- a/net/base/transport_security_state.cc +++ b/net/base/transport_security_state.cc @@ -41,8 +41,6 @@ void TransportSecurityState::EnableHost(const std::string& host, if (IsEnabledForHost(&existing_state, host)) state_copy.created = existing_state.created; - AutoLock lock(lock_); - enabled_hosts_[std::string(hashed, sizeof(hashed))] = state_copy; DirtyNotify(); } @@ -62,7 +60,6 @@ bool TransportSecurityState::IsEnabledForHost(DomainState* result, } base::Time current_time(base::Time::Now()); - AutoLock lock(lock_); for (size_t i = 0; canonicalised_host[i]; i += canonicalised_host[i] + 1) { char hashed_domain[base::SHA256_LENGTH]; @@ -194,8 +191,6 @@ bool TransportSecurityState::ParseHeader(const std::string& value, void TransportSecurityState::SetDelegate( TransportSecurityState::Delegate* delegate) { - AutoLock lock(lock_); - delegate_ = delegate; } @@ -221,8 +216,6 @@ static std::string ExternalStringToHashedDomain(const std::wstring& external) { } bool TransportSecurityState::Serialise(std::string* output) { - AutoLock lock(lock_); - DictionaryValue toplevel; for (std::map::const_iterator i = enabled_hosts_.begin(); i != enabled_hosts_.end(); ++i) { @@ -256,8 +249,6 @@ bool TransportSecurityState::Serialise(std::string* output) { bool TransportSecurityState::Deserialise(const std::string& input, bool* dirty) { - AutoLock lock(lock_); - enabled_hosts_.clear(); scoped_ptr value( @@ -335,8 +326,6 @@ bool TransportSecurityState::Deserialise(const std::string& input, void TransportSecurityState::DeleteSince(const base::Time& time) { bool dirtied = false; - AutoLock lock(lock_); - std::map::iterator i = enabled_hosts_.begin(); while (i != enabled_hosts_.end()) { if (i->second.created >= time) { diff --git a/net/base/transport_security_state.h b/net/base/transport_security_state.h index 05a0fc1..934db78 100644 --- a/net/base/transport_security_state.h +++ b/net/base/transport_security_state.h @@ -102,9 +102,6 @@ class TransportSecurityState : // ('www.google.com') to the form used in DNS: "\x03www\x06google\x03com" std::map enabled_hosts_; - // Protect access to our data members with this lock. - Lock lock_; - // Our delegate who gets notified when we are dirtied, or NULL. Delegate* delegate_; -- cgit v1.1