Move ComputeDirectorySize to the base namespace.

BUG=
TBR=tfarina

Review URL: https://chromiumcodereview.appspot.com/16950027

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@208091 0039d316-1c4b-4281-b951-d872f2087c98


CrOS-Libchrome-Original-Commit: 0408c755c0c9b65cf199b90eb07c1ba176521ac9
diff --git a/base/file_util.cc b/base/file_util.cc
index 8e0fbb6..049bb36 100644
--- a/base/file_util.cc
+++ b/base/file_util.cc
@@ -19,8 +19,7 @@
 #include "base/strings/stringprintf.h"
 #include "base/strings/utf_string_conversions.h"
 
-using base::FileEnumerator;
-using base::FilePath;
+namespace base {
 
 namespace {
 
@@ -35,9 +34,26 @@
 
 }  // namespace
 
+bool g_bug108724_debug = false;
+
+int64 ComputeDirectorySize(const FilePath& root_path) {
+  int64 running_size = 0;
+  FileEnumerator file_iter(root_path, true, FileEnumerator::FILES);
+  while (!file_iter.Next().empty())
+    running_size += file_iter.GetInfo().GetSize();
+  return running_size;
+}
+
+}  // namespace base
+
+// -----------------------------------------------------------------------------
+
 namespace file_util {
 
-bool g_bug108724_debug = false;
+using base::FileEnumerator;
+using base::FilePath;
+using base::kExtensionSeparator;
+using base::kMaxUniqueFiles;
 
 void InsertBeforeExtension(FilePath* path, const FilePath::StringType& suffix) {
   FilePath::StringType& value =
@@ -270,12 +286,4 @@
   return -1;
 }
 
-int64 ComputeDirectorySize(const FilePath& root_path) {
-  int64 running_size = 0;
-  FileEnumerator file_iter(root_path, true, FileEnumerator::FILES);
-  while (!file_iter.Next().empty())
-    running_size += file_iter.GetInfo().GetSize();
-  return running_size;
-}
-
-}  // namespace
+}  // namespace file_util
diff --git a/base/file_util.h b/base/file_util.h
index ac8649f..2bf46a9 100644
--- a/base/file_util.h
+++ b/base/file_util.h
@@ -37,28 +37,29 @@
 #endif
 
 namespace base {
+
 class Time;
 
-// Returns an absolute version of a relative path. Returns an empty path on
-// error. On POSIX, this function fails if the path does not exist. This
-// function can result in I/O so it can be slow.
-BASE_EXPORT FilePath MakeAbsoluteFilePath(const FilePath& input);
-
-}  // namespace base
-
-namespace file_util {
-
 extern bool g_bug108724_debug;
 
 //-----------------------------------------------------------------------------
 // Functions that involve filesystem access or modification:
 
+// Returns an absolute version of a relative path. Returns an empty path on
+// error. On POSIX, this function fails if the path does not exist. This
+// function can result in I/O so it can be slow.
+BASE_EXPORT FilePath MakeAbsoluteFilePath(const FilePath& input);
+
 // Returns the total number of bytes used by all the files under |root_path|.
 // If the path does not exist the function returns 0.
 //
 // This function is implemented using the FileEnumerator class so it is not
 // particularly speedy in any platform.
-BASE_EXPORT int64 ComputeDirectorySize(const base::FilePath& root_path);
+BASE_EXPORT int64 ComputeDirectorySize(const FilePath& root_path);
+
+}  // namespace base
+
+namespace file_util {
 
 // Deletes the given path, whether it's a file or a directory.
 // If it's a directory, it's perfectly happy to delete all of the
diff --git a/base/file_util_unittest.cc b/base/file_util_unittest.cc
index 4df797e..cbe8f26 100644
--- a/base/file_util_unittest.cc
+++ b/base/file_util_unittest.cc
@@ -336,7 +336,7 @@
   FilePath file_03 = subsubdir_path.Append(FPL("The file 03.txt"));
   CreateTextFile(file_03, L"123");
 
-  int64 computed_size = file_util::ComputeDirectorySize(temp_dir_.path());
+  int64 computed_size = base::ComputeDirectorySize(temp_dir_.path());
   EXPECT_EQ(size_f1 + size_f2 + 3, computed_size);
 }