Index: chrome/browser/safe_browsing/incident_reporting/last_download_finder.cc |
diff --git a/chrome/browser/safe_browsing/incident_reporting/last_download_finder.cc b/chrome/browser/safe_browsing/incident_reporting/last_download_finder.cc |
index b3e4f3ff7634f9080b1a1eb6a4ea3c21b6cdd62b..96977484124abe52f6e9f78c6508ff1fd42f2fad 100644 |
--- a/chrome/browser/safe_browsing/incident_reporting/last_download_finder.cc |
+++ b/chrome/browser/safe_browsing/incident_reporting/last_download_finder.cc |
@@ -339,7 +339,21 @@ void LastDownloadFinder::Observe(int type, |
void LastDownloadFinder::OnHistoryServiceLoaded( |
HistoryService* history_service) { |
- OnProfileHistoryLoaded(history_service->profile(), history_service); |
+ for (const auto& pair : profile_states_) { |
+ HistoryService* hs = HistoryServiceFactory::GetForProfileIfExists( |
+ pair.first, Profile::EXPLICIT_ACCESS); |
+ if (hs == history_service) { |
+ // Start the query in the history service if the finder was waiting for |
+ // the service to load. |
+ if (pair.second == WAITING_FOR_HISTORY) { |
+ history_service->QueryDownloads( |
+ base::Bind(&LastDownloadFinder::OnDownloadQuery, |
+ weak_ptr_factory_.GetWeakPtr(), |
+ pair.first)); |
+ } |
+ return; |
+ } |
+ } |
} |
void LastDownloadFinder::HistoryServiceBeingDeleted( |