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

Unified Diff: base/scoped_temp_dir.cc

Issue 5340004: Make ScopedTempDir::Delete return a bool so that its functionality can be te... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 1 month 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: base/scoped_temp_dir.cc
===================================================================
--- base/scoped_temp_dir.cc (revision 67430)
+++ base/scoped_temp_dir.cc (working copy)
@@ -57,10 +57,19 @@
return true;
}
-void ScopedTempDir::Delete() {
- if (!path_.empty() && !file_util::Delete(path_, true))
+bool ScopedTempDir::Delete() {
+ if (path_.empty())
+ return false;
+
+ bool ret = file_util::Delete(path_, true);
+ if (ret) {
+ // We only clear the path if deleted the directory.
+ path_.clear();
+ } else {
LOG(ERROR) << "ScopedTempDir unable to delete " << path_.value();
- path_.clear();
+ }
+
+ return ret;
}
FilePath ScopedTempDir::Take() {

Powered by Google App Engine
This is Rietveld 408576698