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

Unified Diff: chrome/browser/profiles/profile_info_cache.cc

Issue 892403003: ProfileInfoCache cleanup: use BrowserThread::DeleteSoon instead of custom task (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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/profiles/profile_info_cache.cc
diff --git a/chrome/browser/profiles/profile_info_cache.cc b/chrome/browser/profiles/profile_info_cache.cc
index bcb7ee27f25cbe72bb0b9ea2ecbdff596f4debf1..824a8d8e243b57533cd5e9c6d2db15ba665cd5b2 100644
--- a/chrome/browser/profiles/profile_info_cache.cc
+++ b/chrome/browser/profiles/profile_info_cache.cc
@@ -148,13 +148,6 @@ void DeleteBitmap(const base::FilePath& image_path) {
base::DeleteFile(image_path, false);
}
-// Used by SaveAvatarImageAtPath to post a task to delete the |downloader|
-// "soon". We can't just delete it directly there because
-// SaveAvatarImageAtPath is called from this very downloader.
-void DeleteDownloader(ProfileAvatarDownloader* downloader) {
- delete downloader;
-}
-
} // namespace
ProfileInfoCache::ProfileInfoCache(PrefService* prefs,
@@ -914,9 +907,8 @@ void ProfileInfoCache::SaveAvatarImageAtPath(
if (downloader_iter != avatar_images_downloads_in_progress_.end()) {
// We mustn't delete the avatar downloader right here, since we're being
// called by it.
- BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
- base::Bind(&DeleteDownloader,
- downloader_iter->second));
+ BrowserThread::DeleteSoon(BrowserThread::UI, FROM_HERE,
+ downloader_iter->second);
avatar_images_downloads_in_progress_.erase(downloader_iter);
}
« 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