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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 enabled_(false), | 138 enabled_(false), |
139 enable_download_protection_(false), | 139 enable_download_protection_(false), |
140 enable_csd_whitelist_(false), | 140 enable_csd_whitelist_(false), |
141 enable_download_whitelist_(false), | 141 enable_download_whitelist_(false), |
142 enable_extension_blacklist_(false), | 142 enable_extension_blacklist_(false), |
143 enable_side_effect_free_whitelist_(false), | 143 enable_side_effect_free_whitelist_(false), |
144 update_in_progress_(false), | 144 update_in_progress_(false), |
145 database_update_in_progress_(false), | 145 database_update_in_progress_(false), |
146 closing_database_(false), | 146 closing_database_(false), |
147 check_timeout_(base::TimeDelta::FromMilliseconds(kCheckTimeoutMs)) { | 147 check_timeout_(base::TimeDelta::FromMilliseconds(kCheckTimeoutMs)) { |
148 DCHECK(sb_service_ != NULL); | 148 DCHECK(sb_service_.get() != NULL); |
149 | 149 |
150 CommandLine* cmdline = CommandLine::ForCurrentProcess(); | 150 CommandLine* cmdline = CommandLine::ForCurrentProcess(); |
151 enable_download_protection_ = | 151 enable_download_protection_ = |
152 !cmdline->HasSwitch(switches::kSbDisableDownloadProtection); | 152 !cmdline->HasSwitch(switches::kSbDisableDownloadProtection); |
153 | 153 |
154 // We only download the csd-whitelist if client-side phishing detection is | 154 // We only download the csd-whitelist if client-side phishing detection is |
155 // enabled. | 155 // enabled. |
156 enable_csd_whitelist_ = | 156 enable_csd_whitelist_ = |
157 !cmdline->HasSwitch(switches::kDisableClientSidePhishingDetection); | 157 !cmdline->HasSwitch(switches::kDisableClientSidePhishingDetection); |
158 | 158 |
(...skipping 890 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1049 new base::WeakPtrFactory<SafeBrowsingDatabaseManager>(this)); | 1049 new base::WeakPtrFactory<SafeBrowsingDatabaseManager>(this)); |
1050 checks_.insert(check); | 1050 checks_.insert(check); |
1051 | 1051 |
1052 safe_browsing_thread_->message_loop()->PostTask(FROM_HERE, task); | 1052 safe_browsing_thread_->message_loop()->PostTask(FROM_HERE, task); |
1053 | 1053 |
1054 base::MessageLoop::current()->PostDelayedTask(FROM_HERE, | 1054 base::MessageLoop::current()->PostDelayedTask(FROM_HERE, |
1055 base::Bind(&SafeBrowsingDatabaseManager::TimeoutCallback, | 1055 base::Bind(&SafeBrowsingDatabaseManager::TimeoutCallback, |
1056 check->timeout_factory_->GetWeakPtr(), check), | 1056 check->timeout_factory_->GetWeakPtr(), check), |
1057 check_timeout_); | 1057 check_timeout_); |
1058 } | 1058 } |
OLD | NEW |