Chromium Code Reviews| Index: base/scoped_temp_dir.cc |
| =================================================================== |
| --- base/scoped_temp_dir.cc (revision 67430) |
| +++ base/scoped_temp_dir.cc (working copy) |
| @@ -57,10 +57,18 @@ |
| return true; |
| } |
| -void ScopedTempDir::Delete() { |
| - if (!path_.empty() && !file_util::Delete(path_, true)) |
| - LOG(ERROR) << "ScopedTempDir unable to delete " << path_.value(); |
| - path_.clear(); |
| +bool ScopedTempDir::Delete() { |
| + bool ret = false; |
| + if (!path_.empty()) { |
|
Paweł Hajdan Jr.
2010/11/26 21:01:20
nit: Rather:
if (path.empty())
return false;
tommi (sloooow) - chröme
2010/11/26 21:04:44
Done.
|
| + ret = file_util::Delete(path_, true); |
| + if (!ret) { |
|
Paweł Hajdan Jr.
2010/11/26 21:01:20
nit: Put success case first to avoid double-negati
tommi (sloooow) - chröme
2010/11/26 21:04:44
Done.
|
| + // Note that we don't clear the path if we can't delete the directory. |
| + LOG(ERROR) << "ScopedTempDir unable to delete " << path_.value(); |
| + } else { |
| + path_.clear(); |
| + } |
| + } |
| + return ret; |
| } |
| FilePath ScopedTempDir::Take() { |