| Index: base/files/scoped_temp_dir.cc
|
| diff --git a/base/files/scoped_temp_dir.cc b/base/files/scoped_temp_dir.cc
|
| index 26815217c6b46f07ab9540c349df33d2a726c898..dcbf5301523d256e42f9028724278e758ff0cf59 100644
|
| --- a/base/files/scoped_temp_dir.cc
|
| +++ b/base/files/scoped_temp_dir.cc
|
| @@ -13,8 +13,16 @@ ScopedTempDir::ScopedTempDir() {
|
| }
|
|
|
| ScopedTempDir::~ScopedTempDir() {
|
| - if (!path_.empty() && !Delete())
|
| - DLOG(WARNING) << "Could not delete temp dir in dtor.";
|
| + if (!path_.empty()) {
|
| + if (!Delete())
|
| + DLOG(WARNING) << "Could not delete temp dir in dtor.";
|
| + else
|
| + LOG(WARNING) << "Delete in ~ScopedTempDir succeeded";
|
| + } else {
|
| + LOG(WARNING) << "Not calling Delete in ~ScopedTempDir (path empty)";
|
| + }
|
| +
|
| + CHECK(false) << "Deliberate crash.";
|
| }
|
|
|
| bool ScopedTempDir::CreateUniqueTempDir() {
|
| @@ -58,13 +66,19 @@ bool ScopedTempDir::Set(const FilePath& path) {
|
| }
|
|
|
| bool ScopedTempDir::Delete() {
|
| - if (path_.empty())
|
| + if (path_.empty()) {
|
| + LOG(WARNING) << "ScopedTempDir::Delete: Failing due to path being empty";
|
| return false;
|
| + }
|
|
|
| bool ret = base::DeleteFile(path_, true);
|
| if (ret) {
|
| // We only clear the path if deleted the directory.
|
| + LOG(WARNING)
|
| + << "ScopedTempDir::Delete: DeleteFile Succeeded; clearing path";
|
| path_.clear();
|
| + } else {
|
| + LOG(WARNING) << "ScopedTempDir::Delete: DeleteFile Failed";
|
| }
|
|
|
| return ret;
|
| @@ -81,8 +95,12 @@ const FilePath& ScopedTempDir::GetPath() const {
|
| return path_;
|
| }
|
|
|
| +bool ScopedTempDir::IsEmpty() const {
|
| + return path_.empty();
|
| +}
|
| +
|
| bool ScopedTempDir::IsValid() const {
|
| - return !path_.empty() && DirectoryExists(path_);
|
| + return !IsEmpty() && DirectoryExists(path_);
|
| }
|
|
|
| } // namespace base
|
|
|