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

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

Issue 783963003: Removing HistoryService::profile() method (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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
« no previous file with comments | « chrome/browser/history/history_service.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(
« no previous file with comments | « chrome/browser/history/history_service.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698