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

Unified Diff: base/scoped_temp_dir.cc

Issue 2838034: Move the SingletonSocket to a temporary directory (Closed)
Patch Set: Address mattm's comments Created 10 years, 4 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: base/scoped_temp_dir.cc
diff --git a/base/scoped_temp_dir.cc b/base/scoped_temp_dir.cc
index 958dcbcb606204a48460605217b78fb7966dc796..a510ddfca2130da8ccc86de44b003fd5c4abde4d 100644
--- a/base/scoped_temp_dir.cc
+++ b/base/scoped_temp_dir.cc
@@ -11,8 +11,7 @@ ScopedTempDir::ScopedTempDir() {
}
ScopedTempDir::~ScopedTempDir() {
- if (!path_.empty() && !file_util::Delete(path_, true))
- LOG(ERROR) << "ScopedTempDir unable to delete " << path_.value();
+ Delete();
}
bool ScopedTempDir::CreateUniqueTempDir() {
@@ -50,6 +49,12 @@ bool ScopedTempDir::Set(const FilePath& path) {
return true;
}
+void ScopedTempDir::Delete() {
+ if (!path_.empty() && !file_util::Delete(path_, true))
+ LOG(ERROR) << "ScopedTempDir unable to delete " << path_.value();
+ path_.clear();
+}
+
FilePath ScopedTempDir::Take() {
FilePath ret = path_;
path_ = FilePath();

Powered by Google App Engine
This is Rietveld 408576698