Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(80)

Unified Diff: chrome/browser/safe_browsing/protocol_manager.cc

Issue 6935032: Include full redirect chain in downloads safebrowsing ping. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/safe_browsing/protocol_manager.cc
diff --git a/chrome/browser/safe_browsing/protocol_manager.cc b/chrome/browser/safe_browsing/protocol_manager.cc
index 127bf5cd5ffc8d2c3d41f8aa5363f3f8804dea90..fec2bdf65c04fa108f0344752dc83666b219ce19 100644
--- a/chrome/browser/safe_browsing/protocol_manager.cc
+++ b/chrome/browser/safe_browsing/protocol_manager.cc
@@ -660,6 +660,26 @@ void SafeBrowsingProtocolManager::ReportSafeBrowsingHit(
safebrowsing_reports_.insert(report);
}
+void SafeBrowsingProtocolManager::ReportSafeBrowsingHitWithChain(
+ const std::vector<GURL>& url_chain,
+ const GURL& referrer_url,
+ bool is_subresource,
+ SafeBrowsingService::UrlCheckResult threat_type) {
+ std::string post_data;
+ for (size_t i = 0; i < url_chain.size(); ++i)
+ post_data += url_chain[i].spec() + "\n";
+
+ GURL report_url = SafeBrowsingHitUrl(url_chain.back(), url_chain.front(),
noelutz 2011/05/06 04:24:12 Do you ever check that there is at least one eleme
panayiotis 2011/05/09 19:44:16 A check would be nice yes. On 2011/05/06 04:24:1
mattm 2011/05/10 02:26:09 Added a DCHECK to DownloadSBClient constructor
+ referrer_url, is_subresource,
+ threat_type);
+ URLFetcher* report = new URLFetcher(report_url, URLFetcher::POST, this);
+ report->set_load_flags(net::LOAD_DISABLE_CACHE);
+ report->set_request_context(request_context_getter_);
+ report->set_upload_data("text/plain", post_data);
+ report->Start();
+ safebrowsing_reports_.insert(report);
+}
+
// Sends malware details for users who opt-in.
void SafeBrowsingProtocolManager::ReportMalwareDetails(
const std::string& report) {

Powered by Google App Engine
This is Rietveld 408576698