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

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

Issue 2622853002: Check if a deleted profile still exists before logging that it is still there (Closed)
Patch Set: Created 3 years, 11 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_manager.cc
diff --git a/chrome/browser/profiles/profile_manager.cc b/chrome/browser/profiles/profile_manager.cc
index 26c521b16ce10d8096df050f25ca132fb2bd029f..ab192042a61a91916d88f323d8ecfcc69f7a4338 100644
--- a/chrome/browser/profiles/profile_manager.cc
+++ b/chrome/browser/profiles/profile_manager.cc
@@ -889,12 +889,19 @@ void ProfileManager::CleanUpDeletedProfiles() {
// Although it should never happen, make sure this is a valid path in the
// user_data_dir, so we don't accidentially delete something else.
if (is_valid_profile_path) {
- LOG(WARNING) << "Files of a deleted profile still exist after restart. "
- "Cleaning up now.";
- BrowserThread::PostTaskAndReply(
- BrowserThread::FILE, FROM_HERE,
- base::Bind(&NukeProfileFromDisk, profile_path),
+ if (base::PathExists(profile_path)) {
+ LOG(WARNING) << "Files of a deleted profile still exist after restart. "
+ "Cleaning up now.";
+ BrowserThread::PostTaskAndReply(
+ BrowserThread::FILE, FROM_HERE,
+ base::Bind(&NukeProfileFromDisk, profile_path),
+ base::Bind(&ProfileCleanedUp, value.get()));
+ } else {
+ // Everything is fine, the profile was removed on shutdown.
+ BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
base::Bind(&ProfileCleanedUp, value.get()));
+ }
} else {
LOG(ERROR) << "Found invalid profile path in deleted_profiles: "
<< profile_path.AsUTF8Unsafe();
« 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