diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-27 23:22:08 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-27 23:22:08 +0000 |
commit | b264eab5d4331e19d04f5822be50c88c61b58267 (patch) | |
tree | f419df89f0e49df6cfa3f161062526d8ee648f6e /base/file_util_posix.cc | |
parent | caaa849e2e0cc9caf9a2fe938e43515c35bfa679 (diff) | |
download | chromium_src-b264eab5d4331e19d04f5822be50c88c61b58267.zip chromium_src-b264eab5d4331e19d04f5822be50c88c61b58267.tar.gz chromium_src-b264eab5d4331e19d04f5822be50c88c61b58267.tar.bz2 |
Move Posix file utils to the base namespace.
BUG=
R=rvargas@chromium.org
Review URL: https://codereview.chromium.org/89523002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@237642 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/file_util_posix.cc')
-rw-r--r-- | base/file_util_posix.cc | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/base/file_util_posix.cc b/base/file_util_posix.cc index 721f858..027337f 100644 --- a/base/file_util_posix.cc +++ b/base/file_util_posix.cc @@ -336,22 +336,6 @@ bool DirectoryExists(const FilePath& path) { return false; } -} // namespace base - -// ----------------------------------------------------------------------------- - -namespace file_util { - -using base::stat_wrapper_t; -using base::CallStat; -using base::CallLstat; -using base::DirectoryExists; -using base::FileEnumerator; -using base::FilePath; -using base::MakeAbsoluteFilePath; -using base::RealPath; -using base::VerifySpecificPathControlledByUser; - bool ReadFromFD(int fd, char* buffer, size_t bytes) { size_t total_read = 0; while (total_read < bytes) { @@ -372,8 +356,7 @@ bool CreateSymbolicLink(const FilePath& target_path, symlink_path.value().c_str()) != -1; } -bool ReadSymbolicLink(const FilePath& symlink_path, - FilePath* target_path) { +bool ReadSymbolicLink(const FilePath& symlink_path, FilePath* target_path) { DCHECK(!symlink_path.empty()); DCHECK(target_path); char buf[PATH_MAX]; @@ -389,7 +372,7 @@ bool ReadSymbolicLink(const FilePath& symlink_path, } bool GetPosixFilePermissions(const FilePath& path, int* mode) { - base::ThreadRestrictions::AssertIOAllowed(); + ThreadRestrictions::AssertIOAllowed(); DCHECK(mode); stat_wrapper_t file_info; @@ -404,7 +387,7 @@ bool GetPosixFilePermissions(const FilePath& path, int* mode) { bool SetPosixFilePermissions(const FilePath& path, int mode) { - base::ThreadRestrictions::AssertIOAllowed(); + ThreadRestrictions::AssertIOAllowed(); DCHECK((mode & ~FILE_PERMISSION_MASK) == 0); // Calls stat() so that we can preserve the higher bits like S_ISGID. @@ -422,6 +405,22 @@ bool SetPosixFilePermissions(const FilePath& path, return true; } +} // namespace base + +// ----------------------------------------------------------------------------- + +namespace file_util { + +using base::stat_wrapper_t; +using base::CallStat; +using base::CallLstat; +using base::DirectoryExists; +using base::FileEnumerator; +using base::FilePath; +using base::MakeAbsoluteFilePath; +using base::RealPath; +using base::VerifySpecificPathControlledByUser; + // Creates and opens a temporary file in |directory|, returning the // file descriptor. |path| is set to the temporary file path. // This function does NOT unlink() the file. |