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

Unified Diff: base/files/scoped_temp_dir.cc

Issue 2893703002: Cleanup PreferenceMACs on browser_tests startup (Closed)
Patch Set: fix compile Created 3 years, 7 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/files/scoped_temp_dir.cc
diff --git a/base/files/scoped_temp_dir.cc b/base/files/scoped_temp_dir.cc
index 26815217c6b46f07ab9540c349df33d2a726c898..a04e825156b6d1be7af531d38813f978a32be1d0 100644
--- a/base/files/scoped_temp_dir.cc
+++ b/base/files/scoped_temp_dir.cc
@@ -9,6 +9,13 @@
namespace base {
+namespace {
+
+constexpr FilePath::CharType kScopedDirPrefix[] =
+ FILE_PATH_LITERAL("scoped_dir");
+
+} // namespace
+
ScopedTempDir::ScopedTempDir() {
}
@@ -23,7 +30,7 @@ bool ScopedTempDir::CreateUniqueTempDir() {
// This "scoped_dir" prefix is only used on Windows and serves as a template
// for the unique name.
- if (!base::CreateNewTempDirectory(FILE_PATH_LITERAL("scoped_dir"), &path_))
+ if (!base::CreateNewTempDirectory(kScopedDirPrefix, &path_))
return false;
return true;
@@ -38,9 +45,7 @@ bool ScopedTempDir::CreateUniqueTempDirUnderPath(const FilePath& base_path) {
return false;
// Create a new, uniquely named directory under |base_path|.
- if (!base::CreateTemporaryDirInDir(base_path,
- FILE_PATH_LITERAL("scoped_dir_"),
- &path_))
+ if (!base::CreateTemporaryDirInDir(base_path, kScopedDirPrefix, &path_))
return false;
return true;
@@ -85,4 +90,9 @@ bool ScopedTempDir::IsValid() const {
return !path_.empty() && DirectoryExists(path_);
}
+// static
+const FilePath::CharType* ScopedTempDir::GetTempDirPrefix() {
+ return kScopedDirPrefix;
+}
+
} // namespace base

Powered by Google App Engine
This is Rietveld 408576698