| 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/local_database_manager.h" | 5 #include "chrome/browser/safe_browsing/local_database_manager.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 1198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1209 } | 1209 } |
| 1210 | 1210 |
| 1211 void LocalSafeBrowsingDatabaseManager::SafeBrowsingCheckDone( | 1211 void LocalSafeBrowsingDatabaseManager::SafeBrowsingCheckDone( |
| 1212 SafeBrowsingCheck* check) { | 1212 SafeBrowsingCheck* check) { |
| 1213 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 1213 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 1214 DCHECK(check); | 1214 DCHECK(check); |
| 1215 | 1215 |
| 1216 if (!enabled_) | 1216 if (!enabled_) |
| 1217 return; | 1217 return; |
| 1218 | 1218 |
| 1219 DVLOG(1) << "SafeBrowsingCheckDone"; | |
| 1220 DCHECK(checks_.find(check) != checks_.end()); | 1219 DCHECK(checks_.find(check) != checks_.end()); |
| 1221 if (check->client) | 1220 if (check->client) |
| 1222 check->OnSafeBrowsingResult(); | 1221 check->OnSafeBrowsingResult(); |
| 1223 checks_.erase(check); | 1222 checks_.erase(check); |
| 1224 delete check; | 1223 delete check; |
| 1225 } | 1224 } |
| 1226 | 1225 |
| 1227 void LocalSafeBrowsingDatabaseManager::StartSafeBrowsingCheck( | 1226 void LocalSafeBrowsingDatabaseManager::StartSafeBrowsingCheck( |
| 1228 SafeBrowsingCheck* check, | 1227 SafeBrowsingCheck* check, |
| 1229 const base::Callback<std::vector<SBPrefix>(void)>& task) { | 1228 const base::Callback<std::vector<SBPrefix>(void)>& task) { |
| (...skipping 10 matching lines...) Expand all Loading... |
| 1240 FROM_HERE, base::Bind(&LocalSafeBrowsingDatabaseManager::TimeoutCallback, | 1239 FROM_HERE, base::Bind(&LocalSafeBrowsingDatabaseManager::TimeoutCallback, |
| 1241 check->weak_ptr_factory_->GetWeakPtr(), check), | 1240 check->weak_ptr_factory_->GetWeakPtr(), check), |
| 1242 check_timeout_); | 1241 check_timeout_); |
| 1243 } | 1242 } |
| 1244 | 1243 |
| 1245 bool LocalSafeBrowsingDatabaseManager::IsDownloadProtectionEnabled() const { | 1244 bool LocalSafeBrowsingDatabaseManager::IsDownloadProtectionEnabled() const { |
| 1246 return enable_download_protection_; | 1245 return enable_download_protection_; |
| 1247 } | 1246 } |
| 1248 | 1247 |
| 1249 } // namespace safe_browsing | 1248 } // namespace safe_browsing |
| OLD | NEW |