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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 | 186 |
187 SafeBrowsingDatabaseManager::~SafeBrowsingDatabaseManager() { | 187 SafeBrowsingDatabaseManager::~SafeBrowsingDatabaseManager() { |
188 // We should have already been shut down. If we're still enabled, then the | 188 // We should have already been shut down. If we're still enabled, then the |
189 // database isn't going to be closed properly, which could lead to corruption. | 189 // database isn't going to be closed properly, which could lead to corruption. |
190 DCHECK(!enabled_); | 190 DCHECK(!enabled_); |
191 } | 191 } |
192 | 192 |
193 bool SafeBrowsingDatabaseManager::CanCheckUrl(const GURL& url) const { | 193 bool SafeBrowsingDatabaseManager::CanCheckUrl(const GURL& url) const { |
194 return url.SchemeIs(chrome::kFtpScheme) || | 194 return url.SchemeIs(chrome::kFtpScheme) || |
195 url.SchemeIs(chrome::kHttpScheme) || | 195 url.SchemeIs(chrome::kHttpScheme) || |
196 url.SchemeIs(chrome::kHttpsScheme); | 196 url.SchemeIs(content::kHttpsScheme); |
197 } | 197 } |
198 | 198 |
199 bool SafeBrowsingDatabaseManager::CheckDownloadUrl( | 199 bool SafeBrowsingDatabaseManager::CheckDownloadUrl( |
200 const std::vector<GURL>& url_chain, | 200 const std::vector<GURL>& url_chain, |
201 Client* client) { | 201 Client* client) { |
202 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 202 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
203 if (!enabled_ || !enable_download_protection_) | 203 if (!enabled_ || !enable_download_protection_) |
204 return true; | 204 return true; |
205 | 205 |
206 // We need to check the database for url prefix, and later may fetch the url | 206 // We need to check the database for url prefix, and later may fetch the url |
(...skipping 849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1056 new base::WeakPtrFactory<SafeBrowsingDatabaseManager>(this)); | 1056 new base::WeakPtrFactory<SafeBrowsingDatabaseManager>(this)); |
1057 checks_.insert(check); | 1057 checks_.insert(check); |
1058 | 1058 |
1059 safe_browsing_thread_->message_loop()->PostTask(FROM_HERE, task); | 1059 safe_browsing_thread_->message_loop()->PostTask(FROM_HERE, task); |
1060 | 1060 |
1061 base::MessageLoop::current()->PostDelayedTask(FROM_HERE, | 1061 base::MessageLoop::current()->PostDelayedTask(FROM_HERE, |
1062 base::Bind(&SafeBrowsingDatabaseManager::TimeoutCallback, | 1062 base::Bind(&SafeBrowsingDatabaseManager::TimeoutCallback, |
1063 check->timeout_factory_->GetWeakPtr(), check), | 1063 check->timeout_factory_->GetWeakPtr(), check), |
1064 check_timeout_); | 1064 check_timeout_); |
1065 } | 1065 } |
OLD | NEW |