diff options
author | paulg@google.com <paulg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-11 02:17:51 +0000 |
---|---|---|
committer | paulg@google.com <paulg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-11 02:17:51 +0000 |
commit | c3ff8949df1905e2c0bffe32527a4b11de212ccc (patch) | |
tree | ffb88432b79882716a8779aee7a15efec6f3c65e /chrome/browser/safe_browsing/safe_browsing_service.cc | |
parent | 95218fbcd0b0e804175ada19cd8f95f5818242ba (diff) | |
download | chromium_src-c3ff8949df1905e2c0bffe32527a4b11de212ccc.zip chromium_src-c3ff8949df1905e2c0bffe32527a4b11de212ccc.tar.gz chromium_src-c3ff8949df1905e2c0bffe32527a4b11de212ccc.tar.bz2 |
Add support for 256 bit full hashes to the new implementation.
This CL replaces the following, which seems to have become inaccessible:
http://codereview.chromium.org/9202/
Review URL: http://codereview.chromium.org/10402
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5159 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/safe_browsing/safe_browsing_service.cc')
-rw-r--r-- | chrome/browser/safe_browsing/safe_browsing_service.cc | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/chrome/browser/safe_browsing/safe_browsing_service.cc b/chrome/browser/safe_browsing/safe_browsing_service.cc index 1382a5f..5a2f257 100644 --- a/chrome/browser/safe_browsing/safe_browsing_service.cc +++ b/chrome/browser/safe_browsing/safe_browsing_service.cc @@ -202,8 +202,8 @@ bool SafeBrowsingService::CheckUrlNew(const GURL& url, Client* client) { std::string list; std::vector<SBPrefix> prefix_hits; std::vector<SBFullHashResult> full_hits; - bool prefix_match = database_->ContainsUrl(url, &list, &prefix_hits, - &full_hits, + bool prefix_match = database_->ContainsUrl(url, &list, &prefix_hits, + &full_hits, protocol_manager_->last_update()); if (!prefix_match) return true; // URL is okay. @@ -415,6 +415,7 @@ void SafeBrowsingService::HandleGetHashResults( db_thread_->message_loop()->PostTask(FROM_HERE, NewRunnableMethod( this, &SafeBrowsingService::CacheHashResults, prefixes, full_hashes)); } else if (database_) { + // Cache the GetHash results in memory: database_->CacheHashResults(prefixes, full_hashes); } } @@ -464,6 +465,13 @@ void SafeBrowsingService::GetAllChunks() { this, &SafeBrowsingService::GetAllChunksFromDatabase)); } +void SafeBrowsingService::UpdateStarted() { + DCHECK(MessageLoop::current() == io_loop_); + DCHECK(enabled_); + db_thread_->message_loop()->PostTask(FROM_HERE, NewRunnableMethod( + this, &SafeBrowsingService::DatabaseUpdateStarted)); +} + void SafeBrowsingService::UpdateFinished(bool update_succeeded) { DCHECK(MessageLoop::current() == io_loop_); DCHECK(enabled_); @@ -471,6 +479,12 @@ void SafeBrowsingService::UpdateFinished(bool update_succeeded) { this, &SafeBrowsingService::DatabaseUpdateFinished, update_succeeded)); } +void SafeBrowsingService::DatabaseUpdateStarted() { + DCHECK(MessageLoop::current() == db_thread_->message_loop()); + if (GetDatabase()) + GetDatabase()->UpdateStarted(); +} + void SafeBrowsingService::DatabaseUpdateFinished(bool update_succeeded) { DCHECK(MessageLoop::current() == db_thread_->message_loop()); if (GetDatabase()) |