| 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/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 1222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1233 check->is_download = true; | 1233 check->is_download = true; |
| 1234 check->timeout_factory_.reset( | 1234 check->timeout_factory_.reset( |
| 1235 new base::WeakPtrFactory<SafeBrowsingService>(this)); | 1235 new base::WeakPtrFactory<SafeBrowsingService>(this)); |
| 1236 checks_.insert(check); | 1236 checks_.insert(check); |
| 1237 | 1237 |
| 1238 safe_browsing_thread_->message_loop()->PostTask(FROM_HERE, task); | 1238 safe_browsing_thread_->message_loop()->PostTask(FROM_HERE, task); |
| 1239 | 1239 |
| 1240 MessageLoop::current()->PostDelayedTask(FROM_HERE, | 1240 MessageLoop::current()->PostDelayedTask(FROM_HERE, |
| 1241 base::Bind(&SafeBrowsingService::TimeoutCallback, | 1241 base::Bind(&SafeBrowsingService::TimeoutCallback, |
| 1242 check->timeout_factory_->GetWeakPtr(), check), | 1242 check->timeout_factory_->GetWeakPtr(), check), |
| 1243 timeout_ms); | 1243 base::TimeDelta::FromMilliseconds(timeout_ms)); |
| 1244 } | 1244 } |
| 1245 | 1245 |
| 1246 void SafeBrowsingService::UpdateWhitelist(const UnsafeResource& resource) { | 1246 void SafeBrowsingService::UpdateWhitelist(const UnsafeResource& resource) { |
| 1247 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 1247 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 1248 // Whitelist this domain and warning type for the given tab. | 1248 // Whitelist this domain and warning type for the given tab. |
| 1249 WhiteListedEntry entry; | 1249 WhiteListedEntry entry; |
| 1250 entry.render_process_host_id = resource.render_process_host_id; | 1250 entry.render_process_host_id = resource.render_process_host_id; |
| 1251 entry.render_view_id = resource.render_view_id; | 1251 entry.render_view_id = resource.render_view_id; |
| 1252 entry.domain = net::RegistryControlledDomainService::GetDomainAndRegistry( | 1252 entry.domain = net::RegistryControlledDomainService::GetDomainAndRegistry( |
| 1253 resource.url); | 1253 resource.url); |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1351 Stop(); | 1351 Stop(); |
| 1352 | 1352 |
| 1353 if (csd_service_.get()) | 1353 if (csd_service_.get()) |
| 1354 csd_service_->SetEnabledAndRefreshState(enable); | 1354 csd_service_->SetEnabledAndRefreshState(enable); |
| 1355 if (download_service_.get()) { | 1355 if (download_service_.get()) { |
| 1356 download_service_->SetEnabled( | 1356 download_service_->SetEnabled( |
| 1357 enable && !CommandLine::ForCurrentProcess()->HasSwitch( | 1357 enable && !CommandLine::ForCurrentProcess()->HasSwitch( |
| 1358 switches::kDisableImprovedDownloadProtection)); | 1358 switches::kDisableImprovedDownloadProtection)); |
| 1359 } | 1359 } |
| 1360 } | 1360 } |
| OLD | NEW |