Use getenv to get TMPDIR path on macOS as well This avoids the dependency on bundles or frameworks and it's the solution used by other tools such as Ninja and even C++ standard library. Change-Id: I423a8919ee67b6734e090a783122fb094481724e Reviewed-on: https://gn-review.googlesource.com/c/2941 Reviewed-by: Scott Graham <scottmg@chromium.org> Commit-Queue: Petr Hosek <phosek@google.com>
diff --git a/base/files/file_util_posix.cc b/base/files/file_util_posix.cc index 23c7cb4..2ef6afc 100644 --- a/base/files/file_util_posix.cc +++ b/base/files/file_util_posix.cc
@@ -111,15 +111,7 @@ } std::string TempFileName() { -#if defined(OS_MACOSX) - return StringPrintf(".%s.XXXXXX", base::mac::BaseBundleID()); -#endif - -#if defined(GOOGLE_CHROME_BUILD) - return std::string(".com.google.Chrome.XXXXXX"); -#else return std::string(".org.chromium.Chromium.XXXXXX"); -#endif } #if defined(OS_LINUX) || defined(OS_AIX) @@ -578,8 +570,6 @@ #endif // !OS_FUCHSIA -#if !defined(OS_MACOSX) -// This is implemented in file_util_mac.mm for Mac. bool GetTempDir(FilePath* path) { const char* tmp = getenv("TMPDIR"); if (tmp) { @@ -590,7 +580,6 @@ *path = FilePath("/tmp"); return true; } -#endif // !defined(OS_MACOSX) #if !defined(OS_MACOSX) // Mac implementation is in file_util_mac.mm. FilePath GetHomeDir() {