diff options
-rw-r--r-- | chrome/browser/safe_browsing/protocol_manager.cc | 6 | ||||
-rw-r--r-- | chrome/browser/safe_browsing/protocol_manager_unittest.cc | 20 |
2 files changed, 24 insertions, 2 deletions
diff --git a/chrome/browser/safe_browsing/protocol_manager.cc b/chrome/browser/safe_browsing/protocol_manager.cc index 342b9d6..127bf5c 100644 --- a/chrome/browser/safe_browsing/protocol_manager.cc +++ b/chrome/browser/safe_browsing/protocol_manager.cc @@ -763,7 +763,8 @@ GURL SafeBrowsingProtocolManager::SafeBrowsingHitUrl( SafeBrowsingService::UrlCheckResult threat_type) const { DCHECK(threat_type == SafeBrowsingService::URL_MALWARE || threat_type == SafeBrowsingService::URL_PHISHING || - threat_type == SafeBrowsingService::BINARY_MALWARE_URL); + threat_type == SafeBrowsingService::BINARY_MALWARE_URL || + threat_type == SafeBrowsingService::BINARY_MALWARE_HASH); // The malware and phishing hits go over HTTP. std::string url = ComposeUrl(http_url_prefix_, "report", client_name_, version_, additional_query_); @@ -778,6 +779,9 @@ GURL SafeBrowsingProtocolManager::SafeBrowsingHitUrl( case SafeBrowsingService::BINARY_MALWARE_URL: threat_list = "binurlhit"; break; + case SafeBrowsingService::BINARY_MALWARE_HASH: + threat_list = "binhashhit"; + break; default: NOTREACHED(); } diff --git a/chrome/browser/safe_browsing/protocol_manager_unittest.cc b/chrome/browser/safe_browsing/protocol_manager_unittest.cc index fc119ff..69bff62 100644 --- a/chrome/browser/safe_browsing/protocol_manager_unittest.cc +++ b/chrome/browser/safe_browsing/protocol_manager_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // @@ -218,6 +218,24 @@ TEST_F(SafeBrowsingProtocolManagerTest, TestSafeBrowsingHitUrl) { pm.SafeBrowsingHitUrl( malicious_url, page_url, referrer_url, false, SafeBrowsingService::URL_PHISHING).spec()); + + EXPECT_EQ("http://info.prefix.com/foo/report?client=unittest&appver=1.0&" + "pver=2.2&additional_query&evts=binurlhit&" + "evtd=http%3A%2F%2Fmalicious.url.com%2F&" + "evtr=http%3A%2F%2Fpage.url.com%2F&evhr=http%3A%2F%2Freferrer." + "url.com%2F&evtb=0", + pm.SafeBrowsingHitUrl( + malicious_url, page_url, referrer_url, + false, SafeBrowsingService::BINARY_MALWARE_URL).spec()); + + EXPECT_EQ("http://info.prefix.com/foo/report?client=unittest&appver=1.0&" + "pver=2.2&additional_query&evts=binhashhit&" + "evtd=http%3A%2F%2Fmalicious.url.com%2F&" + "evtr=http%3A%2F%2Fpage.url.com%2F&evhr=http%3A%2F%2Freferrer." + "url.com%2F&evtb=0", + pm.SafeBrowsingHitUrl( + malicious_url, page_url, referrer_url, + false, SafeBrowsingService::BINARY_MALWARE_HASH).spec()); } TEST_F(SafeBrowsingProtocolManagerTest, TestMalwareDetailsUrl) { |