| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/safe_browsing_service.h" | 5 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 1226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1237 check->is_download = true; | 1237 check->is_download = true; |
| 1238 check->timeout_factory_.reset( | 1238 check->timeout_factory_.reset( |
| 1239 new base::WeakPtrFactory<SafeBrowsingService>(this)); | 1239 new base::WeakPtrFactory<SafeBrowsingService>(this)); |
| 1240 checks_.insert(check); | 1240 checks_.insert(check); |
| 1241 | 1241 |
| 1242 safe_browsing_thread_->message_loop()->PostTask(FROM_HERE, task); | 1242 safe_browsing_thread_->message_loop()->PostTask(FROM_HERE, task); |
| 1243 | 1243 |
| 1244 MessageLoop::current()->PostDelayedTask(FROM_HERE, | 1244 MessageLoop::current()->PostDelayedTask(FROM_HERE, |
| 1245 base::Bind(&SafeBrowsingService::TimeoutCallback, | 1245 base::Bind(&SafeBrowsingService::TimeoutCallback, |
| 1246 check->timeout_factory_->GetWeakPtr(), check), | 1246 check->timeout_factory_->GetWeakPtr(), check), |
| 1247 timeout_ms); | 1247 base::TimeDelta::FromMilliseconds(timeout_ms)); |
| 1248 } | 1248 } |
| 1249 | 1249 |
| 1250 void SafeBrowsingService::UpdateWhitelist(const UnsafeResource& resource) { | 1250 void SafeBrowsingService::UpdateWhitelist(const UnsafeResource& resource) { |
| 1251 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 1251 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 1252 // Whitelist this domain and warning type for the given tab. | 1252 // Whitelist this domain and warning type for the given tab. |
| 1253 WhiteListedEntry entry; | 1253 WhiteListedEntry entry; |
| 1254 entry.render_process_host_id = resource.render_process_host_id; | 1254 entry.render_process_host_id = resource.render_process_host_id; |
| 1255 entry.render_view_id = resource.render_view_id; | 1255 entry.render_view_id = resource.render_view_id; |
| 1256 entry.domain = net::RegistryControlledDomainService::GetDomainAndRegistry( | 1256 entry.domain = net::RegistryControlledDomainService::GetDomainAndRegistry( |
| 1257 resource.url); | 1257 resource.url); |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1355 Stop(); | 1355 Stop(); |
| 1356 | 1356 |
| 1357 if (csd_service_.get()) | 1357 if (csd_service_.get()) |
| 1358 csd_service_->SetEnabledAndRefreshState(enable); | 1358 csd_service_->SetEnabledAndRefreshState(enable); |
| 1359 if (download_service_.get()) { | 1359 if (download_service_.get()) { |
| 1360 download_service_->SetEnabled( | 1360 download_service_->SetEnabled( |
| 1361 enable && !CommandLine::ForCurrentProcess()->HasSwitch( | 1361 enable && !CommandLine::ForCurrentProcess()->HasSwitch( |
| 1362 switches::kDisableImprovedDownloadProtection)); | 1362 switches::kDisableImprovedDownloadProtection)); |
| 1363 } | 1363 } |
| 1364 } | 1364 } |
| OLD | NEW |