summaryrefslogtreecommitdiffstats
path: root/chrome/browser/safe_browsing
diff options
context:
space:
mode:
authordsh@google.com <dsh@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-27 20:43:33 +0000
committerdsh@google.com <dsh@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-27 20:43:33 +0000
commite1acf6f902e50222baf99bfb492ecc38a1604975 (patch)
tree503d45705b14be7e2f1ed86c71d6064abbf90fbe /chrome/browser/safe_browsing
parenta2f5993e1ce940e8a8eec900abaeed02e2eee09b (diff)
downloadchromium_src-e1acf6f902e50222baf99bfb492ecc38a1604975.zip
chromium_src-e1acf6f902e50222baf99bfb492ecc38a1604975.tar.gz
chromium_src-e1acf6f902e50222baf99bfb492ecc38a1604975.tar.bz2
Move Time, TimeDelta and TimeTicks into namespace base.
Review URL: http://codereview.chromium.org/7995 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4022 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/safe_browsing')
-rw-r--r--chrome/browser/safe_browsing/protocol_manager.cc2
-rw-r--r--chrome/browser/safe_browsing/protocol_manager.h6
-rw-r--r--chrome/browser/safe_browsing/protocol_manager_unittest.cc3
-rw-r--r--chrome/browser/safe_browsing/safe_browsing_database.cc3
-rw-r--r--chrome/browser/safe_browsing/safe_browsing_database.h2
-rw-r--r--chrome/browser/safe_browsing/safe_browsing_database_bloom.cc3
-rw-r--r--chrome/browser/safe_browsing/safe_browsing_database_bloom.h6
-rw-r--r--chrome/browser/safe_browsing/safe_browsing_database_impl.cc3
-rw-r--r--chrome/browser/safe_browsing/safe_browsing_database_impl.h8
-rw-r--r--chrome/browser/safe_browsing/safe_browsing_database_impl_unittest.cc3
-rw-r--r--chrome/browser/safe_browsing/safe_browsing_database_unittest.cc2
-rw-r--r--chrome/browser/safe_browsing/safe_browsing_service.cc3
-rw-r--r--chrome/browser/safe_browsing/safe_browsing_service.h10
13 files changed, 37 insertions, 17 deletions
diff --git a/chrome/browser/safe_browsing/protocol_manager.cc b/chrome/browser/safe_browsing/protocol_manager.cc
index f531538..fb3c967 100644
--- a/chrome/browser/safe_browsing/protocol_manager.cc
+++ b/chrome/browser/safe_browsing/protocol_manager.cc
@@ -21,6 +21,8 @@
#include "net/base/base64.h"
#include "net/base/load_flags.h"
+using base::Time;
+using base::TimeDelta;
// Maximum time, in seconds, from start up before we must issue an update query.
static const int kSbTimerStartIntervalSec = 5 * 60;
diff --git a/chrome/browser/safe_browsing/protocol_manager.h b/chrome/browser/safe_browsing/protocol_manager.h
index 4cb75c0..ae89319 100644
--- a/chrome/browser/safe_browsing/protocol_manager.h
+++ b/chrome/browser/safe_browsing/protocol_manager.h
@@ -74,7 +74,7 @@ class SafeBrowsingProtocolManager : public URLFetcher::Delegate {
void OnChunkInserted();
// The last time we received an update.
- Time last_update() const { return last_update_; }
+ base::Time last_update() const { return last_update_; }
private:
// Internal API for fetching information from the SafeBrowsing servers. The
@@ -196,10 +196,10 @@ class SafeBrowsingProtocolManager : public URLFetcher::Delegate {
std::string wrapped_key_;
// The last time we successfully received an update.
- Time last_update_;
+ base::Time last_update_;
// While in GetHash backoff, we can't make another GetHash until this time.
- Time next_gethash_time_;
+ base::Time next_gethash_time_;
// Current product version sent in each request.
std::string version_;
diff --git a/chrome/browser/safe_browsing/protocol_manager_unittest.cc b/chrome/browser/safe_browsing/protocol_manager_unittest.cc
index 3a81c91..25af2b3 100644
--- a/chrome/browser/safe_browsing/protocol_manager_unittest.cc
+++ b/chrome/browser/safe_browsing/protocol_manager_unittest.cc
@@ -8,6 +8,9 @@
#include "testing/gtest/include/gtest/gtest.h"
#include "chrome/browser/safe_browsing/protocol_manager.h"
+using base::Time;
+using base::TimeDelta;
+
class SafeBrowsingProtocolManagerTest : public testing::Test {
};
diff --git a/chrome/browser/safe_browsing/safe_browsing_database.cc b/chrome/browser/safe_browsing/safe_browsing_database.cc
index 2f43f6b..92961c3 100644
--- a/chrome/browser/safe_browsing/safe_browsing_database.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_database.cc
@@ -13,6 +13,8 @@
#include "chrome/common/chrome_switches.h"
#include "googleurl/src/gurl.h"
+using base::Time;
+
// Filename suffix for the bloom filter.
static const wchar_t kBloomFilterFile[] = L" Filter";
@@ -98,4 +100,3 @@ void SafeBrowsingDatabase::WriteBloomFilter() {
SB_DLOG(INFO) << "SafeBrowsingDatabase wrote bloom filter in " <<
(Time::Now() - before).InMilliseconds() << " ms";
}
-
diff --git a/chrome/browser/safe_browsing/safe_browsing_database.h b/chrome/browser/safe_browsing/safe_browsing_database.h
index 94b9b76..f4c692a 100644
--- a/chrome/browser/safe_browsing/safe_browsing_database.h
+++ b/chrome/browser/safe_browsing/safe_browsing_database.h
@@ -52,7 +52,7 @@ class SafeBrowsingDatabase {
std::string* matching_list,
std::vector<SBPrefix>* prefix_hits,
std::vector<SBFullHashResult>* full_hits,
- Time last_update) = 0;
+ base::Time last_update) = 0;
// Processes add/sub commands. Database will free the chunks when it's done.
virtual void InsertChunks(const std::string& list_name,
diff --git a/chrome/browser/safe_browsing/safe_browsing_database_bloom.cc b/chrome/browser/safe_browsing/safe_browsing_database_bloom.cc
index 9b15082..d04826d 100644
--- a/chrome/browser/safe_browsing/safe_browsing_database_bloom.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_database_bloom.cc
@@ -17,6 +17,9 @@
#include "chrome/common/sqlite_utils.h"
#include "googleurl/src/gurl.h"
+using base::Time;
+using base::TimeDelta;
+
// Database version. If this is different than what's stored on disk, the
// database is reset.
static const int kDatabaseVersion = 6;
diff --git a/chrome/browser/safe_browsing/safe_browsing_database_bloom.h b/chrome/browser/safe_browsing/safe_browsing_database_bloom.h
index f639943..8f5fbe1 100644
--- a/chrome/browser/safe_browsing/safe_browsing_database_bloom.h
+++ b/chrome/browser/safe_browsing/safe_browsing_database_bloom.h
@@ -44,7 +44,7 @@ class SafeBrowsingDatabaseBloom : public SafeBrowsingDatabase {
std::string* matching_list,
std::vector<SBPrefix>* prefix_hits,
std::vector<SBFullHashResult>* full_hits,
- Time last_update);
+ base::Time last_update);
// Processes add/sub commands. Database will free the chunks when it's done.
virtual void InsertChunks(const std::string& list_name,
@@ -147,7 +147,7 @@ class SafeBrowsingDatabaseBloom : public SafeBrowsingDatabase {
// Looks up any cached full hashes we may have.
void GetCachedFullHashes(const std::vector<SBPrefix>* prefix_hits,
std::vector<SBFullHashResult>* full_hits,
- Time last_update);
+ base::Time last_update);
// Remove cached entries that have prefixes contained in the entry.
void ClearCachedHashes(const SBEntry* entry);
@@ -238,7 +238,7 @@ class SafeBrowsingDatabaseBloom : public SafeBrowsingDatabase {
SBFullHash full_hash;
int list_id;
int add_chunk_id;
- Time received;
+ base::Time received;
} HashCacheEntry;
typedef std::list<HashCacheEntry> HashList;
diff --git a/chrome/browser/safe_browsing/safe_browsing_database_impl.cc b/chrome/browser/safe_browsing/safe_browsing_database_impl.cc
index 5d1c758..db25ec7 100644
--- a/chrome/browser/safe_browsing/safe_browsing_database_impl.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_database_impl.cc
@@ -17,6 +17,9 @@
#include "chrome/common/sqlite_utils.h"
#include "googleurl/src/gurl.h"
+using base::Time;
+using base::TimeDelta;
+
// Database version. If this is different than what's stored on disk, the
// database is reset.
static const int kDatabaseVersion = 4;
diff --git a/chrome/browser/safe_browsing/safe_browsing_database_impl.h b/chrome/browser/safe_browsing/safe_browsing_database_impl.h
index 67f44ea..4c46b75 100644
--- a/chrome/browser/safe_browsing/safe_browsing_database_impl.h
+++ b/chrome/browser/safe_browsing/safe_browsing_database_impl.h
@@ -46,7 +46,7 @@ class SafeBrowsingDatabaseImpl : public SafeBrowsingDatabase {
std::string* matching_list,
std::vector<SBPrefix>* prefix_hits,
std::vector<SBFullHashResult>* full_hits,
- Time last_update);
+ base::Time last_update);
// Processes add/sub commands. Database will free the chunks when it's done.
virtual void InsertChunks(const std::string& list_name,
@@ -185,7 +185,7 @@ class SafeBrowsingDatabaseImpl : public SafeBrowsingDatabase {
// Looks up any cached full hashes we may have.
void GetCachedFullHashes(const std::vector<SBPrefix>* prefix_hits,
std::vector<SBFullHashResult>* full_hits,
- Time last_update);
+ base::Time last_update);
// Remove cached entries that have prefixes contained in the entry.
void ClearCachedHashes(const SBEntry* entry);
@@ -225,7 +225,7 @@ class SafeBrowsingDatabaseImpl : public SafeBrowsingDatabase {
// These are temp variables used when rebuilding the bloom filter.
bool bloom_filter_building_;
std::vector<int> bloom_filter_temp_hostkeys_;
- Time bloom_filter_rebuild_time_;
+ base::Time bloom_filter_rebuild_time_;
// Used to store throttled work for commands that write to the database.
std::queue<std::deque<SBChunk>*> pending_chunks_;
@@ -264,7 +264,7 @@ class SafeBrowsingDatabaseImpl : public SafeBrowsingDatabase {
SBFullHash full_hash;
int list_id;
int add_chunk_id;
- Time received;
+ base::Time received;
} HashCacheEntry;
typedef std::list<HashCacheEntry> HashList;
diff --git a/chrome/browser/safe_browsing/safe_browsing_database_impl_unittest.cc b/chrome/browser/safe_browsing/safe_browsing_database_impl_unittest.cc
index 3afcedc..614fa1b 100644
--- a/chrome/browser/safe_browsing/safe_browsing_database_impl_unittest.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_database_impl_unittest.cc
@@ -18,6 +18,9 @@
#include "googleurl/src/gurl.h"
#include "testing/gtest/include/gtest/gtest.h"
+using base::Time;
+using base::TimeDelta;
+
namespace {
SBPrefix Sha256Prefix(const std::string& str) {
SBPrefix hash;
diff --git a/chrome/browser/safe_browsing/safe_browsing_database_unittest.cc b/chrome/browser/safe_browsing/safe_browsing_database_unittest.cc
index 2c37c14..43249a5 100644
--- a/chrome/browser/safe_browsing/safe_browsing_database_unittest.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_database_unittest.cc
@@ -17,6 +17,8 @@
#include "googleurl/src/gurl.h"
#include "testing/gtest/include/gtest/gtest.h"
+using base::Time;
+
static const wchar_t kSafeBrowsingTestDatabase[] = L"SafeBrowsingTestDatabase";
namespace {
diff --git a/chrome/browser/safe_browsing/safe_browsing_service.cc b/chrome/browser/safe_browsing/safe_browsing_service.cc
index 9f6419c..1382a5f 100644
--- a/chrome/browser/safe_browsing/safe_browsing_service.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_service.cc
@@ -23,6 +23,9 @@
#include "chrome/common/pref_service.h"
#include "net/base/registry_controlled_domain.h"
+using base::Time;
+using base::TimeDelta;
+
SafeBrowsingService::SafeBrowsingService()
: io_loop_(NULL),
database_(NULL),
diff --git a/chrome/browser/safe_browsing/safe_browsing_service.h b/chrome/browser/safe_browsing/safe_browsing_service.h
index dd2c818..8a87726 100644
--- a/chrome/browser/safe_browsing/safe_browsing_service.h
+++ b/chrome/browser/safe_browsing/safe_browsing_service.h
@@ -119,8 +119,8 @@ class SafeBrowsingService
GURL url;
Client* client;
bool need_get_hash;
- Time start; // Time that check was sent to SB service.
- TimeDelta db_time; // How long DB look-up took.
+ base::Time start; // Time that check was sent to SB service.
+ base::TimeDelta db_time; // How long DB look-up took.
UrlCheckResult result;
std::vector<SBPrefix> prefix_hits;
std::vector<SBFullHashResult> full_hits;
@@ -165,7 +165,7 @@ class SafeBrowsingService
// delta starting from when we would have started reading data from the
// network, and ending when the SafeBrowsing check completes indicating that
// the current page is 'safe'.
- static void LogPauseDelay(TimeDelta time);
+ static void LogPauseDelay(base::TimeDelta time);
// We defer SafeBrowsing work for a short duration when the computer comes
// out of a suspend state to avoid thrashing the disk.
@@ -178,7 +178,7 @@ class SafeBrowsingService
SafeBrowsingDatabase* GetDatabase();
// Called on the database thread to check a url.
- void CheckDatabase(SafeBrowsingCheck* info, Time last_update);
+ void CheckDatabase(SafeBrowsingCheck* info, base::Time last_update);
// Called on the IO thread with the check result.
void OnCheckDone(SafeBrowsingCheck* info);
@@ -287,7 +287,7 @@ class SafeBrowsingService
typedef struct {
Client* client;
GURL url;
- Time start;
+ base::Time start;
} QueuedCheck;
std::deque<QueuedCheck> queued_checks_;