Chromium Code Reviews| 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) && |