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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 } | 195 } |
196 | 196 |
197 SafeBrowsingDatabaseManager::~SafeBrowsingDatabaseManager() { | 197 SafeBrowsingDatabaseManager::~SafeBrowsingDatabaseManager() { |
198 // We should have already been shut down. If we're still enabled, then the | 198 // We should have already been shut down. If we're still enabled, then the |
199 // database isn't going to be closed properly, which could lead to corruption. | 199 // database isn't going to be closed properly, which could lead to corruption. |
200 DCHECK(!enabled_); | 200 DCHECK(!enabled_); |
201 } | 201 } |
202 | 202 |
203 bool SafeBrowsingDatabaseManager::CanCheckUrl(const GURL& url) const { | 203 bool SafeBrowsingDatabaseManager::CanCheckUrl(const GURL& url) const { |
204 return url.SchemeIs(chrome::kFtpScheme) || | 204 return url.SchemeIs(chrome::kFtpScheme) || |
205 url.SchemeIs(chrome::kHttpScheme) || | 205 url.SchemeIs(content::kHttpScheme) || |
206 url.SchemeIs(content::kHttpsScheme); | 206 url.SchemeIs(content::kHttpsScheme); |
207 } | 207 } |
208 | 208 |
209 bool SafeBrowsingDatabaseManager::CheckDownloadUrl( | 209 bool SafeBrowsingDatabaseManager::CheckDownloadUrl( |
210 const std::vector<GURL>& url_chain, | 210 const std::vector<GURL>& url_chain, |
211 Client* client) { | 211 Client* client) { |
212 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 212 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
213 if (!enabled_ || !enable_download_protection_) | 213 if (!enabled_ || !enable_download_protection_) |
214 return true; | 214 return true; |
215 | 215 |
(...skipping 878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1094 new base::WeakPtrFactory<SafeBrowsingDatabaseManager>(this)); | 1094 new base::WeakPtrFactory<SafeBrowsingDatabaseManager>(this)); |
1095 checks_.insert(check); | 1095 checks_.insert(check); |
1096 | 1096 |
1097 safe_browsing_thread_->message_loop()->PostTask(FROM_HERE, task); | 1097 safe_browsing_thread_->message_loop()->PostTask(FROM_HERE, task); |
1098 | 1098 |
1099 base::MessageLoop::current()->PostDelayedTask(FROM_HERE, | 1099 base::MessageLoop::current()->PostDelayedTask(FROM_HERE, |
1100 base::Bind(&SafeBrowsingDatabaseManager::TimeoutCallback, | 1100 base::Bind(&SafeBrowsingDatabaseManager::TimeoutCallback, |
1101 check->timeout_factory_->GetWeakPtr(), check), | 1101 check->timeout_factory_->GetWeakPtr(), check), |
1102 check_timeout_); | 1102 check_timeout_); |
1103 } | 1103 } |
OLD | NEW |