[go: nahoru, domu]

Move some more file utils to the base namespace.

This also swaps the order of the parameters to GetShmemTempDir so the out
parameter is last, and enhances some documentation.

Review URL: https://codereview.chromium.org/93263002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@238144 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/base/file_util.cc b/base/file_util.cc
index 5e9790e..1f8ba81 100644
--- a/base/file_util.cc
+++ b/base/file_util.cc
@@ -145,6 +145,14 @@
   return true;
 }
 
+bool IsDirectoryEmpty(const FilePath& dir_path) {
+  FileEnumerator files(dir_path, false,
+      FileEnumerator::FILES | FileEnumerator::DIRECTORIES);
+  if (files.Next().empty())
+    return true;
+  return false;
+}
+
 }  // namespace base
 
 // -----------------------------------------------------------------------------
@@ -155,14 +163,6 @@
 using base::FilePath;
 using base::kMaxUniqueFiles;
 
-bool IsDirectoryEmpty(const FilePath& dir_path) {
-  FileEnumerator files(dir_path, false,
-      FileEnumerator::FILES | FileEnumerator::DIRECTORIES);
-  if (files.Next().empty())
-    return true;
-  return false;
-}
-
 FILE* CreateAndOpenTemporaryFile(FilePath* path) {
   FilePath directory;
   if (!GetTempDir(&directory))