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

Unified Diff: chrome/test/base/testing_profile.cc

Issue 2855123002: Fix crash in TestingProfile if delete fails. (Closed)
Patch Set: Created 3 years, 8 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/test/base/testing_profile.cc
diff --git a/chrome/test/base/testing_profile.cc b/chrome/test/base/testing_profile.cc
index c43d29fdee2dbfb04d59119c832b39124fcdedb7..d7855ee2c2ec9f6b54948ce19ccb24d75e310d2b 100644
--- a/chrome/test/base/testing_profile.cc
+++ b/chrome/test/base/testing_profile.cc
@@ -566,7 +566,12 @@ TestingProfile::~TestingProfile() {
}
base::ThreadRestrictions::ScopedAllowIO allow_io;
- ignore_result(temp_dir_.Delete());
+ if (!temp_dir_.Delete()) {
+ LOG(WARNING) << "Failed to delete temporary directory.";
+ // Make sure |temp_dir_| no longer owns the directory (so it does not try to
+ // delete it in a context where IO is not allowed).
+ ignore_result(temp_dir_.Take());
+ }
}
void TestingProfile::CreateFaviconService() {
« 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