Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/safe_browsing/database_manager.h" | 5 #include "chrome/browser/safe_browsing/database_manager.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 269 | 269 |
| 270 bool SafeBrowsingDatabaseManager::MatchDownloadWhitelistString( | 270 bool SafeBrowsingDatabaseManager::MatchDownloadWhitelistString( |
| 271 const std::string& str) { | 271 const std::string& str) { |
| 272 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 272 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 273 if (!enabled_ || !enable_download_whitelist_ || !MakeDatabaseAvailable()) { | 273 if (!enabled_ || !enable_download_whitelist_ || !MakeDatabaseAvailable()) { |
| 274 return true; | 274 return true; |
| 275 } | 275 } |
| 276 return database_->ContainsDownloadWhitelistedString(str); | 276 return database_->ContainsDownloadWhitelistedString(str); |
| 277 } | 277 } |
| 278 | 278 |
| 279 bool SafeBrowsingDatabaseManager::MalwareKillSwitchOn() { | |
| 280 return database_->MalwareIPMatchKillSwitchOn(); | |
|
mattm
2013/05/15 07:12:38
Oops, didn't notice, I think this needs similar ch
kewang
2013/05/15 13:45:07
Done.
mattm
2013/05/15 23:46:26
I think also the enabled and database available ch
kewang
2013/05/20 10:23:37
Yes, added the check. Thanks,
| |
| 281 } | |
| 282 | |
| 279 bool SafeBrowsingDatabaseManager::CheckBrowseUrl(const GURL& url, | 283 bool SafeBrowsingDatabaseManager::CheckBrowseUrl(const GURL& url, |
| 280 Client* client) { | 284 Client* client) { |
| 281 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 285 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 282 if (!enabled_) | 286 if (!enabled_) |
| 283 return true; | 287 return true; |
| 284 | 288 |
| 285 if (!CanCheckUrl(url)) | 289 if (!CanCheckUrl(url)) |
| 286 return true; | 290 return true; |
| 287 | 291 |
| 288 const base::TimeTicks start = base::TimeTicks::Now(); | 292 const base::TimeTicks start = base::TimeTicks::Now(); |
| (...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1006 new base::WeakPtrFactory<SafeBrowsingDatabaseManager>(this)); | 1010 new base::WeakPtrFactory<SafeBrowsingDatabaseManager>(this)); |
| 1007 checks_.insert(check); | 1011 checks_.insert(check); |
| 1008 | 1012 |
| 1009 safe_browsing_thread_->message_loop()->PostTask(FROM_HERE, task); | 1013 safe_browsing_thread_->message_loop()->PostTask(FROM_HERE, task); |
| 1010 | 1014 |
| 1011 MessageLoop::current()->PostDelayedTask(FROM_HERE, | 1015 MessageLoop::current()->PostDelayedTask(FROM_HERE, |
| 1012 base::Bind(&SafeBrowsingDatabaseManager::TimeoutCallback, | 1016 base::Bind(&SafeBrowsingDatabaseManager::TimeoutCallback, |
| 1013 check->timeout_factory_->GetWeakPtr(), check), | 1017 check->timeout_factory_->GetWeakPtr(), check), |
| 1014 check_timeout_); | 1018 check_timeout_); |
| 1015 } | 1019 } |
| OLD | NEW |