diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-21 04:55:52 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-21 04:55:52 +0000 |
commit | 20305ec6f1acf21392c2f3938a14a96f1e28e76d (patch) | |
tree | 6eff1f7be4bad1a1362d3466f0ac59292dc51acc /net/base | |
parent | c6e8346b56ab61b35845aefcf9b241c654fe1253 (diff) | |
download | chromium_src-20305ec6f1acf21392c2f3938a14a96f1e28e76d.zip chromium_src-20305ec6f1acf21392c2f3938a14a96f1e28e76d.tar.gz chromium_src-20305ec6f1acf21392c2f3938a14a96f1e28e76d.tar.bz2 |
Remove obsolete base/lock.h and fix up callers to use the new header file and
the base namespace. Fix several files including lock.h unnecessarily.
BUG=none
TEST=none
Original review=http://codereview.chromium.org/6142009/
Patch by leviw@chromium.org
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72106 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base')
-rw-r--r-- | net/base/capturing_net_log.cc | 10 | ||||
-rw-r--r-- | net/base/capturing_net_log.h | 4 | ||||
-rw-r--r-- | net/base/cert_database_mac.cc | 4 | ||||
-rw-r--r-- | net/base/cert_verifier.cc | 10 | ||||
-rw-r--r-- | net/base/cookie_monster.cc | 26 | ||||
-rw-r--r-- | net/base/cookie_monster.h | 4 | ||||
-rw-r--r-- | net/base/dnsrr_resolver.cc | 10 | ||||
-rw-r--r-- | net/base/host_resolver_impl.cc | 14 | ||||
-rw-r--r-- | net/base/host_resolver_impl_unittest.cc | 6 | ||||
-rw-r--r-- | net/base/keygen_handler_mac.cc | 10 | ||||
-rw-r--r-- | net/base/listen_socket_unittest.cc | 4 | ||||
-rw-r--r-- | net/base/net_util.cc | 6 | ||||
-rw-r--r-- | net/base/openssl_memory_private_key_store.cc | 6 | ||||
-rw-r--r-- | net/base/test_completion_callback_unittest.cc | 4 | ||||
-rw-r--r-- | net/base/x509_certificate.cc | 8 | ||||
-rw-r--r-- | net/base/x509_certificate.h | 4 | ||||
-rw-r--r-- | net/base/x509_certificate_mac.cc | 2 |
17 files changed, 66 insertions, 66 deletions
diff --git a/net/base/capturing_net_log.cc b/net/base/capturing_net_log.cc index 568d4c3..2daa73a 100644 --- a/net/base/capturing_net_log.cc +++ b/net/base/capturing_net_log.cc @@ -26,17 +26,17 @@ CapturingNetLog::CapturingNetLog(size_t max_num_entries) CapturingNetLog::~CapturingNetLog() {} void CapturingNetLog::GetEntries(EntryList* entry_list) const { - AutoLock lock(lock_); + base::AutoLock lock(lock_); *entry_list = entries_; } void CapturingNetLog::Clear() { - AutoLock lock(lock_); + base::AutoLock lock(lock_); entries_.clear(); } void CapturingNetLog::SetLogLevel(NetLog::LogLevel log_level) { - AutoLock lock(lock_); + base::AutoLock lock(lock_); log_level_ = log_level; } @@ -45,7 +45,7 @@ void CapturingNetLog::AddEntry(EventType type, const Source& source, EventPhase phase, EventParameters* extra_parameters) { - AutoLock lock(lock_); + base::AutoLock lock(lock_); Entry entry(type, time, source, phase, extra_parameters); if (entries_.size() + 1 < max_num_entries_) entries_.push_back(entry); @@ -56,7 +56,7 @@ uint32 CapturingNetLog::NextID() { } NetLog::LogLevel CapturingNetLog::GetLogLevel() const { - AutoLock lock(lock_); + base::AutoLock lock(lock_); return log_level_; } diff --git a/net/base/capturing_net_log.h b/net/base/capturing_net_log.h index 0678d9a..a7406af 100644 --- a/net/base/capturing_net_log.h +++ b/net/base/capturing_net_log.h @@ -10,9 +10,9 @@ #include "base/atomicops.h" #include "base/basictypes.h" -#include "base/lock.h" #include "base/ref_counted.h" #include "base/scoped_ptr.h" +#include "base/synchronization/lock.h" #include "base/time.h" #include "net/base/net_log.h" @@ -65,7 +65,7 @@ class CapturingNetLog : public NetLog { private: // Needs to be "mutable" so can use it in GetEntries(). - mutable Lock lock_; + mutable base::Lock lock_; // Last assigned source ID. Incremented to get the next one. base::subtle::Atomic32 last_id_; diff --git a/net/base/cert_database_mac.cc b/net/base/cert_database_mac.cc index b0afd50..e90a712 100644 --- a/net/base/cert_database_mac.cc +++ b/net/base/cert_database_mac.cc @@ -7,8 +7,8 @@ #include <Security/Security.h> #include "base/crypto/cssm_init.h" -#include "base/lock.h" #include "base/logging.h" +#include "base/synchronization/lock.h" #include "net/base/net_errors.h" #include "net/base/x509_certificate.h" @@ -43,7 +43,7 @@ int CertDatabase::CheckUserCert(X509Certificate* cert) { int CertDatabase::AddUserCert(X509Certificate* cert) { OSStatus err; { - AutoLock locked(base::GetMacSecurityServicesLock()); + base::AutoLock locked(base::GetMacSecurityServicesLock()); err = SecCertificateAddToKeychain(cert->os_cert_handle(), NULL); } switch (err) { diff --git a/net/base/cert_verifier.cc b/net/base/cert_verifier.cc index 3d22dec..044524f 100644 --- a/net/base/cert_verifier.cc +++ b/net/base/cert_verifier.cc @@ -5,9 +5,9 @@ #include "net/base/cert_verifier.h" #include "base/compiler_specific.h" -#include "base/lock.h" #include "base/message_loop.h" #include "base/stl_util-inl.h" +#include "base/synchronization/lock.h" #include "base/threading/worker_pool.h" #include "net/base/net_errors.h" #include "net/base/x509_certificate.h" @@ -145,7 +145,7 @@ class CertVerifierWorker { // deleted. void Cancel() { DCHECK_EQ(MessageLoop::current(), origin_loop_); - AutoLock locked(lock_); + base::AutoLock locked(lock_); canceled_ = true; } @@ -174,7 +174,7 @@ class CertVerifierWorker { // after the PostTask, but before unlocking |lock_|. If we do not lock in // this case, we will end up deleting a locked Lock, which can lead to // memory leaks or worse errors. - AutoLock locked(lock_); + base::AutoLock locked(lock_); if (!canceled_) { cert_verifier_->HandleResult(cert_, hostname_, flags_, error_, verify_result_); @@ -196,7 +196,7 @@ class CertVerifierWorker { bool canceled; { - AutoLock locked(lock_); + base::AutoLock locked(lock_); canceled = canceled_; if (!canceled) { origin_loop_->PostTask( @@ -215,7 +215,7 @@ class CertVerifierWorker { CertVerifier* const cert_verifier_; // lock_ protects canceled_. - Lock lock_; + base::Lock lock_; // If canceled_ is true, // * origin_loop_ cannot be accessed by the worker thread, diff --git a/net/base/cookie_monster.cc b/net/base/cookie_monster.cc index cc96d44..e24b6be 100644 --- a/net/base/cookie_monster.cc +++ b/net/base/cookie_monster.cc @@ -503,7 +503,7 @@ bool CookieMonster::SetCookieWithDetails( const GURL& url, const std::string& name, const std::string& value, const std::string& domain, const std::string& path, const base::Time& expiration_time, bool secure, bool http_only) { - AutoLock autolock(lock_); + base::AutoLock autolock(lock_); if (!HasCookieableScheme(url)) return false; @@ -529,7 +529,7 @@ bool CookieMonster::SetCookieWithDetails( CookieList CookieMonster::GetAllCookies() { - AutoLock autolock(lock_); + base::AutoLock autolock(lock_); InitIfNecessary(); // This function is being called to scrape the cookie list for management UI @@ -564,7 +564,7 @@ CookieList CookieMonster::GetAllCookies() { CookieList CookieMonster::GetAllCookiesForURLWithOptions( const GURL& url, const CookieOptions& options) { - AutoLock autolock(lock_); + base::AutoLock autolock(lock_); InitIfNecessary(); std::vector<CanonicalCookie*> cookie_ptrs; @@ -587,7 +587,7 @@ CookieList CookieMonster::GetAllCookiesForURL(const GURL& url) { } int CookieMonster::DeleteAll(bool sync_to_store) { - AutoLock autolock(lock_); + base::AutoLock autolock(lock_); if (sync_to_store) InitIfNecessary(); @@ -607,7 +607,7 @@ int CookieMonster::DeleteAll(bool sync_to_store) { int CookieMonster::DeleteAllCreatedBetween(const Time& delete_begin, const Time& delete_end, bool sync_to_store) { - AutoLock autolock(lock_); + base::AutoLock autolock(lock_); InitIfNecessary(); int num_deleted = 0; @@ -632,7 +632,7 @@ int CookieMonster::DeleteAllCreatedAfter(const Time& delete_begin, } int CookieMonster::DeleteAllForHost(const GURL& url) { - AutoLock autolock(lock_); + base::AutoLock autolock(lock_); InitIfNecessary(); if (!HasCookieableScheme(url)) @@ -663,7 +663,7 @@ int CookieMonster::DeleteAllForHost(const GURL& url) { } bool CookieMonster::DeleteCanonicalCookie(const CanonicalCookie& cookie) { - AutoLock autolock(lock_); + base::AutoLock autolock(lock_); InitIfNecessary(); for (CookieMapItPair its = cookies_.equal_range(GetKey(cookie.Domain())); @@ -679,7 +679,7 @@ bool CookieMonster::DeleteCanonicalCookie(const CanonicalCookie& cookie) { void CookieMonster::SetCookieableSchemes( const char* schemes[], size_t num_schemes) { - AutoLock autolock(lock_); + base::AutoLock autolock(lock_); // Cookieable Schemes must be set before first use of function. DCHECK(!initialized_); @@ -705,7 +705,7 @@ void CookieMonster::EnableFileScheme() { } void CookieMonster::FlushStore(Task* completion_task) { - AutoLock autolock(lock_); + base::AutoLock autolock(lock_); if (initialized_ && store_) store_->Flush(completion_task); else if (completion_task) @@ -715,7 +715,7 @@ void CookieMonster::FlushStore(Task* completion_task) { bool CookieMonster::SetCookieWithOptions(const GURL& url, const std::string& cookie_line, const CookieOptions& options) { - AutoLock autolock(lock_); + base::AutoLock autolock(lock_); if (!HasCookieableScheme(url)) { return false; @@ -728,7 +728,7 @@ bool CookieMonster::SetCookieWithOptions(const GURL& url, std::string CookieMonster::GetCookiesWithOptions(const GURL& url, const CookieOptions& options) { - AutoLock autolock(lock_); + base::AutoLock autolock(lock_); InitIfNecessary(); if (!HasCookieableScheme(url)) { @@ -764,7 +764,7 @@ std::string CookieMonster::GetCookiesWithOptions(const GURL& url, void CookieMonster::DeleteCookie(const GURL& url, const std::string& cookie_name) { - AutoLock autolock(lock_); + base::AutoLock autolock(lock_); InitIfNecessary(); if (!HasCookieableScheme(url)) @@ -806,7 +806,7 @@ CookieMonster::~CookieMonster() { bool CookieMonster::SetCookieWithCreationTime(const GURL& url, const std::string& cookie_line, const base::Time& creation_time) { - AutoLock autolock(lock_); + base::AutoLock autolock(lock_); if (!HasCookieableScheme(url)) { return false; diff --git a/net/base/cookie_monster.h b/net/base/cookie_monster.h index 6a17d38..b2e3d2b 100644 --- a/net/base/cookie_monster.h +++ b/net/base/cookie_monster.h @@ -15,9 +15,9 @@ #include "base/basictypes.h" #include "base/gtest_prod_util.h" -#include "base/lock.h" #include "base/ref_counted.h" #include "base/scoped_ptr.h" +#include "base/synchronization/lock.h" #include "base/task.h" #include "base/time.h" #include "net/base/cookie_store.h" @@ -485,7 +485,7 @@ class CookieMonster : public CookieStore { scoped_refptr<Delegate> delegate_; // Lock for thread-safety - Lock lock_; + base::Lock lock_; base::Time last_statistic_record_time_; diff --git a/net/base/dnsrr_resolver.cc b/net/base/dnsrr_resolver.cc index 203ae52..5d9c132 100644 --- a/net/base/dnsrr_resolver.cc +++ b/net/base/dnsrr_resolver.cc @@ -12,12 +12,12 @@ #include <windns.h> #endif -#include "base/lock.h" #include "base/message_loop.h" #include "base/scoped_ptr.h" #include "base/singleton.h" #include "base/stl_util-inl.h" #include "base/string_piece.h" +#include "base/synchronization/lock.h" #include "base/task.h" #include "base/threading/worker_pool.h" #include "net/base/dns_reload_timer.h" @@ -168,7 +168,7 @@ class RRResolverWorker { // deleted. void Cancel() { DCHECK_EQ(MessageLoop::current(), origin_loop_); - AutoLock locked(lock_); + base::AutoLock locked(lock_); canceled_ = true; } @@ -353,7 +353,7 @@ class RRResolverWorker { // after the PostTask, but before unlocking |lock_|. If we do not lock in // this case, we will end up deleting a locked Lock, which can lead to // memory leaks or worse errors. - AutoLock locked(lock_); + base::AutoLock locked(lock_); if (!canceled_) dnsrr_resolver_->HandleResult(name_, rrtype_, result_, response_); } @@ -373,7 +373,7 @@ class RRResolverWorker { bool canceled; { - AutoLock locked(lock_); + base::AutoLock locked(lock_); canceled = canceled_; if (!canceled) { origin_loop_->PostTask( @@ -391,7 +391,7 @@ class RRResolverWorker { MessageLoop* const origin_loop_; DnsRRResolver* const dnsrr_resolver_; - Lock lock_; + base::Lock lock_; bool canceled_; int result_; diff --git a/net/base/host_resolver_impl.cc b/net/base/host_resolver_impl.cc index b4c8bfa..5c61b4f 100644 --- a/net/base/host_resolver_impl.cc +++ b/net/base/host_resolver_impl.cc @@ -18,12 +18,12 @@ #include "base/compiler_specific.h" #include "base/debug/debugger.h" #include "base/debug/stack_trace.h" -#include "base/lock.h" #include "base/message_loop.h" #include "base/metrics/field_trial.h" #include "base/metrics/histogram.h" #include "base/stl_util-inl.h" #include "base/string_util.h" +#include "base/synchronization/lock.h" #include "base/threading/worker_pool.h" #include "base/time.h" #include "base/utf_string_conversions.h" @@ -405,7 +405,7 @@ class HostResolverImpl::Job // Mark the job as cancelled, so when worker thread completes it will // not try to post completion to origin loop. { - AutoLock locked(origin_loop_lock_); + base::AutoLock locked(origin_loop_lock_); origin_loop_ = NULL; } @@ -482,7 +482,7 @@ class HostResolverImpl::Job // The origin loop could go away while we are trying to post to it, so we // need to call its PostTask method inside a lock. See ~HostResolver. { - AutoLock locked(origin_loop_lock_); + base::AutoLock locked(origin_loop_lock_); if (origin_loop_) { origin_loop_->PostTask(FROM_HERE, NewRunnableMethod(this, &Job::OnLookupComplete)); @@ -603,7 +603,7 @@ class HostResolverImpl::Job RequestsList requests_; // The requests waiting on this job. // Used to post ourselves onto the origin thread. - Lock origin_loop_lock_; + base::Lock origin_loop_lock_; MessageLoop* origin_loop_; // Hold an owning reference to the HostResolverProc that we are going to use. @@ -661,7 +661,7 @@ class HostResolverImpl::IPv6ProbeJob DCHECK(IsOnOriginThread()); resolver_ = NULL; // Read/write ONLY on origin thread. { - AutoLock locked(origin_loop_lock_); + base::AutoLock locked(origin_loop_lock_); // Origin loop may be destroyed before we can use it! origin_loop_ = NULL; // Write ONLY on origin thread. } @@ -695,7 +695,7 @@ class HostResolverImpl::IPv6ProbeJob // The origin loop could go away while we are trying to post to it, so we // need to call its PostTask method inside a lock. See ~HostResolver. { - AutoLock locked(origin_loop_lock_); + base::AutoLock locked(origin_loop_lock_); if (origin_loop_) { origin_loop_->PostTask(FROM_HERE, reply); return; @@ -722,7 +722,7 @@ class HostResolverImpl::IPv6ProbeJob HostResolverImpl* resolver_; // Used to post ourselves onto the origin thread. - Lock origin_loop_lock_; + base::Lock origin_loop_lock_; MessageLoop* origin_loop_; DISALLOW_COPY_AND_ASSIGN(IPv6ProbeJob); diff --git a/net/base/host_resolver_impl_unittest.cc b/net/base/host_resolver_impl_unittest.cc index 4d26ab9..8d418e9 100644 --- a/net/base/host_resolver_impl_unittest.cc +++ b/net/base/host_resolver_impl_unittest.cc @@ -92,7 +92,7 @@ class CapturingHostResolverProc : public HostResolverProc { int* os_error) { event_.Wait(); { - AutoLock l(lock_); + base::AutoLock l(lock_); capture_list_.push_back(CaptureEntry(hostname, address_family)); } return ResolveUsingPrevious(hostname, address_family, @@ -102,7 +102,7 @@ class CapturingHostResolverProc : public HostResolverProc { CaptureList GetCaptureList() const { CaptureList copy; { - AutoLock l(lock_); + base::AutoLock l(lock_); copy = capture_list_; } return copy; @@ -112,7 +112,7 @@ class CapturingHostResolverProc : public HostResolverProc { ~CapturingHostResolverProc() {} CaptureList capture_list_; - mutable Lock lock_; + mutable base::Lock lock_; base::WaitableEvent event_; }; diff --git a/net/base/keygen_handler_mac.cc b/net/base/keygen_handler_mac.cc index fdad99e..df9ce4a 100644 --- a/net/base/keygen_handler_mac.cc +++ b/net/base/keygen_handler_mac.cc @@ -10,10 +10,10 @@ #include "base/base64.h" #include "base/crypto/cssm_init.h" -#include "base/lock.h" #include "base/logging.h" #include "base/mac/scoped_cftyperef.h" #include "base/string_util.h" +#include "base/synchronization/lock.h" #include "base/sys_string_conversions.h" // These are in Security.framework but not declared in a public header. @@ -234,7 +234,7 @@ static OSStatus CreateRSAKeyPair(int size_in_bits, } base::mac::ScopedCFTypeRef<SecKeychainRef> scoped_keychain(keychain); { - AutoLock locked(base::GetMacSecurityServicesLock()); + base::AutoLock locked(base::GetMacSecurityServicesLock()); err = SecKeyCreatePair( keychain, CSSM_ALGID_RSA, @@ -261,7 +261,7 @@ static OSStatus CreateSignatureContext(SecKeyRef key, OSStatus err; const CSSM_ACCESS_CREDENTIALS* credentials = NULL; { - AutoLock locked(base::GetMacSecurityServicesLock()); + base::AutoLock locked(base::GetMacSecurityServicesLock()); err = SecKeyGetCredentials(key, CSSM_ACL_AUTHORIZATION_SIGN, kSecCredentialTypeDefault, @@ -274,7 +274,7 @@ static OSStatus CreateSignatureContext(SecKeyRef key, CSSM_CSP_HANDLE csp_handle = 0; { - AutoLock locked(base::GetMacSecurityServicesLock()); + base::AutoLock locked(base::GetMacSecurityServicesLock()); err = SecKeyGetCSPHandle(key, &csp_handle); } if (err) { @@ -284,7 +284,7 @@ static OSStatus CreateSignatureContext(SecKeyRef key, const CSSM_KEY* cssm_key = NULL; { - AutoLock locked(base::GetMacSecurityServicesLock()); + base::AutoLock locked(base::GetMacSecurityServicesLock()); err = SecKeyGetCSSMKey(key, &cssm_key); } if (err) { diff --git a/net/base/listen_socket_unittest.cc b/net/base/listen_socket_unittest.cc index 23dd089..53fc79b 100644 --- a/net/base/listen_socket_unittest.cc +++ b/net/base/listen_socket_unittest.cc @@ -73,13 +73,13 @@ void ListenSocketTester::TearDown() { } void ListenSocketTester::ReportAction(const ListenSocketTestAction& action) { - AutoLock locked(lock_); + base::AutoLock locked(lock_); queue_.push_back(action); cv_.Broadcast(); } void ListenSocketTester::NextAction() { - AutoLock locked(lock_); + base::AutoLock locked(lock_); while (queue_.empty()) cv_.Wait(); last_action_ = queue_.front(); diff --git a/net/base/net_util.cc b/net/base/net_util.cc index 804ff2a..99c6ea8 100644 --- a/net/base/net_util.cc +++ b/net/base/net_util.cc @@ -38,7 +38,6 @@ #include "base/i18n/icu_string_conversions.h" #include "base/i18n/time_formatting.h" #include "base/json/string_escape.h" -#include "base/lock.h" #include "base/logging.h" #include "base/message_loop.h" #include "base/metrics/histogram.h" @@ -51,6 +50,7 @@ #include "base/string_tokenizer.h" #include "base/string_util.h" #include "base/stringprintf.h" +#include "base/synchronization/lock.h" #include "base/sys_string_conversions.h" #include "base/time.h" #include "base/utf_offset_string_conversions.h" @@ -550,7 +550,7 @@ void SetExemplarSetForLang(const std::string& lang, map.insert(std::make_pair(lang, lang_set)); } -static Lock lang_set_lock; +static base::Lock lang_set_lock; // Returns true if all the characters in component_characters are used by // the language |lang|. @@ -560,7 +560,7 @@ bool IsComponentCoveredByLang(const icu::UnicodeSet& component_characters, icu::UnicodeSet* lang_set; // We're called from both the UI thread and the history thread. { - AutoLock lock(lang_set_lock); + base::AutoLock lock(lang_set_lock); if (!GetExemplarSetForLang(lang, &lang_set)) { UErrorCode status = U_ZERO_ERROR; ULocaleData* uld = ulocdata_open(lang.c_str(), &status); diff --git a/net/base/openssl_memory_private_key_store.cc b/net/base/openssl_memory_private_key_store.cc index 6b65dbe..bc64b57 100644 --- a/net/base/openssl_memory_private_key_store.cc +++ b/net/base/openssl_memory_private_key_store.cc @@ -26,7 +26,7 @@ class OpenSSLMemoryKeyStore : public OpenSSLPrivateKeyStore { } virtual ~OpenSSLMemoryKeyStore() { - AutoLock lock(lock_); + base::AutoLock lock(lock_); for (std::vector<EVP_PKEY*>::iterator it = keys_.begin(); it != keys_.end(); ++it) { EVP_PKEY_free(*it); @@ -35,13 +35,13 @@ class OpenSSLMemoryKeyStore : public OpenSSLPrivateKeyStore { virtual bool StorePrivateKey(const GURL& url, EVP_PKEY* pkey) { CRYPTO_add(&pkey->references, 1, CRYPTO_LOCK_EVP_PKEY); - AutoLock lock(lock_); + base::AutoLock lock(lock_); keys_.push_back(pkey); return true; } virtual EVP_PKEY* FetchPrivateKey(EVP_PKEY* pkey) { - AutoLock lock(lock_); + base::AutoLock lock(lock_); for (std::vector<EVP_PKEY*>::iterator it = keys_.begin(); it != keys_.end(); ++it) { if (EVP_PKEY_cmp(*it, pkey) == 1) diff --git a/net/base/test_completion_callback_unittest.cc b/net/base/test_completion_callback_unittest.cc index a0ae9bf..d0274e4 100644 --- a/net/base/test_completion_callback_unittest.cc +++ b/net/base/test_completion_callback_unittest.cc @@ -55,7 +55,7 @@ class ExampleEmployer::ExampleWorker ExampleEmployer* employer_; CompletionCallback* callback_; // Used to post ourselves onto the origin thread. - Lock origin_loop_lock_; + base::Lock origin_loop_lock_; MessageLoop* origin_loop_; }; @@ -68,7 +68,7 @@ void ExampleEmployer::ExampleWorker::DoWork() { // The origin loop could go away while we are trying to post to it, so we // need to call its PostTask method inside a lock. See ~ExampleEmployer. { - AutoLock locked(origin_loop_lock_); + base::AutoLock locked(origin_loop_lock_); if (origin_loop_) { origin_loop_->PostTask(FROM_HERE, reply); reply = NULL; diff --git a/net/base/x509_certificate.cc b/net/base/x509_certificate.cc index 7385743..b705790 100644 --- a/net/base/x509_certificate.cc +++ b/net/base/x509_certificate.cc @@ -64,7 +64,7 @@ class X509CertificateCache { // You must acquire this lock before using any private data of this object. // You must not block while holding this lock. - Lock lock_; + base::Lock lock_; // The certificate cache. You must acquire |lock_| before using |cache_|. CertMap cache_; @@ -79,7 +79,7 @@ base::LazyInstance<X509CertificateCache, // Insert |cert| into the cache. The cache does NOT AddRef |cert|. // Any existing certificate with the same fingerprint will be replaced. void X509CertificateCache::Insert(X509Certificate* cert) { - AutoLock lock(lock_); + base::AutoLock lock(lock_); DCHECK(!IsNullFingerprint(cert->fingerprint())) << "Only insert certs with real fingerprints."; @@ -89,7 +89,7 @@ void X509CertificateCache::Insert(X509Certificate* cert) { // Remove |cert| from the cache. The cache does not assume that |cert| is // already in the cache. void X509CertificateCache::Remove(X509Certificate* cert) { - AutoLock lock(lock_); + base::AutoLock lock(lock_); CertMap::iterator pos(cache_.find(cert->fingerprint())); if (pos == cache_.end()) @@ -101,7 +101,7 @@ void X509CertificateCache::Remove(X509Certificate* cert) { // not exist, this method returns NULL. X509Certificate* X509CertificateCache::Find( const SHA1Fingerprint& fingerprint) { - AutoLock lock(lock_); + base::AutoLock lock(lock_); CertMap::iterator pos(cache_.find(fingerprint)); if (pos == cache_.end()) diff --git a/net/base/x509_certificate.h b/net/base/x509_certificate.h index 47178f5..961c68a 100644 --- a/net/base/x509_certificate.h +++ b/net/base/x509_certificate.h @@ -24,7 +24,7 @@ #include <CoreFoundation/CFArray.h> #include <Security/SecBase.h> -#include "base/lock.h" +#include "base/synchronization/lock.h" #elif defined(USE_OPENSSL) // Forward declaration; real one in <x509.h> struct x509_st; @@ -370,7 +370,7 @@ class X509Certificate : public base::RefCountedThreadSafe<X509Certificate> { #if defined(OS_MACOSX) // Blocks multiple threads from verifying the cert simultaneously. // (Marked mutable because it's used in a const method.) - mutable Lock verification_lock_; + mutable base::Lock verification_lock_; #endif // Where the certificate comes from. diff --git a/net/base/x509_certificate_mac.cc b/net/base/x509_certificate_mac.cc index fd965cb3..7c5cc64 100644 --- a/net/base/x509_certificate_mac.cc +++ b/net/base/x509_certificate_mac.cc @@ -471,7 +471,7 @@ int X509Certificate::Verify(const std::string& hostname, int flags, // of sporadic crashes in the SecTrustEvaluate call below, way down inside // Apple's cert code, which we suspect are caused by a thread-safety issue. // So as a speculative fix allow only one thread to use SecTrust on this cert. - AutoLock lock(verification_lock_); + base::AutoLock lock(verification_lock_); SecTrustRef trust_ref = NULL; status = SecTrustCreateWithCertificates(cert_array, ssl_policy, &trust_ref); |