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

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

Issue 418103006: Ignore duplicate calls to safe browsing's last download finder SearchInProfile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/safe_browsing/last_download_finder.cc
diff --git a/chrome/browser/safe_browsing/last_download_finder.cc b/chrome/browser/safe_browsing/last_download_finder.cc
index 05e7c425ffb6dc5ede5203bbba6a18927b2c7051..d0e1c2f17a3fb958f5e7e3e290c97da1e96a001f 100644
--- a/chrome/browser/safe_browsing/last_download_finder.cc
+++ b/chrome/browser/safe_browsing/last_download_finder.cc
@@ -145,6 +145,14 @@ void LastDownloadFinder::SearchInProfile(Profile* profile) {
return;
}
+ // Exit early if already processing this profile. This could happen if, for
+ // example, NOTIFICATION_PROFILE_ADDED arrives after construction while
+ // waiting for NOTIFICATION_HISTORY_LOADED.
+ if (std::find(profiles_.begin(), profiles_.end(), profile) !=
+ profiles_.end()) {
+ return;
+ }
+
HistoryService* history_service =
HistoryServiceFactory::GetForProfile(profile, Profile::IMPLICIT_ACCESS);
// No history service is returned for profiles that do not save history.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698