summaryrefslogtreecommitdiffstats
path: root/chrome/browser/safe_browsing
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-21 04:55:52 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-21 04:55:52 +0000
commit20305ec6f1acf21392c2f3938a14a96f1e28e76d (patch)
tree6eff1f7be4bad1a1362d3466f0ac59292dc51acc /chrome/browser/safe_browsing
parentc6e8346b56ab61b35845aefcf9b241c654fe1253 (diff)
downloadchromium_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 'chrome/browser/safe_browsing')
-rw-r--r--chrome/browser/safe_browsing/safe_browsing_database.cc12
-rw-r--r--chrome/browser/safe_browsing/safe_browsing_database.h4
-rw-r--r--chrome/browser/safe_browsing/safe_browsing_service.cc6
-rw-r--r--chrome/browser/safe_browsing/safe_browsing_service.h4
4 files changed, 13 insertions, 13 deletions
diff --git a/chrome/browser/safe_browsing/safe_browsing_database.cc b/chrome/browser/safe_browsing/safe_browsing_database.cc
index 9b4c57e..e717655 100644
--- a/chrome/browser/safe_browsing/safe_browsing_database.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_database.cc
@@ -287,7 +287,7 @@ void SafeBrowsingDatabaseNew::Init(const FilePath& filename_base) {
// until it returns, there are no pointers to this class on other
// threads. Then again, that means there is no possibility of
// contention on the lock...
- AutoLock locked(lookup_lock_);
+ base::AutoLock locked(lookup_lock_);
DCHECK(browse_filename_.empty()); // Ensure we haven't been run before.
DCHECK(download_filename_.empty()); // Ensure we haven't been run before.
@@ -324,7 +324,7 @@ bool SafeBrowsingDatabaseNew::ResetDatabase() {
// Reset objects in memory.
{
- AutoLock locked(lookup_lock_);
+ base::AutoLock locked(lookup_lock_);
full_browse_hashes_.clear();
pending_browse_hashes_.clear();
prefix_miss_cache_.clear();
@@ -355,7 +355,7 @@ bool SafeBrowsingDatabaseNew::ContainsBrowseUrl(
// This function is called on the I/O thread, prevent changes to
// bloom filter and caches.
- AutoLock locked(lookup_lock_);
+ base::AutoLock locked(lookup_lock_);
if (!browse_bloom_filter_.get())
return false;
@@ -607,7 +607,7 @@ void SafeBrowsingDatabaseNew::CacheHashResults(
const std::vector<SBPrefix>& prefixes,
const std::vector<SBFullHashResult>& full_hits) {
// This is called on the I/O thread, lock against updates.
- AutoLock locked(lookup_lock_);
+ base::AutoLock locked(lookup_lock_);
if (full_hits.empty()) {
prefix_miss_cache_.insert(prefixes.begin(), prefixes.end());
@@ -729,7 +729,7 @@ void SafeBrowsingDatabaseNew::UpdateBrowseStore() {
// case |ContainsBrowseURL()| is called before the new filter is complete.
std::vector<SBAddFullHash> pending_add_hashes;
{
- AutoLock locked(lookup_lock_);
+ base::AutoLock locked(lookup_lock_);
pending_add_hashes.insert(pending_add_hashes.end(),
pending_browse_hashes_.begin(),
pending_browse_hashes_.end());
@@ -778,7 +778,7 @@ void SafeBrowsingDatabaseNew::UpdateBrowseStore() {
// Swap in the newly built filter and cache.
{
- AutoLock locked(lookup_lock_);
+ base::AutoLock locked(lookup_lock_);
full_browse_hashes_.swap(add_full_hashes);
// TODO(shess): If |CacheHashResults()| is posted between the
diff --git a/chrome/browser/safe_browsing/safe_browsing_database.h b/chrome/browser/safe_browsing/safe_browsing_database.h
index 980a8d3..4bd6db9 100644
--- a/chrome/browser/safe_browsing/safe_browsing_database.h
+++ b/chrome/browser/safe_browsing/safe_browsing_database.h
@@ -10,8 +10,8 @@
#include <vector>
#include "base/file_path.h"
-#include "base/lock.h"
#include "base/scoped_ptr.h"
+#include "base/synchronization/lock.h"
#include "base/task.h"
#include "chrome/browser/safe_browsing/safe_browsing_store.h"
#include "testing/gtest/include/gtest/gtest_prod.h"
@@ -236,7 +236,7 @@ class SafeBrowsingDatabaseNew : public SafeBrowsingDatabase {
// Lock for protecting access to variables that may be used on the
// IO thread. This includes |browse_bloom_filter_|, |full_browse_hashes_|,
// |pending_browse_hashes_|, and |prefix_miss_cache_|.
- Lock lookup_lock_;
+ base::Lock lookup_lock_;
// Underlying persistent store for chunk data.
// For browsing related (phishing and malware URLs) chunks and prefixes.
diff --git a/chrome/browser/safe_browsing/safe_browsing_service.cc b/chrome/browser/safe_browsing/safe_browsing_service.cc
index a0f8384..046ea52c 100644
--- a/chrome/browser/safe_browsing/safe_browsing_service.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_service.cc
@@ -592,7 +592,7 @@ void SafeBrowsingService::OnIOShutdown() {
}
bool SafeBrowsingService::DatabaseAvailable() const {
- AutoLock lock(database_lock_);
+ base::AutoLock lock(database_lock_);
return !closing_database_ && (database_ != NULL);
}
@@ -625,7 +625,7 @@ SafeBrowsingDatabase* SafeBrowsingService::GetDatabase() {
{
// Acquiring the lock here guarantees correct ordering between the writes to
// the new database object above, and the setting of |databse_| below.
- AutoLock lock(database_lock_);
+ base::AutoLock lock(database_lock_);
database_ = database;
}
@@ -829,7 +829,7 @@ void SafeBrowsingService::OnCloseDatabase() {
// of |database_| above and of |closing_database_| below, which ensures there
// won't be a window during which the IO thread falsely believes the database
// is available.
- AutoLock lock(database_lock_);
+ base::AutoLock lock(database_lock_);
closing_database_ = false;
}
diff --git a/chrome/browser/safe_browsing/safe_browsing_service.h b/chrome/browser/safe_browsing/safe_browsing_service.h
index 28f74de..85255e5 100644
--- a/chrome/browser/safe_browsing/safe_browsing_service.h
+++ b/chrome/browser/safe_browsing/safe_browsing_service.h
@@ -15,9 +15,9 @@
#include <vector>
#include "base/hash_tables.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 "chrome/browser/safe_browsing/safe_browsing_util.h"
#include "googleurl/src/gurl.h"
@@ -353,7 +353,7 @@ class SafeBrowsingService
SafeBrowsingDatabase* database_;
// Lock used to prevent possible data races due to compiler optimizations.
- mutable Lock database_lock_;
+ mutable base::Lock database_lock_;
// Handles interaction with SafeBrowsing servers.
SafeBrowsingProtocolManager* protocol_manager_;