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

Unified Diff: chrome/browser/safe_browsing/incident_reporting/incident_reporting_service.cc

Issue 562223002: Release resources properly from safe browsing incident reporting service. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@collect
Patch Set: clarity Created 6 years, 3 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/incident_reporting/incident_reporting_service.cc
diff --git a/chrome/browser/safe_browsing/incident_reporting/incident_reporting_service.cc b/chrome/browser/safe_browsing/incident_reporting/incident_reporting_service.cc
index 955e8d4b5047c05454f3201fcaacd45ab18b4ae4..30e5beb801cd139b7fad3f114dcead603725e136 100644
--- a/chrome/browser/safe_browsing/incident_reporting/incident_reporting_service.cc
+++ b/chrome/browser/safe_browsing/incident_reporting/incident_reporting_service.cc
@@ -438,6 +438,10 @@ scoped_ptr<IncidentReportUploader> IncidentReportingService::StartReportUpload(
callback, request_context_getter, report).Pass();
}
+bool IncidentReportingService::IsProcessingReport() const {
+ return report_ != NULL;
+}
+
IncidentReportingService::ProfileContext*
IncidentReportingService::GetOrCreateProfileContext(Profile* profile) {
ProfileContextCollection::iterator it =
@@ -680,11 +684,11 @@ bool IncidentReportingService::WaitingForMostRecentDownload() {
// The next easy case: waiting if the finder is operating.
if (last_download_finder_)
return true;
- // The harder case: waiting if a profile has not yet been added.
+ // The harder case: waiting if a non-NULL profile has not yet been added.
for (ProfileContextCollection::const_iterator scan = profiles_.begin();
scan != profiles_.end();
++scan) {
- if (!scan->second->added)
+ if (scan->first && !scan->second->added)
return true;
}
// There is no most recent download and there's nothing more to wait for.

Powered by Google App Engine
This is Rietveld 408576698