OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/scoped_temp_dir.h" | 5 #include "base/files/scoped_temp_dir.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 | 9 |
| 10 namespace base { |
| 11 |
10 ScopedTempDir::ScopedTempDir() { | 12 ScopedTempDir::ScopedTempDir() { |
11 } | 13 } |
12 | 14 |
13 ScopedTempDir::~ScopedTempDir() { | 15 ScopedTempDir::~ScopedTempDir() { |
14 if (!path_.empty() && !Delete()) | 16 if (!path_.empty() && !Delete()) |
15 DLOG(WARNING) << "Could not delete temp dir in dtor."; | 17 DLOG(WARNING) << "Could not delete temp dir in dtor."; |
16 } | 18 } |
17 | 19 |
18 bool ScopedTempDir::CreateUniqueTempDir() { | 20 bool ScopedTempDir::CreateUniqueTempDir() { |
19 if (!path_.empty()) | 21 if (!path_.empty()) |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 | 75 |
74 FilePath ScopedTempDir::Take() { | 76 FilePath ScopedTempDir::Take() { |
75 FilePath ret = path_; | 77 FilePath ret = path_; |
76 path_ = FilePath(); | 78 path_ = FilePath(); |
77 return ret; | 79 return ret; |
78 } | 80 } |
79 | 81 |
80 bool ScopedTempDir::IsValid() const { | 82 bool ScopedTempDir::IsValid() const { |
81 return !path_.empty() && file_util::DirectoryExists(path_); | 83 return !path_.empty() && file_util::DirectoryExists(path_); |
82 } | 84 } |
| 85 |
| 86 } // namespace base |
OLD | NEW |