| Index: base/file_util_posix.cc
|
| diff --git a/base/file_util_posix.cc b/base/file_util_posix.cc
|
| index fb4ebcfcb843dc5cc31a7f0241ba95034cb107d1..0879510b202241111b985d2fcfe95a5147769bae 100644
|
| --- a/base/file_util_posix.cc
|
| +++ b/base/file_util_posix.cc
|
| @@ -463,25 +463,6 @@ bool GetTempDir(FilePath* path) {
|
| }
|
| #endif // !defined(OS_MACOSX)
|
|
|
| -#if !defined(OS_MACOSX) && !defined(OS_ANDROID)
|
| -// This is implemented in file_util_mac.mm and file_util_android.cc for those
|
| -// platforms.
|
| -bool GetShmemTempDir(bool executable, FilePath* path) {
|
| -#if defined(OS_LINUX)
|
| - bool use_dev_shm = true;
|
| - if (executable) {
|
| - static const bool s_dev_shm_executable = DetermineDevShmExecutable();
|
| - use_dev_shm = s_dev_shm_executable;
|
| - }
|
| - if (use_dev_shm) {
|
| - *path = FilePath("/dev/shm");
|
| - return true;
|
| - }
|
| -#endif
|
| - return GetTempDir(path);
|
| -}
|
| -#endif // !defined(OS_MACOSX) && !defined(OS_ANDROID)
|
| -
|
| #if !defined(OS_MACOSX) // Mac implementation is in file_util_mac.mm.
|
| FilePath GetHomeDir() {
|
| #if defined(OS_CHROMEOS)
|
| @@ -528,14 +509,6 @@ bool CreateTemporaryFile(FilePath* path) {
|
| return true;
|
| }
|
|
|
| -FILE* CreateAndOpenTemporaryShmemFile(FilePath* path, bool executable) {
|
| - FilePath directory;
|
| - if (!GetShmemTempDir(executable, &directory))
|
| - return NULL;
|
| -
|
| - return CreateAndOpenTemporaryFileInDir(directory, path);
|
| -}
|
| -
|
| FILE* CreateAndOpenTemporaryFileInDir(const FilePath& dir, FilePath* path) {
|
| int fd = CreateAndOpenFdForTemporaryFile(dir, path);
|
| if (fd < 0)
|
| @@ -847,6 +820,33 @@ int GetMaximumPathComponentLength(const FilePath& path) {
|
| return pathconf(path.value().c_str(), _PC_NAME_MAX);
|
| }
|
|
|
| +#if !defined(OS_MACOSX) && !defined(OS_ANDROID)
|
| +// This is implemented in file_util_mac.mm and file_util_android.cc for those
|
| +// platforms.
|
| +bool GetShmemTempDir(bool executable, FilePath* path) {
|
| +#if defined(OS_LINUX)
|
| + bool use_dev_shm = true;
|
| + if (executable) {
|
| + static const bool s_dev_shm_executable = DetermineDevShmExecutable();
|
| + use_dev_shm = s_dev_shm_executable;
|
| + }
|
| + if (use_dev_shm) {
|
| + *path = FilePath("/dev/shm");
|
| + return true;
|
| + }
|
| +#endif
|
| + return GetTempDir(path);
|
| +}
|
| +#endif // !defined(OS_MACOSX) && !defined(OS_ANDROID)
|
| +
|
| +FILE* CreateAndOpenTemporaryShmemFile(FilePath* path, bool executable) {
|
| + FilePath directory;
|
| + if (!GetShmemTempDir(executable, &directory))
|
| + return NULL;
|
| +
|
| + return CreateAndOpenTemporaryFileInDir(directory, path);
|
| +}
|
| +
|
| // -----------------------------------------------------------------------------
|
|
|
| namespace internal {
|
|
|