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 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 update_in_progress_(false), | 267 update_in_progress_(false), |
268 database_update_in_progress_(false), | 268 database_update_in_progress_(false), |
269 closing_database_(false), | 269 closing_database_(false), |
270 check_timeout_(base::TimeDelta::FromMilliseconds(kCheckTimeoutMs)) { | 270 check_timeout_(base::TimeDelta::FromMilliseconds(kCheckTimeoutMs)) { |
271 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 271 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
272 DCHECK(sb_service_.get() != NULL); | 272 DCHECK(sb_service_.get() != NULL); |
273 | 273 |
274 // Android only supports a subset of FULL_SAFE_BROWSING. | 274 // Android only supports a subset of FULL_SAFE_BROWSING. |
275 // TODO(shess): This shouldn't be OS-driven <http://crbug.com/394379> | 275 // TODO(shess): This shouldn't be OS-driven <http://crbug.com/394379> |
276 #if !defined(OS_ANDROID) | 276 #if !defined(OS_ANDROID) |
277 CommandLine* cmdline = CommandLine::ForCurrentProcess(); | 277 base::CommandLine* cmdline = base::CommandLine::ForCurrentProcess(); |
278 enable_download_protection_ = | 278 enable_download_protection_ = |
279 !cmdline->HasSwitch(switches::kSbDisableDownloadProtection); | 279 !cmdline->HasSwitch(switches::kSbDisableDownloadProtection); |
280 | 280 |
281 // We only download the csd-whitelist if client-side phishing detection is | 281 // We only download the csd-whitelist if client-side phishing detection is |
282 // enabled. | 282 // enabled. |
283 enable_csd_whitelist_ = | 283 enable_csd_whitelist_ = |
284 !cmdline->HasSwitch(switches::kDisableClientSidePhishingDetection); | 284 !cmdline->HasSwitch(switches::kDisableClientSidePhishingDetection); |
285 | 285 |
286 // TODO(noelutz): remove this boolean variable since it should always be true | 286 // TODO(noelutz): remove this boolean variable since it should always be true |
287 // if SafeBrowsing is enabled. Unfortunately, we have no test data for this | 287 // if SafeBrowsing is enabled. Unfortunately, we have no test data for this |
(...skipping 872 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1160 new base::WeakPtrFactory<SafeBrowsingDatabaseManager>(this)); | 1160 new base::WeakPtrFactory<SafeBrowsingDatabaseManager>(this)); |
1161 checks_.insert(check); | 1161 checks_.insert(check); |
1162 | 1162 |
1163 safe_browsing_thread_->message_loop()->PostTask(FROM_HERE, task); | 1163 safe_browsing_thread_->message_loop()->PostTask(FROM_HERE, task); |
1164 | 1164 |
1165 base::MessageLoop::current()->PostDelayedTask(FROM_HERE, | 1165 base::MessageLoop::current()->PostDelayedTask(FROM_HERE, |
1166 base::Bind(&SafeBrowsingDatabaseManager::TimeoutCallback, | 1166 base::Bind(&SafeBrowsingDatabaseManager::TimeoutCallback, |
1167 check->timeout_factory_->GetWeakPtr(), check), | 1167 check->timeout_factory_->GetWeakPtr(), check), |
1168 check_timeout_); | 1168 check_timeout_); |
1169 } | 1169 } |
OLD | NEW |