| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "base/singleton.h" | 10 #include "base/singleton.h" |
| (...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 421 cmdline->HasSwitch(switches::kDisableBackgroundNetworking); | 421 cmdline->HasSwitch(switches::kDisableBackgroundNetworking); |
| 422 std::string info_url_prefix = | 422 std::string info_url_prefix = |
| 423 cmdline->HasSwitch(switches::kSbInfoURLPrefix) ? | 423 cmdline->HasSwitch(switches::kSbInfoURLPrefix) ? |
| 424 cmdline->GetSwitchValueASCII(switches::kSbInfoURLPrefix) : | 424 cmdline->GetSwitchValueASCII(switches::kSbInfoURLPrefix) : |
| 425 kSbDefaultInfoURLPrefix; | 425 kSbDefaultInfoURLPrefix; |
| 426 std::string mackey_url_prefix = | 426 std::string mackey_url_prefix = |
| 427 cmdline->HasSwitch(switches::kSbMacKeyURLPrefix) ? | 427 cmdline->HasSwitch(switches::kSbMacKeyURLPrefix) ? |
| 428 cmdline->GetSwitchValueASCII(switches::kSbMacKeyURLPrefix) : | 428 cmdline->GetSwitchValueASCII(switches::kSbMacKeyURLPrefix) : |
| 429 kSbDefaultMacKeyURLPrefix; | 429 kSbDefaultMacKeyURLPrefix; |
| 430 | 430 |
| 431 protocol_manager_ = new SafeBrowsingProtocolManager(this, | 431 protocol_manager_ = |
| 432 client_name, | 432 SafeBrowsingProtocolManager::Create(this, |
| 433 client_key, | 433 client_name, |
| 434 wrapped_key, | 434 client_key, |
| 435 request_context_getter, | 435 wrapped_key, |
| 436 info_url_prefix, | 436 request_context_getter, |
| 437 mackey_url_prefix, | 437 info_url_prefix, |
| 438 disable_auto_update); | 438 mackey_url_prefix, |
| 439 disable_auto_update); |
| 439 | 440 |
| 440 protocol_manager_->Initialize(); | 441 protocol_manager_->Initialize(); |
| 441 } | 442 } |
| 442 | 443 |
| 443 void SafeBrowsingService::OnIOShutdown() { | 444 void SafeBrowsingService::OnIOShutdown() { |
| 444 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 445 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 445 if (!enabled_) | 446 if (!enabled_) |
| 446 return; | 447 return; |
| 447 | 448 |
| 448 enabled_ = false; | 449 enabled_ = false; |
| (...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 852 if (!enabled_) | 853 if (!enabled_) |
| 853 return; | 854 return; |
| 854 | 855 |
| 855 DVLOG(1) << "ReportSafeBrowsingHit: " << malicious_url << " " << page_url | 856 DVLOG(1) << "ReportSafeBrowsingHit: " << malicious_url << " " << page_url |
| 856 << " " << referrer_url << " " << is_subresource << " " | 857 << " " << referrer_url << " " << is_subresource << " " |
| 857 << threat_type; | 858 << threat_type; |
| 858 protocol_manager_->ReportSafeBrowsingHit(malicious_url, page_url, | 859 protocol_manager_->ReportSafeBrowsingHit(malicious_url, page_url, |
| 859 referrer_url, is_subresource, | 860 referrer_url, is_subresource, |
| 860 threat_type); | 861 threat_type); |
| 861 } | 862 } |
| OLD | NEW |