| 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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 SIDE_EFFECT_FREE_WHITELIST_STATUS_MAX); | 199 SIDE_EFFECT_FREE_WHITELIST_STATUS_MAX); |
| 200 } | 200 } |
| 201 | 201 |
| 202 SafeBrowsingDatabaseManager::~SafeBrowsingDatabaseManager() { | 202 SafeBrowsingDatabaseManager::~SafeBrowsingDatabaseManager() { |
| 203 // We should have already been shut down. If we're still enabled, then the | 203 // We should have already been shut down. If we're still enabled, then the |
| 204 // database isn't going to be closed properly, which could lead to corruption. | 204 // database isn't going to be closed properly, which could lead to corruption. |
| 205 DCHECK(!enabled_); | 205 DCHECK(!enabled_); |
| 206 } | 206 } |
| 207 | 207 |
| 208 bool SafeBrowsingDatabaseManager::CanCheckUrl(const GURL& url) const { | 208 bool SafeBrowsingDatabaseManager::CanCheckUrl(const GURL& url) const { |
| 209 return url.SchemeIs(chrome::kFtpScheme) || | 209 return url.SchemeIs(content::kFtpScheme) || |
| 210 url.SchemeIs(content::kHttpScheme) || | 210 url.SchemeIs(content::kHttpScheme) || |
| 211 url.SchemeIs(content::kHttpsScheme); | 211 url.SchemeIs(content::kHttpsScheme); |
| 212 } | 212 } |
| 213 | 213 |
| 214 bool SafeBrowsingDatabaseManager::CheckDownloadUrl( | 214 bool SafeBrowsingDatabaseManager::CheckDownloadUrl( |
| 215 const std::vector<GURL>& url_chain, | 215 const std::vector<GURL>& url_chain, |
| 216 Client* client) { | 216 Client* client) { |
| 217 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 217 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 218 if (!enabled_ || !enable_download_protection_) | 218 if (!enabled_ || !enable_download_protection_) |
| 219 return true; | 219 return true; |
| (...skipping 889 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1109 new base::WeakPtrFactory<SafeBrowsingDatabaseManager>(this)); | 1109 new base::WeakPtrFactory<SafeBrowsingDatabaseManager>(this)); |
| 1110 checks_.insert(check); | 1110 checks_.insert(check); |
| 1111 | 1111 |
| 1112 safe_browsing_thread_->message_loop()->PostTask(FROM_HERE, task); | 1112 safe_browsing_thread_->message_loop()->PostTask(FROM_HERE, task); |
| 1113 | 1113 |
| 1114 base::MessageLoop::current()->PostDelayedTask(FROM_HERE, | 1114 base::MessageLoop::current()->PostDelayedTask(FROM_HERE, |
| 1115 base::Bind(&SafeBrowsingDatabaseManager::TimeoutCallback, | 1115 base::Bind(&SafeBrowsingDatabaseManager::TimeoutCallback, |
| 1116 check->timeout_factory_->GetWeakPtr(), check), | 1116 check->timeout_factory_->GetWeakPtr(), check), |
| 1117 check_timeout_); | 1117 check_timeout_); |
| 1118 } | 1118 } |
| OLD | NEW |