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