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

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

Issue 1436273002: Send safe browsing ThreatDetails to track download CTR when user tries to recover blocked downloads (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit Created 5 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/safe_browsing_service.cc
diff --git a/chrome/browser/safe_browsing/safe_browsing_service.cc b/chrome/browser/safe_browsing/safe_browsing_service.cc
index 5011cd1760be167f55a29c07463ed14ecbf0191a..17b0bf44076c8522ed17b55b0290af51065c0675 100644
--- a/chrome/browser/safe_browsing/safe_browsing_service.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_service.cc
@@ -645,3 +645,20 @@ void SafeBrowsingService::RefreshState() {
download_service_->SetEnabled(enable);
#endif
}
+
+void SafeBrowsingService::SendDownloadRecoveryReport(
Nathan Parker 2015/11/14 01:04:27 How about moving the thread-hopping to the caller?
Jialiu Lin 2015/11/16 19:30:14 Actually, it is more convenient to do thread hoppi
+ const std::string& report) {
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
+ base::Bind(&SafeBrowsingService::OnSendDownloadRecoveryReport, this,
+ report));
+}
+
+void SafeBrowsingService::OnSendDownloadRecoveryReport(
+ const std::string& report) {
+ LOG(ERROR) << " OnSendDownloadRecoveryReport: " << report;
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
+ if (ping_manager())
+ ping_manager()->ReportThreatDetails(report);
+}

Powered by Google App Engine
This is Rietveld 408576698