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

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

Issue 2594723002: Count number of origins with data affected by clearing "cookies and site data". (Closed)
Patch Set: fix review issues 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
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..3622363f134bb8ca4fc5f3fdfc72e60b119417b6 100644
--- a/chrome/browser/profiles/profile_manager.cc
+++ b/chrome/browser/profiles/profile_manager.cc
@@ -889,12 +889,18 @@ 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),
- base::Bind(&ProfileCleanedUp, value.get()));
+ if (base::PathExists(profile_path)) {
msramek 2017/01/10 13:46:32 This is not a part of this CL.
dullweber 2017/01/10 17:14:38 That's right, I have no idea how I managed to get
+ 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();

Powered by Google App Engine
This is Rietveld 408576698