| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 #if defined(FULL_SAFE_BROWSING) | 70 #if defined(FULL_SAFE_BROWSING) |
| 71 #include "chrome/browser/safe_browsing/client_side_detection_service.h" | 71 #include "chrome/browser/safe_browsing/client_side_detection_service.h" |
| 72 #include "chrome/browser/safe_browsing/download_protection_service.h" | 72 #include "chrome/browser/safe_browsing/download_protection_service.h" |
| 73 #include "chrome/browser/safe_browsing/incident_reporting/binary_integrity_analy
zer.h" | 73 #include "chrome/browser/safe_browsing/incident_reporting/binary_integrity_analy
zer.h" |
| 74 #include "chrome/browser/safe_browsing/incident_reporting/blacklist_load_analyze
r.h" | 74 #include "chrome/browser/safe_browsing/incident_reporting/blacklist_load_analyze
r.h" |
| 75 #include "chrome/browser/safe_browsing/incident_reporting/incident_reporting_ser
vice.h" | 75 #include "chrome/browser/safe_browsing/incident_reporting/incident_reporting_ser
vice.h" |
| 76 #include "chrome/browser/safe_browsing/incident_reporting/module_load_analyzer.h
" | 76 #include "chrome/browser/safe_browsing/incident_reporting/module_load_analyzer.h
" |
| 77 #include "chrome/browser/safe_browsing/incident_reporting/resource_request_detec
tor.h" | 77 #include "chrome/browser/safe_browsing/incident_reporting/resource_request_detec
tor.h" |
| 78 #include "chrome/browser/safe_browsing/incident_reporting/variations_seed_signat
ure_analyzer.h" | 78 #include "chrome/browser/safe_browsing/incident_reporting/variations_seed_signat
ure_analyzer.h" |
| 79 #include "chrome/browser/safe_browsing/protocol_manager.h" | 79 #include "chrome/browser/safe_browsing/protocol_manager.h" |
| 80 #include "chrome/browser/safe_browsing/protocol_manager_helper.h" | |
| 81 #endif | 80 #endif |
| 82 | 81 |
| 83 using content::BrowserThread; | 82 using content::BrowserThread; |
| 84 | 83 |
| 85 namespace safe_browsing { | 84 namespace safe_browsing { |
| 86 | 85 |
| 87 namespace { | 86 namespace { |
| 88 | 87 |
| 89 // Filename suffix for the cookie database. | 88 // Filename suffix for the cookie database. |
| 90 const base::FilePath::CharType kCookiesFile[] = FILE_PATH_LITERAL(" Cookies"); | 89 const base::FilePath::CharType kCookiesFile[] = FILE_PATH_LITERAL(" Cookies"); |
| (...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 516 | 515 |
| 517 return config; | 516 return config; |
| 518 } | 517 } |
| 519 | 518 |
| 520 V4ProtocolConfig | 519 V4ProtocolConfig |
| 521 SafeBrowsingService::GetV4ProtocolConfig() const { | 520 SafeBrowsingService::GetV4ProtocolConfig() const { |
| 522 base::CommandLine* cmdline = base::CommandLine::ForCurrentProcess(); | 521 base::CommandLine* cmdline = base::CommandLine::ForCurrentProcess(); |
| 523 return V4ProtocolConfig( | 522 return V4ProtocolConfig( |
| 524 GetProtocolConfigClientName(), | 523 GetProtocolConfigClientName(), |
| 525 cmdline->HasSwitch(::switches::kDisableBackgroundNetworking), | 524 cmdline->HasSwitch(::switches::kDisableBackgroundNetworking), |
| 526 google_apis::GetAPIKey(), SafeBrowsingProtocolManagerHelper::Version()); | 525 google_apis::GetAPIKey(), Version()); |
| 527 } | 526 } |
| 528 | 527 |
| 529 std::string SafeBrowsingService::GetProtocolConfigClientName() const { | 528 std::string SafeBrowsingService::GetProtocolConfigClientName() const { |
| 530 std::string client_name; | 529 std::string client_name; |
| 531 // On Windows, get the safe browsing client name from the browser | 530 // On Windows, get the safe browsing client name from the browser |
| 532 // distribution classes in installer util. These classes don't yet have | 531 // distribution classes in installer util. These classes don't yet have |
| 533 // an analog on non-Windows builds so just keep the name specified here. | 532 // an analog on non-Windows builds so just keep the name specified here. |
| 534 #if defined(OS_WIN) | 533 #if defined(OS_WIN) |
| 535 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); | 534 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); |
| 536 client_name = dist->GetSafeBrowsingName(); | 535 client_name = dist->GetSafeBrowsingName(); |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 759 ping_manager()->ReportThreatDetails(report); | 758 ping_manager()->ReportThreatDetails(report); |
| 760 } | 759 } |
| 761 | 760 |
| 762 void SafeBrowsingService::ProcessResourceRequest( | 761 void SafeBrowsingService::ProcessResourceRequest( |
| 763 const ResourceRequestInfo& request) { | 762 const ResourceRequestInfo& request) { |
| 764 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 763 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 765 services_delegate_->ProcessResourceRequest(&request); | 764 services_delegate_->ProcessResourceRequest(&request); |
| 766 } | 765 } |
| 767 | 766 |
| 768 } // namespace safe_browsing | 767 } // namespace safe_browsing |
| OLD | NEW |