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

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

Issue 4822002: Send malware reports when a user opts-in from the safe browsing interstitial ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 1 month 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
===================================================================
--- chrome/browser/safe_browsing/protocol_manager.cc (revision 66642)
+++ chrome/browser/safe_browsing/protocol_manager.cc (working copy)
@@ -604,6 +604,21 @@
safebrowsing_reports_.insert(report);
}
+// Sends a malware report.
+void SafeBrowsingProtocolManager::SendMalwareReport(
+ const std::string& report) {
+ GURL report_url = MalwareClientReportUrl();
+ URLFetcher* fetcher = new URLFetcher(report_url, URLFetcher::POST, this);
+ fetcher->set_load_flags(net::LOAD_DISABLE_CACHE);
+ fetcher->set_request_context(request_context_getter_);
+ fetcher->set_upload_data("application/octet-stream", report);
+ // Don't try too hard to send reports on failures.
+ fetcher->set_automatically_retry_on_5xx(false);
+ fetcher->Start();
+ safebrowsing_reports_.insert(fetcher);
+}
+
+
// static
std::string SafeBrowsingProtocolManager::FormatList(
const SBListChunkRanges& list, bool use_mac) {
@@ -704,6 +719,15 @@
is_subresource));
}
+GURL SafeBrowsingProtocolManager::MalwareClientReportUrl() const {
+ std::string url = StringPrintf(
+ "%s/clientreport/malware?client=%s&appver=%s&pver=1.0",
+ mackey_url_prefix_.c_str(),
lzheng 2010/11/30 23:14:49 If safebrowsing backends has only one https url an
panayiotis 2010/12/01 22:34:52 Done.
+ client_name_.c_str(),
+ version_.c_str());
+ return GURL(url);
+}
+
GURL SafeBrowsingProtocolManager::NextChunkUrl(const std::string& url) const {
std::string next_url;
if (!StartsWithASCII(url, "http://", false) &&

Powered by Google App Engine
This is Rietveld 408576698