diff options
author | lzheng@chromium.org <lzheng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-24 21:39:42 +0000 |
---|---|---|
committer | lzheng@chromium.org <lzheng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-24 21:39:42 +0000 |
commit | af5ee7f3fe7c555578bd9c0cf1290bcf6af553e7 (patch) | |
tree | bc3ea143c089be039027470a85683601ee509951 /chrome/browser/safe_browsing | |
parent | d33a22399c8a5962393d26889990cb6105be30ce (diff) | |
download | chromium_src-af5ee7f3fe7c555578bd9c0cf1290bcf6af553e7.zip chromium_src-af5ee7f3fe7c555578bd9c0cf1290bcf6af553e7.tar.gz chromium_src-af5ee7f3fe7c555578bd9c0cf1290bcf6af553e7.tar.bz2 |
Clean up the disable_ and checks_.
TEST=safebrowsing related tests stay green.
BUG=NONE
Review URL: http://codereview.chromium.org/6578004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75957 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/safe_browsing')
-rw-r--r-- | chrome/browser/safe_browsing/safe_browsing_service.cc | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/chrome/browser/safe_browsing/safe_browsing_service.cc b/chrome/browser/safe_browsing/safe_browsing_service.cc index 114c798..70f8a3f 100644 --- a/chrome/browser/safe_browsing/safe_browsing_service.cc +++ b/chrome/browser/safe_browsing/safe_browsing_service.cc @@ -432,10 +432,12 @@ void SafeBrowsingService::HandleGetHashResults( const std::vector<SBFullHashResult>& full_hashes, bool can_cache) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); - if (checks_.find(check) == checks_.end()) + + if (!enabled_) return; - DCHECK(enabled_); + // If the service has been shut down, |check| should have been deleted. + DCHECK(checks_.find(check) != checks_.end()); // |start| is set before calling |GetFullHash()|, which should be // the only path which gets to here. @@ -746,11 +748,12 @@ SafeBrowsingDatabase* SafeBrowsingService::GetDatabase() { void SafeBrowsingService::OnCheckDone(SafeBrowsingCheck* check) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); - // If we've been shutdown during the database lookup, this check will already - // have been deleted (in OnIOShutdown). - if (!enabled_ || checks_.find(check) == checks_.end()) + if (!enabled_) return; + // If the service has been shut down, |check| should have been deleted. + DCHECK(checks_.find(check) != checks_.end()); + if (check->client && check->need_get_hash) { // We have a partial match so we need to query Google for the full hash. // Clean up will happen in HandleGetHashResults. |