summaryrefslogtreecommitdiffstats
path: root/base/file_util_posix.cc
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-03 17:55:52 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-03 17:55:52 +0000
commit03d9afc0b775748203170a27014a3ee3500aecc2 (patch)
treed911fe4a8ffa53ef58c25689011036399f327b16 /base/file_util_posix.cc
parente7a32a13a89efea50f38288ebeadbc3189d971de (diff)
downloadchromium_src-03d9afc0b775748203170a27014a3ee3500aecc2.zip
chromium_src-03d9afc0b775748203170a27014a3ee3500aecc2.tar.gz
chromium_src-03d9afc0b775748203170a27014a3ee3500aecc2.tar.bz2
Move temp file functions to base namespace.
BUG= Review URL: https://codereview.chromium.org/99923002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@238427 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/file_util_posix.cc')
-rw-r--r--base/file_util_posix.cc44
1 files changed, 22 insertions, 22 deletions
diff --git a/base/file_util_posix.cc b/base/file_util_posix.cc
index 0557350..bfdc9269 100644
--- a/base/file_util_posix.cc
+++ b/base/file_util_posix.cc
@@ -513,25 +513,8 @@ FilePath GetHomeDir() {
}
#endif // !defined(OS_MACOSX)
-} // namespace base
-
-// -----------------------------------------------------------------------------
-
-namespace file_util {
-
-using base::stat_wrapper_t;
-using base::CallStat;
-using base::CallLstat;
-using base::CreateAndOpenFdForTemporaryFile;
-using base::DirectoryExists;
-using base::FileEnumerator;
-using base::FilePath;
-using base::MakeAbsoluteFilePath;
-using base::RealPath;
-using base::VerifySpecificPathControlledByUser;
-
bool CreateTemporaryFile(FilePath* path) {
- base::ThreadRestrictions::AssertIOAllowed(); // For call to close().
+ ThreadRestrictions::AssertIOAllowed(); // For call to close().
FilePath directory;
if (!GetTempDir(&directory))
return false;
@@ -562,7 +545,7 @@ FILE* CreateAndOpenTemporaryFileInDir(const FilePath& dir, FilePath* path) {
}
bool CreateTemporaryFileInDir(const FilePath& dir, FilePath* temp_file) {
- base::ThreadRestrictions::AssertIOAllowed(); // For call to close().
+ ThreadRestrictions::AssertIOAllowed(); // For call to close().
int fd = CreateAndOpenFdForTemporaryFile(dir, temp_file);
return ((fd >= 0) && !IGNORE_EINTR(close(fd)));
}
@@ -570,7 +553,7 @@ bool CreateTemporaryFileInDir(const FilePath& dir, FilePath* temp_file) {
static bool CreateTemporaryDirInDirImpl(const FilePath& base_dir,
const FilePath::StringType& name_tmpl,
FilePath* new_dir) {
- base::ThreadRestrictions::AssertIOAllowed(); // For call to mkdtemp().
+ ThreadRestrictions::AssertIOAllowed(); // For call to mkdtemp().
DCHECK(name_tmpl.find("XXXXXX") != FilePath::StringType::npos)
<< "Directory name template must contain \"XXXXXX\".";
@@ -602,10 +585,27 @@ bool CreateNewTempDirectory(const FilePath::StringType& prefix,
if (!GetTempDir(&tmpdir))
return false;
- return CreateTemporaryDirInDirImpl(tmpdir, base::TempFileName(),
- new_temp_path);
+ return CreateTemporaryDirInDirImpl(tmpdir, TempFileName(), new_temp_path);
}
+
+} // namespace base
+
+// -----------------------------------------------------------------------------
+
+namespace file_util {
+
+using base::stat_wrapper_t;
+using base::CallStat;
+using base::CallLstat;
+using base::CreateAndOpenFdForTemporaryFile;
+using base::DirectoryExists;
+using base::FileEnumerator;
+using base::FilePath;
+using base::MakeAbsoluteFilePath;
+using base::RealPath;
+using base::VerifySpecificPathControlledByUser;
+
bool CreateDirectoryAndGetError(const FilePath& full_path,
base::PlatformFileError* error) {
base::ThreadRestrictions::AssertIOAllowed(); // For call to mkdir().