| 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/protocol_manager.h" | 5 #include "chrome/browser/safe_browsing/protocol_manager.h" |
| 6 | 6 |
| 7 #ifndef NDEBUG | 7 #ifndef NDEBUG |
| 8 #include "base/base64.h" | 8 #include "base/base64.h" |
| 9 #endif | 9 #endif |
| 10 #include "base/environment.h" | 10 #include "base/environment.h" |
| (...skipping 779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 790 threat_list = "binhashhit"; | 790 threat_list = "binhashhit"; |
| 791 break; | 791 break; |
| 792 case SafeBrowsingService::CLIENT_SIDE_PHISHING_URL: | 792 case SafeBrowsingService::CLIENT_SIDE_PHISHING_URL: |
| 793 threat_list = "phishcsdhit"; | 793 threat_list = "phishcsdhit"; |
| 794 break; | 794 break; |
| 795 default: | 795 default: |
| 796 NOTREACHED(); | 796 NOTREACHED(); |
| 797 } | 797 } |
| 798 return GURL(base::StringPrintf("%s&evts=%s&evtd=%s&evtr=%s&evhr=%s&evtb=%d", | 798 return GURL(base::StringPrintf("%s&evts=%s&evtd=%s&evtr=%s&evhr=%s&evtb=%d", |
| 799 url.c_str(), threat_list.c_str(), | 799 url.c_str(), threat_list.c_str(), |
| 800 EscapeQueryParamValue(malicious_url.spec(), true).c_str(), | 800 net::EscapeQueryParamValue(malicious_url.spec(), true).c_str(), |
| 801 EscapeQueryParamValue(page_url.spec(), true).c_str(), | 801 net::EscapeQueryParamValue(page_url.spec(), true).c_str(), |
| 802 EscapeQueryParamValue(referrer_url.spec(), true).c_str(), | 802 net::EscapeQueryParamValue(referrer_url.spec(), true).c_str(), |
| 803 is_subresource)); | 803 is_subresource)); |
| 804 } | 804 } |
| 805 | 805 |
| 806 GURL SafeBrowsingProtocolManager::MalwareDetailsUrl() const { | 806 GURL SafeBrowsingProtocolManager::MalwareDetailsUrl() const { |
| 807 // The malware details go over HTTPS. | 807 // The malware details go over HTTPS. |
| 808 std::string url = base::StringPrintf( | 808 std::string url = base::StringPrintf( |
| 809 "%s/clientreport/malware?client=%s&appver=%s&pver=1.0", | 809 "%s/clientreport/malware?client=%s&appver=%s&pver=1.0", |
| 810 https_url_prefix_.c_str(), | 810 https_url_prefix_.c_str(), |
| 811 client_name_.c_str(), | 811 client_name_.c_str(), |
| 812 version_.c_str()); | 812 version_.c_str()); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 825 if (!additional_query_.empty()) { | 825 if (!additional_query_.empty()) { |
| 826 if (next_url.find("?") != std::string::npos) { | 826 if (next_url.find("?") != std::string::npos) { |
| 827 next_url.append("&"); | 827 next_url.append("&"); |
| 828 } else { | 828 } else { |
| 829 next_url.append("?"); | 829 next_url.append("?"); |
| 830 } | 830 } |
| 831 next_url.append(additional_query_); | 831 next_url.append(additional_query_); |
| 832 } | 832 } |
| 833 return GURL(next_url); | 833 return GURL(next_url); |
| 834 } | 834 } |
| OLD | NEW |