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

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

Issue 8790006: Add download server IP address to the SafeBrowsing download protection ping. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 years 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/download_protection_service.cc
diff --git a/chrome/browser/safe_browsing/download_protection_service.cc b/chrome/browser/safe_browsing/download_protection_service.cc
index 0e5a2defa1b3a0e24ea3825b782bca5c941efce8..e5699e24d1e0af70c64162a3ffc3e8d81b6fc95d 100644
--- a/chrome/browser/safe_browsing/download_protection_service.cc
+++ b/chrome/browser/safe_browsing/download_protection_service.cc
@@ -158,7 +158,8 @@ DownloadProtectionService::DownloadInfo::FromDownloadItem(
download_info.download_url_chain = item.GetUrlChain();
download_info.referrer_url = item.GetReferrerUrl();
download_info.total_bytes = item.GetTotalBytes();
- // TODO(bryner): Populate user_initiated
+ download_info.remote_address = item.GetRemoteAddress();
+ download_info.user_initiated = item.GetStateInfo().has_user_gesture;
return download_info;
}
@@ -575,6 +576,9 @@ class DownloadProtectionService::CheckClientDownloadRequest
// The last URL in the chain is the download URL.
resource->set_type(ClientDownloadRequest::DOWNLOAD_URL);
resource->set_referrer(info_.referrer_url.spec());
+ if (!info_.remote_address.empty()) {
+ resource->set_remote_ip(info_.remote_address);
+ }
} else {
resource->set_type(ClientDownloadRequest::DOWNLOAD_REDIRECT);
}

Powered by Google App Engine
This is Rietveld 408576698