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

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

Issue 6611023: The optional Malware Details also collects HTTP cache information. See design... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 10 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/safe_browsing_service.cc
===================================================================
--- chrome/browser/safe_browsing/safe_browsing_service.cc (revision 76771)
+++ chrome/browser/safe_browsing/safe_browsing_service.cc (working copy)
@@ -1036,7 +1036,19 @@
void SafeBrowsingService::ReportMalwareDetails(
scoped_refptr<MalwareDetails> details) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ details->AddRef();
lzheng 2011/03/05 00:37:50 We should avoid AddRef() and Release(). And I don'
panayiotis 2011/03/29 18:14:55 Done.
+ // Starts gathering data from the HTTP cache, when done, OnReportReady is
+ // called with the serialized report.
+ details->StartCacheCollection(
+ NewCallback(this, &SafeBrowsingService::OnReportReady));
+}
+
+void SafeBrowsingService::OnReportReady(scoped_refptr<MalwareDetails> details) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ details->Release();
+
scoped_ptr<const std::string> serialized(details->GetSerializedReport());
+
if (!serialized->empty()) {
DVLOG(1) << "Sending serialized malware details.";
protocol_manager_->ReportMalwareDetails(*serialized);

Powered by Google App Engine
This is Rietveld 408576698