summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-09 17:42:26 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-09 17:42:26 +0000
commitf0ff2ad2c5bcf8e206baf27dbfaeef7743fd6c0d (patch)
treef16870d528455ef5acb84e180e6e07afb308ee6f
parent456f3b4c2d9942fd86e7c374426d37f029542a9a (diff)
downloadchromium_src-f0ff2ad2c5bcf8e206baf27dbfaeef7743fd6c0d.zip
chromium_src-f0ff2ad2c5bcf8e206baf27dbfaeef7743fd6c0d.tar.gz
chromium_src-f0ff2ad2c5bcf8e206baf27dbfaeef7743fd6c0d.tar.bz2
Move Copy* into the base namespace.
This also creates a new base::internal namespace in file_util and I moved some of the internal functions in file_util to there. BUG= TBR=jam Review URL: https://codereview.chromium.org/18332014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@210600 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--base/file_util.cc14
-rw-r--r--base/file_util.h65
-rw-r--r--base/file_util_mac.mm19
-rw-r--r--base/file_util_posix.cc191
-rw-r--r--base/file_util_unittest.cc27
-rw-r--r--base/file_util_win.cc228
-rw-r--r--base/prefs/json_pref_store_unittest.cc8
-rw-r--r--chrome/browser/bookmarks/bookmark_storage.cc2
-rw-r--r--chrome/browser/chromeos/drive/file_cache.cc11
-rw-r--r--chrome/browser/chromeos/drive/file_system/copy_operation.cc4
-rw-r--r--chrome/browser/chromeos/extensions/file_manager/file_manager_browsertest.cc2
-rw-r--r--chrome/browser/component_updater/component_patcher_operation.cc2
-rw-r--r--chrome/browser/component_updater/test/component_patcher_unittest.cc4
-rw-r--r--chrome/browser/component_updater/test/component_patcher_unittest_win.cc8
-rw-r--r--chrome/browser/component_updater/widevine_cdm_component_installer.cc2
-rw-r--r--chrome/browser/extensions/api/developer_private/developer_private_api.cc2
-rw-r--r--chrome/browser/extensions/api/file_system/file_system_apitest.cc4
-rw-r--r--chrome/browser/extensions/api/i18n/i18n_apitest.cc8
-rw-r--r--chrome/browser/extensions/api/record/record_api_test.cc2
-rw-r--r--chrome/browser/extensions/convert_user_script.cc4
-rw-r--r--chrome/browser/extensions/extension_service_unittest.cc16
-rw-r--r--chrome/browser/extensions/extension_startup_browsertest.cc7
-rw-r--r--chrome/browser/extensions/pack_extension_unittest.cc2
-rw-r--r--chrome/browser/extensions/platform_app_browsertest.cc2
-rw-r--r--chrome/browser/extensions/sandboxed_unpacker.cc2
-rw-r--r--chrome/browser/extensions/sandboxed_unpacker_unittest.cc2
-rw-r--r--chrome/browser/first_run/first_run.cc2
-rw-r--r--chrome/browser/history/history_backend_unittest.cc6
-rw-r--r--chrome/browser/history/history_database_unittest.cc2
-rw-r--r--chrome/browser/importer/firefox_importer_browsertest.cc7
-rw-r--r--chrome/browser/page_cycler/page_cycler_browsertest.cc5
-rw-r--r--chrome/browser/performance_monitor/performance_monitor_browsertest.cc4
-rw-r--r--chrome/browser/prefs/chrome_pref_service_unittest.cc2
-rw-r--r--chrome/browser/prefs/pref_service_browsertest.cc2
-rw-r--r--chrome/browser/printing/printing_layout_browsertest.cc4
-rw-r--r--chrome/browser/profiles/profile_shortcut_manager_unittest_win.cc10
-rw-r--r--chrome/browser/profiles/profile_shortcut_manager_win.cc2
-rw-r--r--chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc2
-rw-r--r--chrome/browser/sessions/session_service_unittest.cc2
-rw-r--r--chrome/browser/spellchecker/spellcheck_custom_dictionary.cc4
-rw-r--r--chrome/browser/ui/metro_pin_tab_helper_win.cc2
-rw-r--r--chrome/browser/ui/prefs/prefs_tab_helper_browsertest.cc2
-rw-r--r--chrome/browser/value_store/value_store_frontend_unittest.cc2
-rw-r--r--chrome/browser/web_applications/web_app_mac.mm4
-rw-r--r--chrome/common/extensions/unpacker_unittest.cc2
-rw-r--r--chrome/installer/setup/install.cc2
-rw-r--r--chrome/installer/setup/uninstall.cc2
-rw-r--r--chrome/installer/test/alternate_version_generator.cc4
-rw-r--r--chrome/installer/util/copy_tree_work_item.cc4
-rw-r--r--chrome/installer/util/copy_tree_work_item_unittest.cc8
-rw-r--r--chrome/installer/util/delete_tree_work_item.cc4
-rw-r--r--chrome/installer/util/delete_tree_work_item_unittest.cc2
-rw-r--r--chrome/installer/util/move_tree_work_item_unittest.cc4
-rw-r--r--chrome/test/automation/proxy_launcher.cc4
-rw-r--r--chrome/test/mini_installer_test/run_all_unittests.cc2
-rw-r--r--chrome/test/perf/generate_profile.cc2
-rw-r--r--chrome/test/perf/memory_test.cc2
-rw-r--r--chrome/test/perf/perf_ui_test_suite.cc7
-rw-r--r--chrome_frame/test/dll_redirector_loading_test.cc4
-rw-r--r--chrome_frame/test/test_with_web_server.cc4
-rw-r--r--cloud_print/common/win/install_utils.cc2
-rw-r--r--cloud_print/virtual_driver/win/install/setup.cc4
-rw-r--r--content/browser/download/base_file_unittest.cc2
-rw-r--r--content/browser/download/save_file_manager.cc2
-rw-r--r--content/browser/indexed_db/indexed_db_browsertest.cc6
-rw-r--r--net/disk_cache/disk_cache_test_base.cc2
-rw-r--r--tools/traceline/svgui/startup-release.json2
-rw-r--r--webkit/browser/fileapi/native_file_util.cc2
68 files changed, 402 insertions, 379 deletions
diff --git a/base/file_util.cc b/base/file_util.cc
index bf5ce23..4e1163a 100644
--- a/base/file_util.cc
+++ b/base/file_util.cc
@@ -47,7 +47,13 @@ int64 ComputeDirectorySize(const FilePath& root_path) {
bool Move(const FilePath& from_path, const FilePath& to_path) {
if (from_path.ReferencesParent() || to_path.ReferencesParent())
return false;
- return MoveUnsafe(from_path, to_path);
+ return internal::MoveUnsafe(from_path, to_path);
+}
+
+bool CopyFile(const FilePath& from_path, const FilePath& to_path) {
+ if (from_path.ReferencesParent() || to_path.ReferencesParent())
+ return false;
+ return internal::CopyFileUnsafe(from_path, to_path);
}
} // namespace base
@@ -61,12 +67,6 @@ using base::FilePath;
using base::kExtensionSeparator;
using base::kMaxUniqueFiles;
-bool CopyFile(const FilePath& from_path, const FilePath& to_path) {
- if (from_path.ReferencesParent() || to_path.ReferencesParent())
- return false;
- return CopyFileUnsafe(from_path, to_path);
-}
-
bool ContentsEqual(const FilePath& filename1, const FilePath& filename2) {
// We open the file in binary format even if they are text files because
// we are just comparing that bytes are exactly same in both files and not
diff --git a/base/file_util.h b/base/file_util.h
index bdef48a..321070f 100644
--- a/base/file_util.h
+++ b/base/file_util.h
@@ -87,11 +87,6 @@ BASE_EXPORT bool DeleteAfterReboot(const FilePath& path);
// This function fails if either path contains traversal components ('..').
BASE_EXPORT bool Move(const FilePath& from_path, const FilePath& to_path);
-// Same as Move but allows paths with traversal components.
-// Use only with extreme care.
-BASE_EXPORT bool MoveUnsafe(const FilePath& from_path,
- const FilePath& to_path);
-
// Renames file |from_path| to |to_path|. Both paths must be on the same
// volume, or the function will fail. Destination file will be created
// if it doesn't exist. Prefer this function over Move when dealing with
@@ -102,21 +97,9 @@ BASE_EXPORT bool ReplaceFile(const FilePath& from_path,
const FilePath& to_path,
PlatformFileError* error);
-} // namespace base
-
-// -----------------------------------------------------------------------------
-
-namespace file_util {
-
// Copies a single file. Use CopyDirectory to copy directories.
// This function fails if either path contains traversal components ('..').
-BASE_EXPORT bool CopyFile(const base::FilePath& from_path,
- const base::FilePath& to_path);
-
-// Same as CopyFile but allows paths with traversal components.
-// Use only with extreme care.
-BASE_EXPORT bool CopyFileUnsafe(const base::FilePath& from_path,
- const base::FilePath& to_path);
+BASE_EXPORT bool CopyFile(const FilePath& from_path, const FilePath& to_path);
// Copies the given path, and optionally all subdirectories and their contents
// as well.
@@ -125,10 +108,16 @@ BASE_EXPORT bool CopyFileUnsafe(const base::FilePath& from_path,
// if successful, false otherwise. Wildcards on the names are not supported.
//
// If you only need to copy a file use CopyFile, it's faster.
-BASE_EXPORT bool CopyDirectory(const base::FilePath& from_path,
- const base::FilePath& to_path,
+BASE_EXPORT bool CopyDirectory(const FilePath& from_path,
+ const FilePath& to_path,
bool recursive);
+} // namespace base
+
+// -----------------------------------------------------------------------------
+
+namespace file_util {
+
// Returns true if the given path exists on the local filesystem,
// false otherwise.
BASE_EXPORT bool PathExists(const base::FilePath& path);
@@ -202,15 +191,6 @@ BASE_EXPORT bool SetPosixFilePermissions(const base::FilePath& path,
int mode);
#endif // defined(OS_POSIX)
-#if defined(OS_WIN)
-// Copy from_path to to_path recursively and then delete from_path recursively.
-// Returns true if all operations succeed.
-// This function simulates Move(), but unlike Move() it works across volumes.
-// This fuction is not transactional.
-BASE_EXPORT bool CopyAndDeleteDirectory(const base::FilePath& from_path,
- const base::FilePath& to_path);
-#endif // defined(OS_WIN)
-
// Return true if the given directory is empty
BASE_EXPORT bool IsDirectoryEmpty(const base::FilePath& dir_path);
@@ -454,4 +434,31 @@ BASE_EXPORT bool GetFileSystemType(const base::FilePath& path,
} // namespace file_util
+// Internal --------------------------------------------------------------------
+
+namespace base {
+namespace internal {
+
+// Same as Move but allows paths with traversal components.
+// Use only with extreme care.
+BASE_EXPORT bool MoveUnsafe(const FilePath& from_path,
+ const FilePath& to_path);
+
+// Same as CopyFile but allows paths with traversal components.
+// Use only with extreme care.
+BASE_EXPORT bool CopyFileUnsafe(const FilePath& from_path,
+ const FilePath& to_path);
+
+#if defined(OS_WIN)
+// Copy from_path to to_path recursively and then delete from_path recursively.
+// Returns true if all operations succeed.
+// This function simulates Move(), but unlike Move() it works across volumes.
+// This fuction is not transactional.
+BASE_EXPORT bool CopyAndDeleteDirectory(const FilePath& from_path,
+ const FilePath& to_path);
+#endif // defined(OS_WIN)
+
+} // namespace internal
+} // namespace base
+
#endif // BASE_FILE_UTIL_H_
diff --git a/base/file_util_mac.mm b/base/file_util_mac.mm
index 33ddb42..9d9ac3d 100644
--- a/base/file_util_mac.mm
+++ b/base/file_util_mac.mm
@@ -13,6 +13,18 @@
#include "base/strings/string_util.h"
#include "base/threading/thread_restrictions.h"
+namespace base {
+namespace internal {
+
+bool CopyFileUnsafe(const FilePath& from_path, const FilePath& to_path) {
+ ThreadRestrictions::AssertIOAllowed();
+ return (copyfile(from_path.value().c_str(),
+ to_path.value().c_str(), NULL, COPYFILE_ALL) == 0);
+}
+
+} // namespace internal
+} // namepsace base
+
namespace file_util {
bool GetTempDir(base::FilePath* path) {
@@ -27,11 +39,4 @@ bool GetShmemTempDir(base::FilePath* path, bool executable) {
return GetTempDir(path);
}
-bool CopyFileUnsafe(const base::FilePath& from_path,
- const base::FilePath& to_path) {
- base::ThreadRestrictions::AssertIOAllowed();
- return (copyfile(from_path.value().c_str(),
- to_path.value().c_str(), NULL, COPYFILE_ALL) == 0);
-}
-
} // namespace
diff --git a/base/file_util_posix.cc b/base/file_util_posix.cc
index 899bdb9..018a48d 100644
--- a/base/file_util_posix.cc
+++ b/base/file_util_posix.cc
@@ -197,31 +197,6 @@ bool Delete(const FilePath& path, bool recursive) {
return success;
}
-bool MoveUnsafe(const FilePath& from_path, const FilePath& to_path) {
- ThreadRestrictions::AssertIOAllowed();
- // Windows compatibility: if to_path exists, from_path and to_path
- // must be the same type, either both files, or both directories.
- stat_wrapper_t to_file_info;
- if (CallStat(to_path.value().c_str(), &to_file_info) == 0) {
- stat_wrapper_t from_file_info;
- if (CallStat(from_path.value().c_str(), &from_file_info) == 0) {
- if (S_ISDIR(to_file_info.st_mode) != S_ISDIR(from_file_info.st_mode))
- return false;
- } else {
- return false;
- }
- }
-
- if (rename(from_path.value().c_str(), to_path.value().c_str()) == 0)
- return true;
-
- if (!file_util::CopyDirectory(from_path, to_path, true))
- return false;
-
- Delete(from_path, true);
- return true;
-}
-
bool ReplaceFile(const FilePath& from_path,
const FilePath& to_path,
PlatformFileError* error) {
@@ -233,25 +208,10 @@ bool ReplaceFile(const FilePath& from_path,
return false;
}
-} // namespace base
-
-// -----------------------------------------------------------------------------
-
-namespace file_util {
-
-using base::stat_wrapper_t;
-using base::CallStat;
-using base::CallLstat;
-using base::FileEnumerator;
-using base::FilePath;
-using base::MakeAbsoluteFilePath;
-using base::RealPath;
-using base::VerifySpecificPathControlledByUser;
-
bool CopyDirectory(const FilePath& from_path,
const FilePath& to_path,
bool recursive) {
- base::ThreadRestrictions::AssertIOAllowed();
+ ThreadRestrictions::AssertIOAllowed();
// Some old callers of CopyDirectory want it to support wildcards.
// After some discussion, we decided to fix those callers.
// Break loudly here if anyone tries to do this.
@@ -260,14 +220,14 @@ bool CopyDirectory(const FilePath& from_path,
DCHECK(from_path.value().find('*') == std::string::npos);
char top_dir[PATH_MAX];
- if (base::strlcpy(top_dir, from_path.value().c_str(),
- arraysize(top_dir)) >= arraysize(top_dir)) {
+ if (strlcpy(top_dir, from_path.value().c_str(),
+ arraysize(top_dir)) >= arraysize(top_dir)) {
return false;
}
// This function does not properly handle destinations within the source
FilePath real_to_path = to_path;
- if (PathExists(real_to_path)) {
+ if (file_util::PathExists(real_to_path)) {
real_to_path = MakeAbsoluteFilePath(real_to_path);
if (real_to_path.empty())
return false;
@@ -349,6 +309,21 @@ bool CopyDirectory(const FilePath& from_path,
return success;
}
+} // namespace base
+
+// -----------------------------------------------------------------------------
+
+namespace file_util {
+
+using base::stat_wrapper_t;
+using base::CallStat;
+using base::CallLstat;
+using base::FileEnumerator;
+using base::FilePath;
+using base::MakeAbsoluteFilePath;
+using base::RealPath;
+using base::VerifySpecificPathControlledByUser;
+
bool PathExists(const FilePath& path) {
base::ThreadRestrictions::AssertIOAllowed();
return access(path.value().c_str(), F_OK) == 0;
@@ -821,53 +796,6 @@ FilePath GetHomeDir() {
// Last resort.
return FilePath("/tmp");
}
-
-bool CopyFileUnsafe(const FilePath& from_path, const FilePath& to_path) {
- base::ThreadRestrictions::AssertIOAllowed();
- int infile = HANDLE_EINTR(open(from_path.value().c_str(), O_RDONLY));
- if (infile < 0)
- return false;
-
- int outfile = HANDLE_EINTR(creat(to_path.value().c_str(), 0666));
- if (outfile < 0) {
- ignore_result(HANDLE_EINTR(close(infile)));
- return false;
- }
-
- const size_t kBufferSize = 32768;
- std::vector<char> buffer(kBufferSize);
- bool result = true;
-
- while (result) {
- ssize_t bytes_read = HANDLE_EINTR(read(infile, &buffer[0], buffer.size()));
- if (bytes_read < 0) {
- result = false;
- break;
- }
- if (bytes_read == 0)
- break;
- // Allow for partial writes
- ssize_t bytes_written_per_read = 0;
- do {
- ssize_t bytes_written_partial = HANDLE_EINTR(write(
- outfile,
- &buffer[bytes_written_per_read],
- bytes_read - bytes_written_per_read));
- if (bytes_written_partial < 0) {
- result = false;
- break;
- }
- bytes_written_per_read += bytes_written_partial;
- } while (bytes_written_per_read < bytes_read);
- }
-
- if (HANDLE_EINTR(close(infile)) < 0)
- result = false;
- if (HANDLE_EINTR(close(outfile)) < 0)
- result = false;
-
- return result;
-}
#endif // !defined(OS_MACOSX)
bool VerifyPathControlledByUser(const FilePath& base,
@@ -946,3 +874,84 @@ int GetMaximumPathComponentLength(const FilePath& path) {
}
} // namespace file_util
+
+namespace base {
+namespace internal {
+
+bool MoveUnsafe(const FilePath& from_path, const FilePath& to_path) {
+ ThreadRestrictions::AssertIOAllowed();
+ // Windows compatibility: if to_path exists, from_path and to_path
+ // must be the same type, either both files, or both directories.
+ stat_wrapper_t to_file_info;
+ if (CallStat(to_path.value().c_str(), &to_file_info) == 0) {
+ stat_wrapper_t from_file_info;
+ if (CallStat(from_path.value().c_str(), &from_file_info) == 0) {
+ if (S_ISDIR(to_file_info.st_mode) != S_ISDIR(from_file_info.st_mode))
+ return false;
+ } else {
+ return false;
+ }
+ }
+
+ if (rename(from_path.value().c_str(), to_path.value().c_str()) == 0)
+ return true;
+
+ if (!CopyDirectory(from_path, to_path, true))
+ return false;
+
+ Delete(from_path, true);
+ return true;
+}
+
+#if !defined(OS_MACOSX)
+// Mac has its own implementation, this is for all other Posix systems.
+bool CopyFileUnsafe(const FilePath& from_path, const FilePath& to_path) {
+ ThreadRestrictions::AssertIOAllowed();
+ int infile = HANDLE_EINTR(open(from_path.value().c_str(), O_RDONLY));
+ if (infile < 0)
+ return false;
+
+ int outfile = HANDLE_EINTR(creat(to_path.value().c_str(), 0666));
+ if (outfile < 0) {
+ ignore_result(HANDLE_EINTR(close(infile)));
+ return false;
+ }
+
+ const size_t kBufferSize = 32768;
+ std::vector<char> buffer(kBufferSize);
+ bool result = true;
+
+ while (result) {
+ ssize_t bytes_read = HANDLE_EINTR(read(infile, &buffer[0], buffer.size()));
+ if (bytes_read < 0) {
+ result = false;
+ break;
+ }
+ if (bytes_read == 0)
+ break;
+ // Allow for partial writes
+ ssize_t bytes_written_per_read = 0;
+ do {
+ ssize_t bytes_written_partial = HANDLE_EINTR(write(
+ outfile,
+ &buffer[bytes_written_per_read],
+ bytes_read - bytes_written_per_read));
+ if (bytes_written_partial < 0) {
+ result = false;
+ break;
+ }
+ bytes_written_per_read += bytes_written_partial;
+ } while (bytes_written_per_read < bytes_read);
+ }
+
+ if (HANDLE_EINTR(close(infile)) < 0)
+ result = false;
+ if (HANDLE_EINTR(close(outfile)) < 0)
+ result = false;
+
+ return result;
+}
+#endif // !defined(OS_MACOSX)
+
+} // namespace internal
+} // namespace base
diff --git a/base/file_util_unittest.cc b/base/file_util_unittest.cc
index e56192f..5576548 100644
--- a/base/file_util_unittest.cc
+++ b/base/file_util_unittest.cc
@@ -1147,7 +1147,7 @@ TEST_F(FileUtilTest, MoveNew) {
EXPECT_FALSE(base::Move(file_name_from, file_name_to));
EXPECT_TRUE(file_util::PathExists(file_name_from));
EXPECT_FALSE(file_util::PathExists(file_name_to));
- EXPECT_TRUE(base::MoveUnsafe(file_name_from, file_name_to));
+ EXPECT_TRUE(base::internal::MoveUnsafe(file_name_from, file_name_to));
EXPECT_FALSE(file_util::PathExists(file_name_from));
EXPECT_TRUE(file_util::PathExists(file_name_to));
}
@@ -1224,7 +1224,7 @@ TEST_F(FileUtilTest, CopyDirectoryRecursivelyNew) {
ASSERT_FALSE(file_util::PathExists(dir_name_to));
- EXPECT_TRUE(file_util::CopyDirectory(dir_name_from, dir_name_to, true));
+ EXPECT_TRUE(base::CopyDirectory(dir_name_from, dir_name_to, true));
// Check everything has been copied.
EXPECT_TRUE(file_util::PathExists(dir_name_from));
@@ -1279,7 +1279,7 @@ TEST_F(FileUtilTest, CopyDirectoryRecursivelyExists) {
file_util::CreateDirectory(dir_name_exists);
ASSERT_TRUE(file_util::PathExists(dir_name_exists));
- EXPECT_TRUE(file_util::CopyDirectory(dir_name_from, dir_name_exists, true));
+ EXPECT_TRUE(base::CopyDirectory(dir_name_from, dir_name_exists, true));
// Check everything has been copied.
EXPECT_TRUE(file_util::PathExists(dir_name_from));
@@ -1327,7 +1327,7 @@ TEST_F(FileUtilTest, CopyDirectoryNew) {
ASSERT_FALSE(file_util::PathExists(dir_name_to));
- EXPECT_TRUE(file_util::CopyDirectory(dir_name_from, dir_name_to, false));
+ EXPECT_TRUE(base::CopyDirectory(dir_name_from, dir_name_to, false));
// Check everything has been copied.
EXPECT_TRUE(file_util::PathExists(dir_name_from));
@@ -1376,7 +1376,7 @@ TEST_F(FileUtilTest, CopyDirectoryExists) {
file_util::CreateDirectory(dir_name_to);
ASSERT_TRUE(file_util::PathExists(dir_name_to));
- EXPECT_TRUE(file_util::CopyDirectory(dir_name_from, dir_name_to, false));
+ EXPECT_TRUE(base::CopyDirectory(dir_name_from, dir_name_to, false));
// Check everything has been copied.
EXPECT_TRUE(file_util::PathExists(dir_name_from));
@@ -1400,7 +1400,7 @@ TEST_F(FileUtilTest, CopyFileWithCopyDirectoryRecursiveToNew) {
FILE_PATH_LITERAL("Copy_Test_File_Destination.txt"));
ASSERT_FALSE(file_util::PathExists(file_name_to));
- EXPECT_TRUE(file_util::CopyDirectory(file_name_from, file_name_to, true));
+ EXPECT_TRUE(base::CopyDirectory(file_name_from, file_name_to, true));
// Check the has been copied
EXPECT_TRUE(file_util::PathExists(file_name_to));
@@ -1419,7 +1419,7 @@ TEST_F(FileUtilTest, CopyFileWithCopyDirectoryRecursiveToExisting) {
CreateTextFile(file_name_to, L"Old file content");
ASSERT_TRUE(file_util::PathExists(file_name_to));
- EXPECT_TRUE(file_util::CopyDirectory(file_name_from, file_name_to, true));
+ EXPECT_TRUE(base::CopyDirectory(file_name_from, file_name_to, true));
// Check the has been copied
EXPECT_TRUE(file_util::PathExists(file_name_to));
@@ -1441,7 +1441,7 @@ TEST_F(FileUtilTest, CopyFileWithCopyDirectoryRecursiveToExistingDirectory) {
FilePath file_name_to =
dir_name_to.Append(FILE_PATH_LITERAL("Copy_Test_File.txt"));
- EXPECT_TRUE(file_util::CopyDirectory(file_name_from, dir_name_to, true));
+ EXPECT_TRUE(base::CopyDirectory(file_name_from, dir_name_to, true));
// Check the has been copied
EXPECT_TRUE(file_util::PathExists(file_name_to));
@@ -1475,7 +1475,7 @@ TEST_F(FileUtilTest, CopyDirectoryWithTrailingSeparators) {
temp_dir_.path().Append(FILE_PATH_LITERAL("Copy_From_Subdir///"));
#endif
- EXPECT_TRUE(file_util::CopyDirectory(from_path, dir_name_to, true));
+ EXPECT_TRUE(base::CopyDirectory(from_path, dir_name_to, true));
// Check everything has been copied.
EXPECT_TRUE(file_util::PathExists(dir_name_from));
@@ -1500,14 +1500,14 @@ TEST_F(FileUtilTest, CopyFile) {
// Copy the file.
FilePath dest_file = dir_name_from.Append(FILE_PATH_LITERAL("DestFile.txt"));
- ASSERT_TRUE(file_util::CopyFile(file_name_from, dest_file));
+ ASSERT_TRUE(base::CopyFile(file_name_from, dest_file));
// Copy the file to another location using '..' in the path.
FilePath dest_file2(dir_name_from);
dest_file2 = dest_file2.AppendASCII("..");
dest_file2 = dest_file2.AppendASCII("DestFile.txt");
- ASSERT_FALSE(file_util::CopyFile(file_name_from, dest_file2));
- ASSERT_TRUE(file_util::CopyFileUnsafe(file_name_from, dest_file2));
+ ASSERT_FALSE(base::CopyFile(file_name_from, dest_file2));
+ ASSERT_TRUE(base::internal::CopyFileUnsafe(file_name_from, dest_file2));
FilePath dest_file2_test(dir_name_from);
dest_file2_test = dest_file2_test.DirName();
@@ -1644,7 +1644,8 @@ TEST_F(FileUtilTest, CopyAndDeleteDirectoryTest) {
ASSERT_FALSE(file_util::PathExists(dir_name_to));
- EXPECT_TRUE(file_util::CopyAndDeleteDirectory(dir_name_from, dir_name_to));
+ EXPECT_TRUE(base::internal::CopyAndDeleteDirectory(dir_name_from,
+ dir_name_to));
// Check everything has been moved.
EXPECT_FALSE(file_util::PathExists(dir_name_from));
diff --git a/base/file_util_win.cc b/base/file_util_win.cc
index 2a56ea9..928b66e 100644
--- a/base/file_util_win.cc
+++ b/base/file_util_win.cc
@@ -34,6 +34,44 @@ namespace {
const DWORD kFileShareAll =
FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE;
+bool ShellCopy(const FilePath& from_path,
+ const FilePath& to_path,
+ bool recursive) {
+ // WinXP SHFileOperation doesn't like trailing separators.
+ FilePath stripped_from = from_path.StripTrailingSeparators();
+ FilePath stripped_to = to_path.StripTrailingSeparators();
+
+ ThreadRestrictions::AssertIOAllowed();
+
+ // NOTE: I suspect we could support longer paths, but that would involve
+ // analyzing all our usage of files.
+ if (stripped_from.value().length() >= MAX_PATH ||
+ stripped_to.value().length() >= MAX_PATH) {
+ return false;
+ }
+
+ // SHFILEOPSTRUCT wants the path to be terminated with two NULLs,
+ // so we have to use wcscpy because wcscpy_s writes non-NULLs
+ // into the rest of the buffer.
+ wchar_t double_terminated_path_from[MAX_PATH + 1] = {0};
+ wchar_t double_terminated_path_to[MAX_PATH + 1] = {0};
+#pragma warning(suppress:4996) // don't complain about wcscpy deprecation
+ wcscpy(double_terminated_path_from, stripped_from.value().c_str());
+#pragma warning(suppress:4996) // don't complain about wcscpy deprecation
+ wcscpy(double_terminated_path_to, stripped_to.value().c_str());
+
+ SHFILEOPSTRUCT file_operation = {0};
+ file_operation.wFunc = FO_COPY;
+ file_operation.pFrom = double_terminated_path_from;
+ file_operation.pTo = double_terminated_path_to;
+ file_operation.fFlags = FOF_NOERRORUI | FOF_SILENT | FOF_NOCONFIRMATION |
+ FOF_NOCONFIRMMKDIR;
+ if (!recursive)
+ file_operation.fFlags |= FOF_NORECURSION | FOF_FILESONLY;
+
+ return (SHFileOperation(&file_operation) == 0);
+}
+
} // namespace
FilePath MakeAbsoluteFilePath(const FilePath& input) {
@@ -109,40 +147,6 @@ bool DeleteAfterReboot(const FilePath& path) {
MOVEFILE_REPLACE_EXISTING) != FALSE;
}
-bool MoveUnsafe(const FilePath& from_path, const FilePath& to_path) {
- ThreadRestrictions::AssertIOAllowed();
-
- // NOTE: I suspect we could support longer paths, but that would involve
- // analyzing all our usage of files.
- if (from_path.value().length() >= MAX_PATH ||
- to_path.value().length() >= MAX_PATH) {
- return false;
- }
- if (MoveFileEx(from_path.value().c_str(), to_path.value().c_str(),
- MOVEFILE_COPY_ALLOWED | MOVEFILE_REPLACE_EXISTING) != 0)
- return true;
-
- // Keep the last error value from MoveFileEx around in case the below
- // fails.
- bool ret = false;
- DWORD last_error = ::GetLastError();
-
- if (file_util::DirectoryExists(from_path)) {
- // MoveFileEx fails if moving directory across volumes. We will simulate
- // the move by using Copy and Delete. Ideally we could check whether
- // from_path and to_path are indeed in different volumes.
- ret = file_util::CopyAndDeleteDirectory(from_path, to_path);
- }
-
- if (!ret) {
- // Leave a clue about what went wrong so that it can be (at least) picked
- // up by a PLOG entry.
- ::SetLastError(last_error);
- }
-
- return ret;
-}
-
bool ReplaceFile(const FilePath& from_path,
const FilePath& to_path,
PlatformFileError* error) {
@@ -164,82 +168,23 @@ bool ReplaceFile(const FilePath& from_path,
return false;
}
-} // namespace base
-
-// -----------------------------------------------------------------------------
-
-namespace file_util {
-
-using base::FilePath;
-using base::kFileShareAll;
-
-bool CopyFileUnsafe(const FilePath& from_path, const FilePath& to_path) {
- base::ThreadRestrictions::AssertIOAllowed();
-
- // NOTE: I suspect we could support longer paths, but that would involve
- // analyzing all our usage of files.
- if (from_path.value().length() >= MAX_PATH ||
- to_path.value().length() >= MAX_PATH) {
- return false;
- }
- return (::CopyFile(from_path.value().c_str(), to_path.value().c_str(),
- false) != 0);
-}
-
-bool ShellCopy(const FilePath& from_path, const FilePath& to_path,
- bool recursive) {
- // WinXP SHFileOperation doesn't like trailing separators.
- FilePath stripped_from = from_path.StripTrailingSeparators();
- FilePath stripped_to = to_path.StripTrailingSeparators();
-
- base::ThreadRestrictions::AssertIOAllowed();
-
- // NOTE: I suspect we could support longer paths, but that would involve
- // analyzing all our usage of files.
- if (stripped_from.value().length() >= MAX_PATH ||
- stripped_to.value().length() >= MAX_PATH) {
- return false;
- }
-
- // SHFILEOPSTRUCT wants the path to be terminated with two NULLs,
- // so we have to use wcscpy because wcscpy_s writes non-NULLs
- // into the rest of the buffer.
- wchar_t double_terminated_path_from[MAX_PATH + 1] = {0};
- wchar_t double_terminated_path_to[MAX_PATH + 1] = {0};
-#pragma warning(suppress:4996) // don't complain about wcscpy deprecation
- wcscpy(double_terminated_path_from, stripped_from.value().c_str());
-#pragma warning(suppress:4996) // don't complain about wcscpy deprecation
- wcscpy(double_terminated_path_to, stripped_to.value().c_str());
-
- SHFILEOPSTRUCT file_operation = {0};
- file_operation.wFunc = FO_COPY;
- file_operation.pFrom = double_terminated_path_from;
- file_operation.pTo = double_terminated_path_to;
- file_operation.fFlags = FOF_NOERRORUI | FOF_SILENT | FOF_NOCONFIRMATION |
- FOF_NOCONFIRMMKDIR;
- if (!recursive)
- file_operation.fFlags |= FOF_NORECURSION | FOF_FILESONLY;
-
- return (SHFileOperation(&file_operation) == 0);
-}
-
bool CopyDirectory(const FilePath& from_path, const FilePath& to_path,
bool recursive) {
- base::ThreadRestrictions::AssertIOAllowed();
+ ThreadRestrictions::AssertIOAllowed();
if (recursive)
return ShellCopy(from_path, to_path, true);
// The following code assumes that from path is a directory.
- DCHECK(DirectoryExists(from_path));
+ DCHECK(file_util::DirectoryExists(from_path));
// Instead of creating a new directory, we copy the old one to include the
// security information of the folder as part of the copy.
- if (!PathExists(to_path)) {
+ if (!file_util::PathExists(to_path)) {
// Except that Vista fails to do that, and instead do a recursive copy if
// the target directory doesn't exist.
if (base::win::GetVersion() >= base::win::VERSION_VISTA)
- CreateDirectory(to_path);
+ file_util::CreateDirectory(to_path);
else
ShellCopy(from_path, to_path, false);
}
@@ -248,21 +193,14 @@ bool CopyDirectory(const FilePath& from_path, const FilePath& to_path,
return ShellCopy(directory, to_path, false);
}
-bool CopyAndDeleteDirectory(const FilePath& from_path,
- const FilePath& to_path) {
- base::ThreadRestrictions::AssertIOAllowed();
- if (CopyDirectory(from_path, to_path, true)) {
- if (Delete(from_path, true)) {
- return true;
- }
- // Like Move, this function is not transactional, so we just
- // leave the copied bits behind if deleting from_path fails.
- // If to_path exists previously then we have already overwritten
- // it by now, we don't get better off by deleting the new bits.
- }
- return false;
-}
+} // namespace base
+
+// -----------------------------------------------------------------------------
+
+namespace file_util {
+using base::FilePath;
+using base::kFileShareAll;
bool PathExists(const FilePath& path) {
base::ThreadRestrictions::AssertIOAllowed();
@@ -750,3 +688,71 @@ int GetMaximumPathComponentLength(const FilePath& path) {
}
} // namespace file_util
+
+namespace base {
+namespace internal {
+
+bool MoveUnsafe(const FilePath& from_path, const FilePath& to_path) {
+ ThreadRestrictions::AssertIOAllowed();
+
+ // NOTE: I suspect we could support longer paths, but that would involve
+ // analyzing all our usage of files.
+ if (from_path.value().length() >= MAX_PATH ||
+ to_path.value().length() >= MAX_PATH) {
+ return false;
+ }
+ if (MoveFileEx(from_path.value().c_str(), to_path.value().c_str(),
+ MOVEFILE_COPY_ALLOWED | MOVEFILE_REPLACE_EXISTING) != 0)
+ return true;
+
+ // Keep the last error value from MoveFileEx around in case the below
+ // fails.
+ bool ret = false;
+ DWORD last_error = ::GetLastError();
+
+ if (file_util::DirectoryExists(from_path)) {
+ // MoveFileEx fails if moving directory across volumes. We will simulate
+ // the move by using Copy and Delete. Ideally we could check whether
+ // from_path and to_path are indeed in different volumes.
+ ret = internal::CopyAndDeleteDirectory(from_path, to_path);
+ }
+
+ if (!ret) {
+ // Leave a clue about what went wrong so that it can be (at least) picked
+ // up by a PLOG entry.
+ ::SetLastError(last_error);
+ }
+
+ return ret;
+}
+
+bool CopyFileUnsafe(const FilePath& from_path, const FilePath& to_path) {
+ ThreadRestrictions::AssertIOAllowed();
+
+ // NOTE: I suspect we could support longer paths, but that would involve
+ // analyzing all our usage of files.
+ if (from_path.value().length() >= MAX_PATH ||
+ to_path.value().length() >= MAX_PATH) {
+ return false;
+ }
+ return (::CopyFile(from_path.value().c_str(), to_path.value().c_str(),
+ false) != 0);
+}
+
+bool CopyAndDeleteDirectory(const FilePath& from_path,
+ const FilePath& to_path) {
+ ThreadRestrictions::AssertIOAllowed();
+ if (CopyDirectory(from_path, to_path, true)) {
+ if (Delete(from_path, true))
+ return true;
+
+ // Like Move, this function is not transactional, so we just
+ // leave the copied bits behind if deleting from_path fails.
+ // If to_path exists previously then we have already overwritten
+ // it by now, we don't get better off by deleting the new bits.
+ }
+ return false;
+}
+
+} // namespace internal
+} // namespace base
diff --git a/base/prefs/json_pref_store_unittest.cc b/base/prefs/json_pref_store_unittest.cc
index 77f0c0d..c3b89a0 100644
--- a/base/prefs/json_pref_store_unittest.cc
+++ b/base/prefs/json_pref_store_unittest.cc
@@ -70,7 +70,7 @@ TEST_F(JsonPrefStoreTest, NonExistentFile) {
TEST_F(JsonPrefStoreTest, InvalidFile) {
base::FilePath invalid_file_original = data_dir_.AppendASCII("invalid.json");
base::FilePath invalid_file = temp_dir_.path().AppendASCII("invalid.json");
- ASSERT_TRUE(file_util::CopyFile(invalid_file_original, invalid_file));
+ ASSERT_TRUE(base::CopyFile(invalid_file_original, invalid_file));
scoped_refptr<JsonPrefStore> pref_store =
new JsonPrefStore(invalid_file, message_loop_.message_loop_proxy().get());
EXPECT_EQ(PersistentPrefStore::PREF_READ_ERROR_JSON_PARSE,
@@ -152,7 +152,7 @@ void RunBasicJsonPrefStoreTest(JsonPrefStore* pref_store,
}
TEST_F(JsonPrefStoreTest, Basic) {
- ASSERT_TRUE(file_util::CopyFile(data_dir_.AppendASCII("read.json"),
+ ASSERT_TRUE(base::CopyFile(data_dir_.AppendASCII("read.json"),
temp_dir_.path().AppendASCII("write.json")));
// Test that the persistent value can be loaded.
@@ -178,7 +178,7 @@ TEST_F(JsonPrefStoreTest, Basic) {
}
TEST_F(JsonPrefStoreTest, BasicAsync) {
- ASSERT_TRUE(file_util::CopyFile(data_dir_.AppendASCII("read.json"),
+ ASSERT_TRUE(base::CopyFile(data_dir_.AppendASCII("read.json"),
temp_dir_.path().AppendASCII("write.json")));
// Test that the persistent value can be loaded.
@@ -241,7 +241,7 @@ TEST_F(JsonPrefStoreTest, AsyncNonExistingFile) {
TEST_F(JsonPrefStoreTest, NeedsEmptyValue) {
base::FilePath pref_file = temp_dir_.path().AppendASCII("write.json");
- ASSERT_TRUE(file_util::CopyFile(
+ ASSERT_TRUE(base::CopyFile(
data_dir_.AppendASCII("read.need_empty_value.json"),
pref_file));
diff --git a/chrome/browser/bookmarks/bookmark_storage.cc b/chrome/browser/bookmarks/bookmark_storage.cc
index b7b2ce1..8e9e3a3 100644
--- a/chrome/browser/bookmarks/bookmark_storage.cc
+++ b/chrome/browser/bookmarks/bookmark_storage.cc
@@ -33,7 +33,7 @@ const int kSaveDelayMS = 2500;
void BackupCallback(const base::FilePath& path) {
base::FilePath backup_path = path.ReplaceExtension(kBackupExtension);
- file_util::CopyFile(path, backup_path);
+ base::CopyFile(path, backup_path);
}
// Adds node to the model's index, recursing through all children as well.
diff --git a/chrome/browser/chromeos/drive/file_cache.cc b/chrome/browser/chromeos/drive/file_cache.cc
index a563da6..47a44cb 100644
--- a/chrome/browser/chromeos/drive/file_cache.cc
+++ b/chrome/browser/chromeos/drive/file_cache.cc
@@ -90,10 +90,11 @@ bool MoveFile(const base::FilePath& source_path,
return true;
}
-// Copies the file.
-bool CopyFile(const base::FilePath& source_path,
- const base::FilePath& dest_path) {
- if (!file_util::CopyFile(source_path, dest_path)) {
+// Copies the file. Note this isn't called CopyFile which collides with
+// base::CopyFile when doing argument-dependent name lookup.
+bool CopyFileWrapper(const base::FilePath& source_path,
+ const base::FilePath& dest_path) {
+ if (!base::CopyFile(source_path, dest_path)) {
LOG(ERROR) << "Failed to copy " << source_path.value()
<< " to " << dest_path.value();
return false;
@@ -682,7 +683,7 @@ FileError FileCache::StoreInternal(const std::string& resource_id,
success = MoveFile(source_path, dest_path);
break;
case FILE_OPERATION_COPY:
- success = CopyFile(source_path, dest_path);
+ success = CopyFileWrapper(source_path, dest_path);
break;
default:
NOTREACHED();
diff --git a/chrome/browser/chromeos/drive/file_system/copy_operation.cc b/chrome/browser/chromeos/drive/file_system/copy_operation.cc
index bd0b86b..3b10008 100644
--- a/chrome/browser/chromeos/drive/file_system/copy_operation.cc
+++ b/chrome/browser/chromeos/drive/file_system/copy_operation.cc
@@ -28,12 +28,12 @@ namespace file_system {
namespace {
// Copies a file from |src_file_path| to |dest_file_path| on the local
-// file system using file_util::CopyFile.
+// file system using base::CopyFile.
// Returns FILE_ERROR_OK on success or FILE_ERROR_FAILED otherwise.
FileError CopyLocalFileOnBlockingPool(
const base::FilePath& src_file_path,
const base::FilePath& dest_file_path) {
- return file_util::CopyFile(src_file_path, dest_file_path) ?
+ return base::CopyFile(src_file_path, dest_file_path) ?
FILE_ERROR_OK : FILE_ERROR_FAILED;
}
diff --git a/chrome/browser/chromeos/extensions/file_manager/file_manager_browsertest.cc b/chrome/browser/chromeos/extensions/file_manager/file_manager_browsertest.cc
index 2072be6..83cc6f0 100644
--- a/chrome/browser/chromeos/extensions/file_manager/file_manager_browsertest.cc
+++ b/chrome/browser/chromeos/extensions/file_manager/file_manager_browsertest.cc
@@ -118,7 +118,7 @@ class LocalTestVolume {
base::FilePath source_path =
google_apis::test_util::GetTestFilePath("chromeos/file_manager").
AppendASCII(entry.source_file_name);
- ASSERT_TRUE(file_util::CopyFile(source_path, target_path))
+ ASSERT_TRUE(base::CopyFile(source_path, target_path))
<< "Copy from " << source_path.value()
<< " to " << target_path.value() << " failed.";
break;
diff --git a/chrome/browser/component_updater/component_patcher_operation.cc b/chrome/browser/component_updater/component_patcher_operation.cc
index f814238..ba84918 100644
--- a/chrome/browser/component_updater/component_patcher_operation.cc
+++ b/chrome/browser/component_updater/component_patcher_operation.cc
@@ -125,7 +125,7 @@ ComponentUnpacker::Error DeltaUpdateOpCopy::DoParseArguments(
ComponentUnpacker::Error DeltaUpdateOpCopy::DoRun(ComponentPatcher*,
int* error) {
*error = 0;
- if (!file_util::CopyFile(input_abs_path_, output_abs_path_))
+ if (!base::CopyFile(input_abs_path_, output_abs_path_))
return ComponentUnpacker::kDeltaOperationFailure;
return ComponentUnpacker::kNone;
diff --git a/chrome/browser/component_updater/test/component_patcher_unittest.cc b/chrome/browser/component_updater/test/component_patcher_unittest.cc
index 7593a4b..f9933b3 100644
--- a/chrome/browser/component_updater/test/component_patcher_unittest.cc
+++ b/chrome/browser/component_updater/test/component_patcher_unittest.cc
@@ -64,7 +64,7 @@ ComponentUnpacker::Error MockComponentPatcher::Patch(
// Verify that a 'create' delta update operation works correctly.
TEST_F(ComponentPatcherOperationTest, CheckCreateOperation) {
- EXPECT_TRUE(file_util::CopyFile(
+ EXPECT_TRUE(base::CopyFile(
test_file("binary_output.bin"),
input_dir_.path().Append(FILE_PATH_LITERAL("binary_output.bin"))));
@@ -92,7 +92,7 @@ TEST_F(ComponentPatcherOperationTest, CheckCreateOperation) {
// Verify that a 'copy' delta update operation works correctly.
TEST_F(ComponentPatcherOperationTest, CheckCopyOperation) {
- EXPECT_TRUE(file_util::CopyFile(
+ EXPECT_TRUE(base::CopyFile(
test_file("binary_output.bin"),
installed_dir_.path().Append(FILE_PATH_LITERAL("binary_output.bin"))));
diff --git a/chrome/browser/component_updater/test/component_patcher_unittest_win.cc b/chrome/browser/component_updater/test/component_patcher_unittest_win.cc
index 896cf59..9787d92 100644
--- a/chrome/browser/component_updater/test/component_patcher_unittest_win.cc
+++ b/chrome/browser/component_updater/test/component_patcher_unittest_win.cc
@@ -21,10 +21,10 @@
// Verify that a 'courgette' delta update operation works correctly.
TEST_F(ComponentPatcherOperationTest, CheckCourgetteOperation) {
- EXPECT_TRUE(file_util::CopyFile(
+ EXPECT_TRUE(base::CopyFile(
test_file("binary_input.bin"),
installed_dir_.path().Append(FILE_PATH_LITERAL("binary_input.bin"))));
- EXPECT_TRUE(file_util::CopyFile(
+ EXPECT_TRUE(base::CopyFile(
test_file("binary_courgette_patch.bin"),
input_dir_.path().Append(
FILE_PATH_LITERAL("binary_courgette_patch.bin"))));
@@ -53,10 +53,10 @@ TEST_F(ComponentPatcherOperationTest, CheckCourgetteOperation) {
// Verify that a 'bsdiff' delta update operation works correctly.
TEST_F(ComponentPatcherOperationTest, CheckBsdiffOperation) {
- EXPECT_TRUE(file_util::CopyFile(
+ EXPECT_TRUE(base::CopyFile(
test_file("binary_input.bin"),
installed_dir_.path().Append(FILE_PATH_LITERAL("binary_input.bin"))));
- EXPECT_TRUE(file_util::CopyFile(
+ EXPECT_TRUE(base::CopyFile(
test_file("binary_bsdiff_patch.bin"),
input_dir_.path().Append(FILE_PATH_LITERAL("binary_bsdiff_patch.bin"))));
diff --git a/chrome/browser/component_updater/widevine_cdm_component_installer.cc b/chrome/browser/component_updater/widevine_cdm_component_installer.cc
index bbfebbd..fe69eda 100644
--- a/chrome/browser/component_updater/widevine_cdm_component_installer.cc
+++ b/chrome/browser/component_updater/widevine_cdm_component_installer.cc
@@ -239,7 +239,7 @@ bool WidevineCdmComponentInstaller::Install(
base::FilePath adapter_install_path =
install_path.AppendASCII(kWidevineCdmAdapterFileName);
- if (!file_util::CopyFile(adapter_source_path, adapter_install_path))
+ if (!base::CopyFile(adapter_source_path, adapter_install_path))
return false;
// Installation is done. Now register the Widevine CDM with chrome.
diff --git a/chrome/browser/extensions/api/developer_private/developer_private_api.cc b/chrome/browser/extensions/api/developer_private/developer_private_api.cc
index 94e81c5..8df2025 100644
--- a/chrome/browser/extensions/api/developer_private/developer_private_api.cc
+++ b/chrome/browser/extensions/api/developer_private/developer_private_api.cc
@@ -1040,7 +1040,7 @@ void DeveloperPrivateExportSyncfsFolderToLocalfsFunction::CopyFile(
}
if (success_)
- file_util::CopyFile(src_path, target_path);
+ base::CopyFile(src_path, target_path);
CHECK(pendingCopyOperationsCount_ > 0);
pendingCopyOperationsCount_--;
diff --git a/chrome/browser/extensions/api/file_system/file_system_apitest.cc b/chrome/browser/extensions/api/file_system/file_system_apitest.cc
index ab7c4d5..4792b0e 100644
--- a/chrome/browser/extensions/api/file_system/file_system_apitest.cc
+++ b/chrome/browser/extensions/api/file_system/file_system_apitest.cc
@@ -92,7 +92,7 @@ class FileSystemApiTest : public PlatformAppBrowserTest {
base::FilePath destination = temp_dir_.path().AppendASCII(destination_name);
if (copy_gold) {
base::FilePath source = test_root_folder_.AppendASCII("gold.txt");
- EXPECT_TRUE(file_util::CopyFile(source, destination));
+ EXPECT_TRUE(base::CopyFile(source, destination));
}
return destination;
}
@@ -153,7 +153,7 @@ IN_PROC_BROWSER_TEST_F(FileSystemApiTest,
base::FilePath test_file = test_path.AppendASCII("gold.txt");
base::FilePath source = test_root_folder_.AppendASCII("gold.txt");
- EXPECT_TRUE(file_util::CopyFile(source, test_file));
+ EXPECT_TRUE(base::CopyFile(source, test_file));
FileSystemChooseEntryFunction::SkipPickerAndAlwaysSelectPathForTest(
&test_file);
diff --git a/chrome/browser/extensions/api/i18n/i18n_apitest.cc b/chrome/browser/extensions/api/i18n/i18n_apitest.cc
index 12c7142..e6863f6 100644
--- a/chrome/browser/extensions/api/i18n/i18n_apitest.cc
+++ b/chrome/browser/extensions/api/i18n/i18n_apitest.cc
@@ -22,15 +22,15 @@ IN_PROC_BROWSER_TEST_F(ExtensionApiTest, I18NUpdate) {
// Create an Extension whose messages.json file will be updated.
base::ScopedTempDir extension_dir;
ASSERT_TRUE(extension_dir.CreateUniqueTempDir());
- file_util::CopyFile(
+ base::CopyFile(
test_data_dir_.AppendASCII("i18nUpdate")
.AppendASCII("manifest.json"),
extension_dir.path().AppendASCII("manifest.json"));
- file_util::CopyFile(
+ base::CopyFile(
test_data_dir_.AppendASCII("i18nUpdate")
.AppendASCII("contentscript.js"),
extension_dir.path().AppendASCII("contentscript.js"));
- file_util::CopyDirectory(
+ base::CopyDirectory(
test_data_dir_.AppendASCII("i18nUpdate")
.AppendASCII("_locales"),
extension_dir.path().AppendASCII("_locales"),
@@ -51,7 +51,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionApiTest, I18NUpdate) {
EXPECT_EQ(std::string("FIRSTMESSAGE"), UTF16ToUTF8(title));
// Change messages.json file and reload extension.
- file_util::CopyFile(
+ base::CopyFile(
test_data_dir_.AppendASCII("i18nUpdate")
.AppendASCII("messages2.json"),
extension_dir.path().AppendASCII("_locales/en/messages.json"));
diff --git a/chrome/browser/extensions/api/record/record_api_test.cc b/chrome/browser/extensions/api/record/record_api_test.cc
index 4548501..dfcda5d 100644
--- a/chrome/browser/extensions/api/record/record_api_test.cc
+++ b/chrome/browser/extensions/api/record/record_api_test.cc
@@ -104,7 +104,7 @@ class TestProcessStrategy : public ProcessStrategy {
base::FilePath(base::FilePath::StringType(kMockCacheFile)));
if (command_line.HasSwitch(switches::kRecordMode)) {
- file_util::CopyFile(url_path, url_path_copy);
+ base::CopyFile(url_path, url_path_copy);
} else {
if (!file_util::ContentsEqual(url_path, url_path_copy)) {
std::string contents1, contents2;
diff --git a/chrome/browser/extensions/convert_user_script.cc b/chrome/browser/extensions/convert_user_script.cc
index 8bc59bc..0d79540 100644
--- a/chrome/browser/extensions/convert_user_script.cc
+++ b/chrome/browser/extensions/convert_user_script.cc
@@ -164,8 +164,8 @@ scoped_refptr<Extension> ConvertUserScriptToExtension(
}
// Write the script file.
- if (!file_util::CopyFile(user_script_path,
- temp_dir.path().AppendASCII("script.js"))) {
+ if (!base::CopyFile(user_script_path,
+ temp_dir.path().AppendASCII("script.js"))) {
*error = ASCIIToUTF16("Could not copy script file.");
return NULL;
}
diff --git a/chrome/browser/extensions/extension_service_unittest.cc b/chrome/browser/extensions/extension_service_unittest.cc
index 2f26e25a..5200685 100644
--- a/chrome/browser/extensions/extension_service_unittest.cc
+++ b/chrome/browser/extensions/extension_service_unittest.cc
@@ -514,11 +514,11 @@ void ExtensionServiceTestBase::InitializeInstalledExtensionService(
base::Delete(path, true);
file_util::CreateDirectory(path);
base::FilePath temp_prefs = path.Append(FILE_PATH_LITERAL("Preferences"));
- file_util::CopyFile(prefs_file, temp_prefs);
+ base::CopyFile(prefs_file, temp_prefs);
extensions_install_dir_ = path.Append(FILE_PATH_LITERAL("Extensions"));
base::Delete(extensions_install_dir_, true);
- file_util::CopyDirectory(source_install_dir, extensions_install_dir_, true);
+ base::CopyDirectory(source_install_dir, extensions_install_dir_, true);
ExtensionServiceInitParams params;
params.profile_path = path;
@@ -872,7 +872,7 @@ class ExtensionServiceTest
// it.
base::FilePath path = temp_dir_.path();
path = path.Append(in_path.BaseName());
- ASSERT_TRUE(file_util::CopyFile(in_path, path));
+ ASSERT_TRUE(base::CopyFile(in_path, path));
int previous_enabled_extension_count =
service_->extensions()->size();
@@ -2125,7 +2125,7 @@ TEST_F(ExtensionServiceTest, PackPunctuatedExtension) {
// Copy the extension into the output directory, as PackExtensionJob doesn't
// let us choose where to output the packed extension.
- ASSERT_TRUE(file_util::CopyDirectory(input_directory, output_dir, true));
+ ASSERT_TRUE(base::CopyDirectory(input_directory, output_dir, true));
base::FilePath expected_crx_path =
temp_dir.path().Append(expected_crx_names[i]);
@@ -2159,7 +2159,7 @@ TEST_F(ExtensionServiceTest, PackExtensionContainingKeyFails) {
base::ScopedTempDir extension_temp_dir;
ASSERT_TRUE(extension_temp_dir.CreateUniqueTempDir());
base::FilePath input_directory = extension_temp_dir.path().AppendASCII("ext");
- ASSERT_TRUE(file_util::CopyDirectory(
+ ASSERT_TRUE(base::CopyDirectory(
data_dir_
.AppendASCII("good")
.AppendASCII("Extensions")
@@ -2312,7 +2312,7 @@ TEST_F(ExtensionServiceTest, UnpackedExtensionCanChangeID) {
ASSERT_TRUE(file_util::PathExists(manifest_with_key));
// Load the unpacked extension with no key.
- file_util::CopyFile(manifest_no_key, manifest_path);
+ base::CopyFile(manifest_no_key, manifest_path);
extensions::UnpackedInstaller::Create(service_)->Load(extension_path);
loop_.RunUntilIdle();
@@ -2321,7 +2321,7 @@ TEST_F(ExtensionServiceTest, UnpackedExtensionCanChangeID) {
EXPECT_EQ(1u, service_->extensions()->size());
// Add the key to the manifest.
- file_util::CopyFile(manifest_with_key, manifest_path);
+ base::CopyFile(manifest_with_key, manifest_path);
loaded_.clear();
// Reload the extensions.
@@ -2353,7 +2353,7 @@ TEST_F(ExtensionServiceTest, UnpackedExtensionMayContainSymlinkedFiles) {
base::FilePath manifest = extension_path.Append(
extensions::kManifestFilename);
base::FilePath icon_symlink = extension_path.AppendASCII("icon.png");
- file_util::CopyFile(source_manifest, manifest);
+ base::CopyFile(source_manifest, manifest);
file_util::CreateSymbolicLink(source_icon, icon_symlink);
// Load extension.
diff --git a/chrome/browser/extensions/extension_startup_browsertest.cc b/chrome/browser/extensions/extension_startup_browsertest.cc
index 43519a9..e32afc2 100644
--- a/chrome/browser/extensions/extension_startup_browsertest.cc
+++ b/chrome/browser/extensions/extension_startup_browsertest.cc
@@ -70,10 +70,9 @@ class ExtensionStartupTestBase : public InProcessBrowserTest {
PathService::Get(chrome::DIR_TEST_DATA, &src_dir);
src_dir = src_dir.AppendASCII("extensions").AppendASCII("good");
- file_util::CopyFile(src_dir.AppendASCII("Preferences"),
- preferences_file_);
- file_util::CopyDirectory(src_dir.AppendASCII("Extensions"),
- profile_dir, true); // recursive
+ base::CopyFile(src_dir.AppendASCII("Preferences"), preferences_file_);
+ base::CopyDirectory(src_dir.AppendASCII("Extensions"),
+ profile_dir, true); // recursive
}
return true;
}
diff --git a/chrome/browser/extensions/pack_extension_unittest.cc b/chrome/browser/extensions/pack_extension_unittest.cc
index 5198be2..dddfe4d 100644
--- a/chrome/browser/extensions/pack_extension_unittest.cc
+++ b/chrome/browser/extensions/pack_extension_unittest.cc
@@ -31,7 +31,7 @@ class PackExtensionTest : public testing::Test {
bool TestPackExtension(const base::FilePath& path) {
base::ScopedTempDir temp_dir;
EXPECT_TRUE(temp_dir.CreateUniqueTempDir());
- EXPECT_TRUE(file_util::CopyDirectory(path, temp_dir.path(), true));
+ EXPECT_TRUE(base::CopyDirectory(path, temp_dir.path(), true));
CommandLine command_line(CommandLine::NO_PROGRAM);
command_line.AppendSwitchPath(switches::kPackExtension,
temp_dir.path().Append(path.BaseName()));
diff --git a/chrome/browser/extensions/platform_app_browsertest.cc b/chrome/browser/extensions/platform_app_browsertest.cc
index a0cd2c5..9234160 100644
--- a/chrome/browser/extensions/platform_app_browsertest.cc
+++ b/chrome/browser/extensions/platform_app_browsertest.cc
@@ -111,7 +111,7 @@ bool CopyTestDataAndSetCommandLineArg(
const char* filename) {
base::FilePath path = temp_dir.AppendASCII(
filename).NormalizePathSeparators();
- if (!(file_util::CopyFile(test_data_file, path)))
+ if (!(base::CopyFile(test_data_file, path)))
return false;
CommandLine* command_line = CommandLine::ForCurrentProcess();
diff --git a/chrome/browser/extensions/sandboxed_unpacker.cc b/chrome/browser/extensions/sandboxed_unpacker.cc
index 91b4cbc..765bcdb 100644
--- a/chrome/browser/extensions/sandboxed_unpacker.cc
+++ b/chrome/browser/extensions/sandboxed_unpacker.cc
@@ -246,7 +246,7 @@ void SandboxedUnpacker::Start() {
PATH_LENGTH_HISTOGRAM("Extensions.SandboxUnpackTempCrxPathLength",
temp_crx_path);
- if (!file_util::CopyFile(crx_path_, temp_crx_path)) {
+ if (!base::CopyFile(crx_path_, temp_crx_path)) {
// Failed to copy extension file to temporary directory.
ReportFailure(
FAILED_TO_COPY_EXTENSION_FILE_TO_TEMP_DIRECTORY,
diff --git a/chrome/browser/extensions/sandboxed_unpacker_unittest.cc b/chrome/browser/extensions/sandboxed_unpacker_unittest.cc
index 092f8f49..5fde0f7 100644
--- a/chrome/browser/extensions/sandboxed_unpacker_unittest.cc
+++ b/chrome/browser/extensions/sandboxed_unpacker_unittest.cc
@@ -88,7 +88,7 @@ class SandboxedUnpackerTest : public testing::Test {
// CRX to the temp directory, and create a subdirectory into which to
// unpack it.
base::FilePath crx_path = temp_dir_.path().AppendASCII(crx_name);
- ASSERT_TRUE(file_util::CopyFile(original_path, crx_path)) <<
+ ASSERT_TRUE(base::CopyFile(original_path, crx_path)) <<
"Original path: " << original_path.value() <<
", Crx path: " << crx_path.value();
diff --git a/chrome/browser/first_run/first_run.cc b/chrome/browser/first_run/first_run.cc
index 354a159..86011c8 100644
--- a/chrome/browser/first_run/first_run.cc
+++ b/chrome/browser/first_run/first_run.cc
@@ -334,7 +334,7 @@ bool CopyPrefFile(const base::FilePath& user_data_dir,
// The master prefs are regular prefs so we can just copy the file
// to the default place and they just work.
- return file_util::CopyFile(master_prefs_path, user_prefs);
+ return base::CopyFile(master_prefs_path, user_prefs);
}
void SetupMasterPrefsFromInstallPrefs(
diff --git a/chrome/browser/history/history_backend_unittest.cc b/chrome/browser/history/history_backend_unittest.cc
index 75b426b..f97a882 100644
--- a/chrome/browser/history/history_backend_unittest.cc
+++ b/chrome/browser/history/history_backend_unittest.cc
@@ -1279,7 +1279,7 @@ TEST_F(HistoryBackendTest, MigrationVisitSource) {
file_util::CreateDirectory(new_history_path);
base::FilePath new_history_file =
new_history_path.Append(chrome::kHistoryFilename);
- ASSERT_TRUE(file_util::CopyFile(old_history_path, new_history_file));
+ ASSERT_TRUE(base::CopyFile(old_history_path, new_history_file));
backend_ = new HistoryBackend(new_history_path,
0,
@@ -2520,8 +2520,8 @@ TEST_F(HistoryBackendTest, MigrationVisitDuration) {
new_history_path.Append(chrome::kHistoryFilename);
base::FilePath new_archived_file =
new_history_path.Append(chrome::kArchivedHistoryFilename);
- ASSERT_TRUE(file_util::CopyFile(old_history, new_history_file));
- ASSERT_TRUE(file_util::CopyFile(old_archived, new_archived_file));
+ ASSERT_TRUE(base::CopyFile(old_history, new_history_file));
+ ASSERT_TRUE(base::CopyFile(old_archived, new_archived_file));
backend_ = new HistoryBackend(new_history_path,
0,
diff --git a/chrome/browser/history/history_database_unittest.cc b/chrome/browser/history/history_database_unittest.cc
index 45832d4..720a37e 100644
--- a/chrome/browser/history/history_database_unittest.cc
+++ b/chrome/browser/history/history_database_unittest.cc
@@ -28,7 +28,7 @@ TEST(HistoryDatabaseTest, DropBookmarks) {
old_history_path = old_history_path.AppendASCII("bookmarks");
old_history_path = old_history_path.Append(
FILE_PATH_LITERAL("History_with_starred"));
- file_util::CopyFile(old_history_path, db_file);
+ base::CopyFile(old_history_path, db_file);
// Load the DB twice. The first time it should migrate. Make sure that the
// migration leaves it in a state fit to load again later.
diff --git a/chrome/browser/importer/firefox_importer_browsertest.cc b/chrome/browser/importer/firefox_importer_browsertest.cc
index 8cde615..e8d854d 100644
--- a/chrome/browser/importer/firefox_importer_browsertest.cc
+++ b/chrome/browser/importer/firefox_importer_browsertest.cc
@@ -237,10 +237,10 @@ class FirefoxProfileImporterBrowserTest : public InProcessBrowserTest {
base::FilePath data_path;
ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &data_path));
data_path = data_path.AppendASCII(profile_dir);
- ASSERT_TRUE(file_util::CopyDirectory(data_path, profile_path_, true));
+ ASSERT_TRUE(base::CopyDirectory(data_path, profile_path_, true));
ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &data_path));
data_path = data_path.AppendASCII("firefox3_nss");
- ASSERT_TRUE(file_util::CopyDirectory(data_path, profile_path_, false));
+ ASSERT_TRUE(base::CopyDirectory(data_path, profile_path_, false));
base::FilePath search_engine_path = app_path_;
search_engine_path = search_engine_path.AppendASCII("searchplugins");
@@ -253,8 +253,7 @@ class FirefoxProfileImporterBrowserTest : public InProcessBrowserTest {
LOG(ERROR) << L"Missing internal test data";
return;
}
- ASSERT_TRUE(file_util::CopyDirectory(data_path,
- search_engine_path, false));
+ ASSERT_TRUE(base::CopyDirectory(data_path, search_engine_path, false));
}
importer::SourceProfile source_profile;
diff --git a/chrome/browser/page_cycler/page_cycler_browsertest.cc b/chrome/browser/page_cycler/page_cycler_browsertest.cc
index c4d8650..f887001 100644
--- a/chrome/browser/page_cycler/page_cycler_browsertest.cc
+++ b/chrome/browser/page_cycler/page_cycler_browsertest.cc
@@ -160,9 +160,8 @@ class PageCyclerCachedBrowserTest : public PageCyclerBrowserTest {
user_data_dir_.path().AppendASCII("cached_data_dir");
CHECK(!file_util::PathExists(dest_data_dir));
- CHECK(file_util::CopyDirectory(source_data_dir,
- user_data_dir_.path(),
- true)); // recursive.
+ CHECK(base::CopyDirectory(source_data_dir, user_data_dir_.path(),
+ true)); // recursive.
CHECK(file_util::PathExists(dest_data_dir));
command_line->AppendSwitchPath(switches::kUserDataDir,
diff --git a/chrome/browser/performance_monitor/performance_monitor_browsertest.cc b/chrome/browser/performance_monitor/performance_monitor_browsertest.cc
index 3d2c95c..c5aac77 100644
--- a/chrome/browser/performance_monitor/performance_monitor_browsertest.cc
+++ b/chrome/browser/performance_monitor/performance_monitor_browsertest.cc
@@ -311,7 +311,7 @@ class PerformanceMonitorUncleanExitBrowserTest
base::FilePath first_profile_prefs_file =
first_profile.Append(chrome::kPreferencesFilename);
- CHECK(file_util::CopyFile(stock_prefs_file, first_profile_prefs_file));
+ CHECK(base::CopyFile(stock_prefs_file, first_profile_prefs_file));
CHECK(file_util::PathExists(first_profile_prefs_file));
second_profile_name_ =
@@ -324,7 +324,7 @@ class PerformanceMonitorUncleanExitBrowserTest
base::FilePath second_profile_prefs_file =
second_profile.Append(chrome::kPreferencesFilename);
- CHECK(file_util::CopyFile(stock_prefs_file, second_profile_prefs_file));
+ CHECK(base::CopyFile(stock_prefs_file, second_profile_prefs_file));
CHECK(file_util::PathExists(second_profile_prefs_file));
return true;
diff --git a/chrome/browser/prefs/chrome_pref_service_unittest.cc b/chrome/browser/prefs/chrome_pref_service_unittest.cc
index 226c6cf..801ca67 100644
--- a/chrome/browser/prefs/chrome_pref_service_unittest.cc
+++ b/chrome/browser/prefs/chrome_pref_service_unittest.cc
@@ -93,7 +93,7 @@ class ChromePrefServiceUserFilePrefsTest : public testing::Test {
TEST_F(ChromePrefServiceUserFilePrefsTest, PreserveEmptyValue) {
base::FilePath pref_file = temp_dir_.path().AppendASCII("write.json");
- ASSERT_TRUE(file_util::CopyFile(
+ ASSERT_TRUE(base::CopyFile(
data_dir_.AppendASCII("read.need_empty_value.json"),
pref_file));
diff --git a/chrome/browser/prefs/pref_service_browsertest.cc b/chrome/browser/prefs/pref_service_browsertest.cc
index 3b6f712e..c2bcf0f 100644
--- a/chrome/browser/prefs/pref_service_browsertest.cc
+++ b/chrome/browser/prefs/pref_service_browsertest.cc
@@ -80,7 +80,7 @@ class PreferenceServiceTest : public InProcessBrowserTest {
CHECK(file_util::PathExists(reference_pref_file));
// Copy only the Preferences file if |new_profile_|, or Local State if not,
// and the rest will be automatically created.
- CHECK(file_util::CopyFile(reference_pref_file, tmp_pref_file_));
+ CHECK(base::CopyFile(reference_pref_file, tmp_pref_file_));
#if defined(OS_WIN)
// Make the copy writable. On POSIX we assume the umask allows files
diff --git a/chrome/browser/printing/printing_layout_browsertest.cc b/chrome/browser/printing/printing_layout_browsertest.cc
index 5ba5b83..2ce4ffc 100644
--- a/chrome/browser/printing/printing_layout_browsertest.cc
+++ b/chrome/browser/printing/printing_layout_browsertest.cc
@@ -132,7 +132,7 @@ class PrintingLayoutTest : public PrintingTest<InProcessBrowserTest>,
if (GenerateFiles()) {
// Copy the .emf and generate an .png.
- file_util::CopyFile(test_result, emf);
+ base::CopyFile(test_result, emf);
Image emf_content(emf);
emf_content.SaveToPng(png);
// Saving is always fine.
@@ -151,7 +151,7 @@ class PrintingLayoutTest : public PrintingTest<InProcessBrowserTest>,
// Backup the result emf file.
base::FilePath failed(
base_path.Append(verification_name + L"_failed.emf"));
- file_util::CopyFile(test_result, failed);
+ base::CopyFile(test_result, failed);
}
// This verification is only to know that the EMF rendering stays
diff --git a/chrome/browser/profiles/profile_shortcut_manager_unittest_win.cc b/chrome/browser/profiles/profile_shortcut_manager_unittest_win.cc
index e4eb340..22275db 100644
--- a/chrome/browser/profiles/profile_shortcut_manager_unittest_win.cc
+++ b/chrome/browser/profiles/profile_shortcut_manager_unittest_win.cc
@@ -518,7 +518,7 @@ TEST_F(ProfileShortcutManagerTest, RenamedDesktopShortcutsGetDeleted) {
const base::FilePath profile_2_shortcut_path_2 =
GetUserShortcutsDirectory().Append(L"MyChrome.lnk");
// Make a copy of the shortcut.
- ASSERT_TRUE(file_util::CopyFile(profile_2_shortcut_path_1,
+ ASSERT_TRUE(base::CopyFile(profile_2_shortcut_path_1,
profile_2_shortcut_path_2));
ValidateProfileShortcutAtPath(FROM_HERE, profile_2_shortcut_path_1,
profile_2_path_);
@@ -528,7 +528,7 @@ TEST_F(ProfileShortcutManagerTest, RenamedDesktopShortcutsGetDeleted) {
// Also, copy the shortcut for the first user and ensure it gets preserved.
const base::FilePath preserved_profile_1_shortcut_path =
GetUserShortcutsDirectory().Append(L"Preserved.lnk");
- ASSERT_TRUE(file_util::CopyFile(
+ ASSERT_TRUE(base::CopyFile(
GetDefaultShortcutPathForProfile(profile_1_name_),
preserved_profile_1_shortcut_path));
EXPECT_TRUE(file_util::PathExists(preserved_profile_1_shortcut_path));
@@ -550,7 +550,7 @@ TEST_F(ProfileShortcutManagerTest, RenamedDesktopShortcutsAfterProfileRename) {
const base::FilePath profile_2_shortcut_path_2 =
GetUserShortcutsDirectory().Append(L"MyChrome.lnk");
// Make a copy of the shortcut.
- ASSERT_TRUE(file_util::CopyFile(profile_2_shortcut_path_1,
+ ASSERT_TRUE(base::CopyFile(profile_2_shortcut_path_1,
profile_2_shortcut_path_2));
ValidateProfileShortcutAtPath(FROM_HERE, profile_2_shortcut_path_1,
profile_2_path_);
@@ -623,9 +623,9 @@ TEST_F(ProfileShortcutManagerTest, RemoveProfileShortcuts) {
GetUserShortcutsDirectory().Append(L"Copied1.lnk");
const base::FilePath profile_2_shortcut_path_2 =
GetUserShortcutsDirectory().Append(L"Copied2.lnk");
- ASSERT_TRUE(file_util::CopyFile(profile_1_shortcut_path_1,
+ ASSERT_TRUE(base::CopyFile(profile_1_shortcut_path_1,
profile_1_shortcut_path_2));
- ASSERT_TRUE(file_util::CopyFile(profile_2_shortcut_path_1,
+ ASSERT_TRUE(base::CopyFile(profile_2_shortcut_path_1,
profile_2_shortcut_path_2));
ValidateProfileShortcutAtPath(FROM_HERE, profile_1_shortcut_path_2,
profile_1_path_);
diff --git a/chrome/browser/profiles/profile_shortcut_manager_win.cc b/chrome/browser/profiles/profile_shortcut_manager_win.cc
index 239a54e..296fb28 100644
--- a/chrome/browser/profiles/profile_shortcut_manager_win.cc
+++ b/chrome/browser/profiles/profile_shortcut_manager_win.cc
@@ -305,7 +305,7 @@ void RenameChromeDesktopShortcutForProfile(
const base::FilePath possible_old_system_shortcut =
system_shortcuts_directory.Append(old_shortcut_filename);
if (file_util::PathExists(possible_old_system_shortcut))
- file_util::CopyFile(possible_old_system_shortcut, new_shortcut_path);
+ base::CopyFile(possible_old_system_shortcut, new_shortcut_path);
}
}
diff --git a/chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc b/chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc
index 17522f6..a435585 100644
--- a/chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc
@@ -908,7 +908,7 @@ class SafeBrowsingDatabaseManagerCookieTest : public InProcessBrowserTest {
// expires in 2038.
base::FilePath initial_cookies = test_dir.AppendASCII("safe_browsing")
.AppendASCII("Safe Browsing Cookies");
- if (!file_util::CopyFile(initial_cookies, cookie_path)) {
+ if (!base::CopyFile(initial_cookies, cookie_path)) {
EXPECT_TRUE(false);
return false;
}
diff --git a/chrome/browser/sessions/session_service_unittest.cc b/chrome/browser/sessions/session_service_unittest.cc
index 4ed982b..6997901 100644
--- a/chrome/browser/sessions/session_service_unittest.cc
+++ b/chrome/browser/sessions/session_service_unittest.cc
@@ -858,7 +858,7 @@ TEST_F(SessionServiceTest, CanOpenV1TabClosed) {
// Forces closing the file.
helper_.set_service(NULL);
- ASSERT_TRUE(file_util::CopyFile(v1_file_path, dest_file_path));
+ ASSERT_TRUE(base::CopyFile(v1_file_path, dest_file_path));
SessionService* session_service = new SessionService(path_);
helper_.set_service(session_service);
diff --git a/chrome/browser/spellchecker/spellcheck_custom_dictionary.cc b/chrome/browser/spellchecker/spellcheck_custom_dictionary.cc
index c3d2484..cc3db9a 100644
--- a/chrome/browser/spellchecker/spellcheck_custom_dictionary.cc
+++ b/chrome/browser/spellchecker/spellcheck_custom_dictionary.cc
@@ -102,7 +102,7 @@ void LoadDictionaryFileReliably(WordList& custom_words,
if (LoadFile(backup, custom_words) != VALID_CHECKSUM)
return;
// Backup checksum is valid. Restore the backup.
- file_util::CopyFile(backup, path);
+ base::CopyFile(backup, path);
}
// Backs up the original dictionary, saves |custom_words| and its checksum into
@@ -119,7 +119,7 @@ void SaveDictionaryFileReliably(
}
std::string checksum = base::MD5String(content.str());
content << CHECKSUM_PREFIX << checksum;
- file_util::CopyFile(path, path.AddExtension(BACKUP_EXTENSION));
+ base::CopyFile(path, path.AddExtension(BACKUP_EXTENSION));
base::ImportantFileWriter::WriteFileAtomically(path, content.str());
}
diff --git a/chrome/browser/ui/metro_pin_tab_helper_win.cc b/chrome/browser/ui/metro_pin_tab_helper_win.cc
index a11664e..8bc6dd7 100644
--- a/chrome/browser/ui/metro_pin_tab_helper_win.cc
+++ b/chrome/browser/ui/metro_pin_tab_helper_win.cc
@@ -132,7 +132,7 @@ bool GetPathToBackupLogo(const base::FilePath& logo_dir,
return false;
default_logo_path = default_logo_path.Append(kDefaultLogoFileName);
- return file_util::CopyFile(default_logo_path, *logo_path);
+ return base::CopyFile(default_logo_path, *logo_path);
}
// UMA reporting callback for site-specific secondary tile creation.
diff --git a/chrome/browser/ui/prefs/prefs_tab_helper_browsertest.cc b/chrome/browser/ui/prefs/prefs_tab_helper_browsertest.cc
index 00dafa7..92b4f91 100644
--- a/chrome/browser/ui/prefs/prefs_tab_helper_browsertest.cc
+++ b/chrome/browser/ui/prefs/prefs_tab_helper_browsertest.cc
@@ -41,7 +41,7 @@ class PrefsTabHelperBrowserTest : public InProcessBrowserTest {
}
base::FilePath default_pref_file =
default_profile.Append(chrome::kPreferencesFilename);
- if (!file_util::CopyFile(non_global_pref_file, default_pref_file)) {
+ if (!base::CopyFile(non_global_pref_file, default_pref_file)) {
LOG(ERROR) << "Copy error from " << non_global_pref_file.MaybeAsASCII()
<< " to " << default_pref_file.MaybeAsASCII();
return false;
diff --git a/chrome/browser/value_store/value_store_frontend_unittest.cc b/chrome/browser/value_store/value_store_frontend_unittest.cc
index 62295c7..ee66fbb 100644
--- a/chrome/browser/value_store/value_store_frontend_unittest.cc
+++ b/chrome/browser/value_store/value_store_frontend_unittest.cc
@@ -30,7 +30,7 @@ class ValueStoreFrontendTest : public testing::Test {
ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &test_data_dir));
base::FilePath src_db(test_data_dir.AppendASCII("value_store_db"));
db_path_ = temp_dir_.path().AppendASCII("temp_db");
- file_util::CopyDirectory(src_db, db_path_, true);
+ base::CopyDirectory(src_db, db_path_, true);
ResetStorage();
}
diff --git a/chrome/browser/web_applications/web_app_mac.mm b/chrome/browser/web_applications/web_app_mac.mm
index 2743f32..354eaec 100644
--- a/chrome/browser/web_applications/web_app_mac.mm
+++ b/chrome/browser/web_applications/web_app_mac.mm
@@ -269,7 +269,7 @@ bool WebAppShortcutCreator::BuildShortcut(
const base::FilePath& staging_path) const {
// Update the app's plist and icon in a temp directory. This works around
// a Finder bug where the app's icon doesn't properly update.
- if (!file_util::CopyDirectory(GetAppLoaderPath(), staging_path, true)) {
+ if (!base::CopyDirectory(GetAppLoaderPath(), staging_path, true)) {
LOG(ERROR) << "Copying app to staging path: " << staging_path.value()
<< " failed.";
return false;
@@ -304,7 +304,7 @@ size_t WebAppShortcutCreator::CreateShortcutsIn(
for (std::vector<base::FilePath>::const_iterator it = folders.begin();
it != folders.end(); ++it) {
const base::FilePath& dst_path = *it;
- if (!file_util::CopyDirectory(staging_path, dst_path, true)) {
+ if (!base::CopyDirectory(staging_path, dst_path, true)) {
LOG(ERROR) << "Copying app to dst path: " << dst_path.value()
<< " failed";
return succeeded;
diff --git a/chrome/common/extensions/unpacker_unittest.cc b/chrome/common/extensions/unpacker_unittest.cc
index 61a09f74..2c11d27 100644
--- a/chrome/common/extensions/unpacker_unittest.cc
+++ b/chrome/common/extensions/unpacker_unittest.cc
@@ -43,7 +43,7 @@ public:
ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
base::FilePath crx_path = temp_dir_.path().AppendASCII(crx_name);
- ASSERT_TRUE(file_util::CopyFile(original_path, crx_path)) <<
+ ASSERT_TRUE(base::CopyFile(original_path, crx_path)) <<
"Original path " << original_path.value() <<
", Crx path " << crx_path.value();
diff --git a/chrome/installer/setup/install.cc b/chrome/installer/setup/install.cc
index 163c6ea..6897373 100644
--- a/chrome/installer/setup/install.cc
+++ b/chrome/installer/setup/install.cc
@@ -141,7 +141,7 @@ void CopyPreferenceFileForFirstRun(const InstallerState& installer_state,
const base::FilePath& prefs_source_path) {
base::FilePath prefs_dest_path(installer_state.target_path().AppendASCII(
installer::kDefaultMasterPrefs));
- if (!file_util::CopyFile(prefs_source_path, prefs_dest_path)) {
+ if (!base::CopyFile(prefs_source_path, prefs_dest_path)) {
VLOG(1) << "Failed to copy master preferences from:"
<< prefs_source_path.value() << " gle: " << ::GetLastError();
}
diff --git a/chrome/installer/setup/uninstall.cc b/chrome/installer/setup/uninstall.cc
index a39f153..246c860 100644
--- a/chrome/installer/setup/uninstall.cc
+++ b/chrome/installer/setup/uninstall.cc
@@ -432,7 +432,7 @@ base::FilePath BackupLocalStateFile(
if (!file_util::CreateTemporaryFile(&backup))
LOG(ERROR) << "Failed to create temporary file for Local State.";
else
- file_util::CopyFile(state_file, backup);
+ base::CopyFile(state_file, backup);
break;
}
return backup;
diff --git a/chrome/installer/test/alternate_version_generator.cc b/chrome/installer/test/alternate_version_generator.cc
index 3cd067a..acc081b 100644
--- a/chrome/installer/test/alternate_version_generator.cc
+++ b/chrome/installer/test/alternate_version_generator.cc
@@ -524,7 +524,7 @@ bool GenerateAlternateVersion(const base::FilePath& original_installer_path,
// Copy the original mini_installer.
base::FilePath mini_installer =
work_dir.directory().Append(original_installer_path.BaseName());
- if (!file_util::CopyFile(original_installer_path, mini_installer)) {
+ if (!base::CopyFile(original_installer_path, mini_installer)) {
LOG(DFATAL) << "Failed copying \"" << original_installer_path.value()
<< "\" to \"" << mini_installer.value() << "\"";
return false;
@@ -679,7 +679,7 @@ bool GenerateSpecificPEFileVersion(const base::FilePath& original_file,
const base::FilePath& target_file,
const Version& version) {
// First copy original_file to target_file.
- if (!file_util::CopyFile(original_file, target_file)) {
+ if (!base::CopyFile(original_file, target_file)) {
LOG(DFATAL) << "Failed copying \"" << original_file.value()
<< "\" to \"" << target_file.value() << "\"";
return false;
diff --git a/chrome/installer/util/copy_tree_work_item.cc b/chrome/installer/util/copy_tree_work_item.cc
index 118a217..ea14ea1 100644
--- a/chrome/installer/util/copy_tree_work_item.cc
+++ b/chrome/installer/util/copy_tree_work_item.cc
@@ -53,7 +53,7 @@ bool CopyTreeWorkItem::Do() {
// handle overwrite_option_ = NEW_NAME_IF_IN_USE case.
if (alternative_path_.empty() ||
file_util::PathExists(alternative_path_) ||
- !file_util::CopyFile(source_path_, alternative_path_)) {
+ !base::CopyFile(source_path_, alternative_path_)) {
LOG(ERROR) << "failed to copy " << source_path_.value()
<< " to " << alternative_path_.value();
return false;
@@ -90,7 +90,7 @@ bool CopyTreeWorkItem::Do() {
}
// In all cases that reach here, copy source to destination.
- if (file_util::CopyDirectory(source_path_, dest_path_, true)) {
+ if (base::CopyDirectory(source_path_, dest_path_, true)) {
copied_to_dest_path_ = true;
VLOG(1) << "Copied source " << source_path_.value()
<< " to destination " << dest_path_.value();
diff --git a/chrome/installer/util/copy_tree_work_item_unittest.cc b/chrome/installer/util/copy_tree_work_item_unittest.cc
index 23cc5b3..accd12a 100644
--- a/chrome/installer/util/copy_tree_work_item_unittest.cc
+++ b/chrome/installer/util/copy_tree_work_item_unittest.cc
@@ -337,7 +337,7 @@ TEST_F(CopyTreeWorkItemTest, CopyFileInUse) {
base::FilePath file_name_to(dir_name_to);
file_name_to = file_name_to.AppendASCII("File_To");
- file_util::CopyFile(exe_full_path, file_name_to);
+ base::CopyFile(exe_full_path, file_name_to);
ASSERT_TRUE(file_util::PathExists(file_name_to));
VLOG(1) << "copy ourself from " << exe_full_path.value()
@@ -417,7 +417,7 @@ TEST_F(CopyTreeWorkItemTest, NewNameAndCopyTest) {
base::FilePath file_name_to(dir_name_to), alternate_to(dir_name_to);
file_name_to = file_name_to.AppendASCII("File_To");
alternate_to = alternate_to.AppendASCII("Alternate_To");
- file_util::CopyFile(exe_full_path, file_name_to);
+ base::CopyFile(exe_full_path, file_name_to);
ASSERT_TRUE(file_util::PathExists(file_name_to));
VLOG(1) << "copy ourself from " << exe_full_path.value()
@@ -526,7 +526,7 @@ TEST_F(CopyTreeWorkItemTest, DISABLED_IfNotPresentTest) {
ASSERT_TRUE(file_util::PathExists(dir_name_to));
base::FilePath file_name_to(dir_name_to);
file_name_to = file_name_to.AppendASCII("File_To");
- file_util::CopyFile(exe_full_path, file_name_to);
+ base::CopyFile(exe_full_path, file_name_to);
ASSERT_TRUE(file_util::PathExists(file_name_to));
// Get the path of backup file
@@ -609,7 +609,7 @@ TEST_F(CopyTreeWorkItemTest, DISABLED_CopyFileInUseAndCleanup) {
base::FilePath file_name_to(dir_name_to);
file_name_to = file_name_to.AppendASCII("File_To");
- file_util::CopyFile(exe_full_path, file_name_to);
+ base::CopyFile(exe_full_path, file_name_to);
ASSERT_TRUE(file_util::PathExists(file_name_to));
VLOG(1) << "copy ourself from " << exe_full_path.value()
diff --git a/chrome/installer/util/delete_tree_work_item.cc b/chrome/installer/util/delete_tree_work_item.cc
index a5ccf4d..7c32654 100644
--- a/chrome/installer/util/delete_tree_work_item.cc
+++ b/chrome/installer/util/delete_tree_work_item.cc
@@ -62,7 +62,7 @@ bool DeleteTreeWorkItem::Do() {
if (!backup.CreateUniqueTempDirUnderPath(temp_path_)) {
PLOG(ERROR) << "Could not create temp dir in " << temp_path_.value();
abort = true;
- } else if (!file_util::CopyFile(key_file,
+ } else if (!base::CopyFile(key_file,
backup.path().Append(key_file.BaseName()))) {
PLOG(ERROR) << "Could not back up " << key_file.value()
<< " to directory " << backup.path().value();
@@ -117,7 +117,7 @@ bool DeleteTreeWorkItem::Do() {
} else {
base::FilePath backup =
backup_path_.path().Append(root_path_.BaseName());
- if (!file_util::CopyDirectory(root_path_, backup, true)) {
+ if (!base::CopyDirectory(root_path_, backup, true)) {
LOG(ERROR) << "can not copy " << root_path_.value()
<< " to backup path " << backup.value();
return false;
diff --git a/chrome/installer/util/delete_tree_work_item_unittest.cc b/chrome/installer/util/delete_tree_work_item_unittest.cc
index 0d6e09d..190e0d9 100644
--- a/chrome/installer/util/delete_tree_work_item_unittest.cc
+++ b/chrome/installer/util/delete_tree_work_item_unittest.cc
@@ -181,7 +181,7 @@ TEST_F(DeleteTreeWorkItemTest, DeleteTreeInUse) {
::GetModuleFileNameW(NULL, exe_full_path_str, MAX_PATH);
base::FilePath exe_full_path(exe_full_path_str);
- file_util::CopyFile(exe_full_path, key_path);
+ base::CopyFile(exe_full_path, key_path);
ASSERT_TRUE(file_util::PathExists(key_path));
VLOG(1) << "copy ourself from " << exe_full_path.value()
diff --git a/chrome/installer/util/move_tree_work_item_unittest.cc b/chrome/installer/util/move_tree_work_item_unittest.cc
index 11dc26e..011f9ca 100644
--- a/chrome/installer/util/move_tree_work_item_unittest.cc
+++ b/chrome/installer/util/move_tree_work_item_unittest.cc
@@ -277,7 +277,7 @@ TEST_F(MoveTreeWorkItemTest, MoveFileDestInUse) {
base::FilePath exe_full_path(exe_full_path_str);
base::FilePath to_file(to_dir);
to_file = to_file.AppendASCII("To_File");
- file_util::CopyFile(exe_full_path, to_file);
+ base::CopyFile(exe_full_path, to_file);
ASSERT_TRUE(file_util::PathExists(to_file));
// Run the executable in destination path
@@ -329,7 +329,7 @@ TEST_F(MoveTreeWorkItemTest, MoveFileInUse) {
base::FilePath exe_full_path(exe_full_path_str);
base::FilePath from_file(from_dir);
from_file = from_file.AppendASCII("From_File");
- file_util::CopyFile(exe_full_path, from_file);
+ base::CopyFile(exe_full_path, from_file);
ASSERT_TRUE(file_util::PathExists(from_file));
// Create a destination source dir and generate destination file name.
diff --git a/chrome/test/automation/proxy_launcher.cc b/chrome/test/automation/proxy_launcher.cc
index 4b40cc1..97e9d3c 100644
--- a/chrome/test/automation/proxy_launcher.cc
+++ b/chrome/test/automation/proxy_launcher.cc
@@ -55,10 +55,10 @@ bool CopyDirectoryContentsNoCache(const base::FilePath& source,
for (base::FilePath cur = en.Next(); !cur.empty(); cur = en.Next()) {
base::FileEnumerator::FileInfo info = en.GetInfo();
if (info.IsDirectory()) {
- if (!file_util::CopyDirectory(cur, dest, true))
+ if (!base::CopyDirectory(cur, dest, true))
return false;
} else {
- if (!file_util::CopyFile(cur, dest.Append(cur.BaseName())))
+ if (!base::CopyFile(cur, dest.Append(cur.BaseName())))
return false;
}
}
diff --git a/chrome/test/mini_installer_test/run_all_unittests.cc b/chrome/test/mini_installer_test/run_all_unittests.cc
index d4d69b0..0fd6b81 100644
--- a/chrome/test/mini_installer_test/run_all_unittests.cc
+++ b/chrome/test/mini_installer_test/run_all_unittests.cc
@@ -34,7 +34,7 @@ void BackUpProfile(bool chrome_frame) {
// If yes, will delete and create new one.
if (file_util::PathExists(backup_path))
base::Delete(backup_path, true);
- file_util::CopyDirectory(path, backup_path, true);
+ base::CopyDirectory(path, backup_path, true);
} else {
printf("Chrome is not installed. Will not take any backup\n");
}
diff --git a/chrome/test/perf/generate_profile.cc b/chrome/test/perf/generate_profile.cc
index b07f174..092d34d 100644
--- a/chrome/test/perf/generate_profile.cc
+++ b/chrome/test/perf/generate_profile.cc
@@ -257,7 +257,7 @@ bool GenerateProfile(GenerateProfileTypes types,
while (!path.empty()) {
base::FilePath dst_file = dst_dir.Append(path.BaseName());
base::Delete(dst_file, false);
- if (!file_util::CopyFile(path, dst_file)) {
+ if (!base::CopyFile(path, dst_file)) {
PLOG(ERROR) << "Copying file failed";
return false;
}
diff --git a/chrome/test/perf/memory_test.cc b/chrome/test/perf/memory_test.cc
index 4bf8ee2..f3affd7 100644
--- a/chrome/test/perf/memory_test.cc
+++ b/chrome/test/perf/memory_test.cc
@@ -238,7 +238,7 @@ class MemoryTest : public UIPerfTest {
return false;
}
- if (!file_util::CopyDirectory(src_dir, temp_dir_, true)) {
+ if (!base::CopyDirectory(src_dir, temp_dir_, true)) {
LOG(ERROR) << "Could not copy temp directory";
return false;
}
diff --git a/chrome/test/perf/perf_ui_test_suite.cc b/chrome/test/perf/perf_ui_test_suite.cc
index 1a3c641..dcea0d0 100644
--- a/chrome/test/perf/perf_ui_test_suite.cc
+++ b/chrome/test/perf/perf_ui_test_suite.cc
@@ -101,7 +101,7 @@ void PerfUITestSuite::Initialize() {
LOG(FATAL) << "Failed to create complex profile directory...";
}
- if (!file_util::CopyDirectory(default_path,
+ if (!base::CopyDirectory(default_path,
complex_profile_dir_.path(),
true)) {
LOG(FATAL) << "Failed to copy data to complex profile directory...";
@@ -117,11 +117,8 @@ void PerfUITestSuite::Initialize() {
base_data_dir = base_data_dir.AppendASCII("profile_with_complex_theme");
base_data_dir = base_data_dir.AppendASCII("Default");
- if (!file_util::CopyDirectory(base_data_dir,
- complex_profile_dir_.path(),
- true)) {
+ if (!base::CopyDirectory(base_data_dir, complex_profile_dir_.path(), true))
LOG(FATAL) << "Failed to copy default to complex profile";
- }
// Parse the manifest and make a temporary extension object because the
// theme system takes extensions as input.
diff --git a/chrome_frame/test/dll_redirector_loading_test.cc b/chrome_frame/test/dll_redirector_loading_test.cc
index b3cea3d..404db0e 100644
--- a/chrome_frame/test/dll_redirector_loading_test.cc
+++ b/chrome_frame/test/dll_redirector_loading_test.cc
@@ -61,8 +61,8 @@ class DllRedirectorLoadingTest : public testing::Test {
// folder.
original_chrome_frame_dll_ =
original_version_dir.Append(build_chrome_frame_dll.BaseName());
- ASSERT_TRUE(file_util::CopyFile(build_chrome_frame_dll,
- original_chrome_frame_dll_));
+ ASSERT_TRUE(base::CopyFile(build_chrome_frame_dll,
+ original_chrome_frame_dll_));
ASSERT_TRUE(file_util::PathExists(original_chrome_frame_dll_));
// Temporary location for the new Chrome Frame DLL.
diff --git a/chrome_frame/test/test_with_web_server.cc b/chrome_frame/test/test_with_web_server.cc
index 15e16f2..7ffb836 100644
--- a/chrome_frame/test/test_with_web_server.cc
+++ b/chrome_frame/test/test_with_web_server.cc
@@ -110,12 +110,12 @@ void ChromeFrameTestWithWebServer::SetUpTestCase() {
CFInstance_src_path = chrome_frame_source_path.AppendASCII("CFInstance.js");
CFInstance_path_ = test_file_path_.AppendASCII("CFInstance.js");
- ASSERT_TRUE(file_util::CopyFile(CFInstance_src_path, CFInstance_path_));
+ ASSERT_TRUE(base::CopyFile(CFInstance_src_path, CFInstance_path_));
CFInstall_src_path = chrome_frame_source_path.AppendASCII("CFInstall.js");
CFInstall_path_ = test_file_path_.AppendASCII("CFInstall.js");
- ASSERT_TRUE(file_util::CopyFile(CFInstall_src_path, CFInstall_path_));
+ ASSERT_TRUE(base::CopyFile(CFInstall_src_path, CFInstall_path_));
loop_ = new chrome_frame_test::TimedMsgLoop();
loop_->set_snapshot_on_timeout(true);
diff --git a/cloud_print/common/win/install_utils.cc b/cloud_print/common/win/install_utils.cc
index ab8a66e..0edb161 100644
--- a/cloud_print/common/win/install_utils.cc
+++ b/cloud_print/common/win/install_utils.cc
@@ -174,7 +174,7 @@ void DeleteProgramDir(const std::string& delete_switch) {
base::FilePath temp_path;
if (!file_util::CreateTemporaryFile(&temp_path))
return;
- file_util::CopyFile(installer_source, temp_path);
+ base::CopyFile(installer_source, temp_path);
base::DeleteAfterReboot(temp_path);
CommandLine command_line(temp_path);
command_line.AppendSwitchPath(delete_switch, installer_source.DirName());
diff --git a/cloud_print/virtual_driver/win/install/setup.cc b/cloud_print/virtual_driver/win/install/setup.cc
index f1b870a..85591ee 100644
--- a/cloud_print/virtual_driver/win/install/setup.cc
+++ b/cloud_print/virtual_driver/win/install/setup.cc
@@ -111,7 +111,7 @@ HRESULT RegisterPortMonitor(bool install, const base::FilePath& install_path) {
if (install) {
base::FilePath source_path =
install_path.Append(GetPortMonitorDllName());
- if (!file_util::CopyFile(source_path, target_path)) {
+ if (!base::CopyFile(source_path, target_path)) {
LOG(ERROR) << "Unable copy port monitor dll from " <<
source_path.value() << " to " << target_path.value();
return GetLastHResult();
@@ -241,7 +241,7 @@ void ReadyDriverDependencies(const base::FilePath& destination) {
base::FilePath src_path = driver_cache_path.Append(kDependencyList[i]);
if (!file_util::PathExists(src_path))
src_path = GetSystemPath(kDependencyList[i]);
- file_util::CopyFile(src_path, dst_path);
+ base::CopyFile(src_path, dst_path);
}
}
}
diff --git a/content/browser/download/base_file_unittest.cc b/content/browser/download/base_file_unittest.cc
index dab5cc2..8f37f59 100644
--- a/content/browser/download/base_file_unittest.cc
+++ b/content/browser/download/base_file_unittest.cc
@@ -392,7 +392,7 @@ TEST_F(BaseFileTest, MultipleWritesInterruptedWithHash) {
base::FilePath new_file_path(temp_dir_.path().Append(
base::FilePath(FILE_PATH_LITERAL("second_file"))));
- ASSERT_TRUE(file_util::CopyFile(base_file_->full_path(), new_file_path));
+ ASSERT_TRUE(base::CopyFile(base_file_->full_path(), new_file_path));
// Create another file
BaseFile second_file(new_file_path,
diff --git a/content/browser/download/save_file_manager.cc b/content/browser/download/save_file_manager.cc
index e137c57..3abcd83 100644
--- a/content/browser/download/save_file_manager.cc
+++ b/content/browser/download/save_file_manager.cc
@@ -459,7 +459,7 @@ void SaveFileManager::SaveLocalFile(const GURL& original_file_url,
// Copy the local file to the temporary file. It will be renamed to its
// final name later.
- bool success = file_util::CopyFile(file_path, save_file->FullPath());
+ bool success = base::CopyFile(file_path, save_file->FullPath());
if (!success)
base::Delete(save_file->FullPath(), false);
SaveFinished(save_id, original_file_url, render_process_id, success);
diff --git a/content/browser/indexed_db/indexed_db_browsertest.cc b/content/browser/indexed_db/indexed_db_browsertest.cc
index d24cf37..cecc98a 100644
--- a/content/browser/indexed_db/indexed_db_browsertest.cc
+++ b/content/browser/indexed_db/indexed_db_browsertest.cc
@@ -243,9 +243,9 @@ static void CopyLevelDBToProfile(Shell* shell,
// profile/IndexedDB/file__0.xxx/
ASSERT_TRUE(file_util::CreateDirectory(dest));
const bool kRecursive = true;
- ASSERT_TRUE(file_util::CopyDirectory(test_data_dir,
- context_impl->data_path(),
- kRecursive));
+ ASSERT_TRUE(base::CopyDirectory(test_data_dir,
+ context_impl->data_path(),
+ kRecursive));
}
class IndexedDBBrowserTestWithPreexistingLevelDB : public IndexedDBBrowserTest {
diff --git a/net/disk_cache/disk_cache_test_base.cc b/net/disk_cache/disk_cache_test_base.cc
index d6688bb..5ab7147 100644
--- a/net/disk_cache/disk_cache_test_base.cc
+++ b/net/disk_cache/disk_cache_test_base.cc
@@ -37,7 +37,7 @@ bool DiskCacheTest::CopyTestCache(const std::string& name) {
if (!CleanupCacheDir())
return false;
- return file_util::CopyDirectory(path, cache_path_, false);
+ return base::CopyDirectory(path, cache_path_, false);
}
bool DiskCacheTest::CleanupCacheDir() {
diff --git a/tools/traceline/svgui/startup-release.json b/tools/traceline/svgui/startup-release.json
index 1e9af3e..37a3620 100644
--- a/tools/traceline/svgui/startup-release.json
+++ b/tools/traceline/svgui/startup-release.json
@@ -73,7 +73,7 @@ parseEvents([
{'stacktrace': [[2118227449, 'USER32.dll!RealMsgWaitForMultipleObjectsEx+0xd9'], [19469071, 'chrome.dll!base::MessagePumpForIO::WaitForWork+0x18f [ c:\\g\\trunk\\src\\base\\message_pump_win.cc:613 ]'], [19470371, 'chrome.dll!base::MessagePumpForIO::DoRunLoop+0xd3 [ c:\\g\\trunk\\src\\base\\message_pump_win.cc:562 ]'], [19464514, 'chrome.dll!base::MessagePumpWin::RunWithDispatcher+0x42 [ c:\\g\\trunk\\src\\base\\message_pump_win.cc:134 ]'], [19397518, 'chrome.dll!base::MessagePumpWin::Run+0xe [ c:\\g\\trunk\\src\\base\\message_pump_win.h:124 ]'], [19407831, 'chrome.dll!MessageLoop::RunInternal+0xb7 [ c:\\g\\trunk\\src\\base\\message_loop.cc:197 ]'], [19408240, 'chrome.dll!MessageLoop::RunHandler+0xa0 [ c:\\g\\trunk\\src\\base\\message_loop.cc:181 ]'], [19410461, 'chrome.dll!MessageLoop::Run+0x3d [ c:\\g\\trunk\\src\\base\\message_loop.cc:155 ]'], [23799658, 'chrome.dll!base::Thread::ThreadMain+0x8a [ c:\\g\\trunk\\src\\base\\thread.cc:159 ]'], [19417293, "chrome.dll!`anonymous namespace'::ThreadFunc+0xd [ c:\\g\\trunk\\src\\base\\platform_thread_win.cc:27 ]"], [2088810115, 'kernel32.dll!BaseThreadStart+0x37']], 'thread': 708, 'syscall': 270, 'eventtype': 'EVENT_TYPE_SYSCALL', 'syscallname': 'ntdll.dll!NtWaitForMultipleObjects', 'waiting': 1, 'done': 129.02449899999999, 'ms': 127.671254, 'syscallargs': [2, 18348996, 1], 'cpu': 2147742720},
{'stacktrace': [[27279557, 'chrome.dll!views::HWNDView::Attach+0x95 [ c:\\g\\trunk\\src\\chrome\\views\\hwnd_view.cc:46 ]'], [23096819, 'chrome.dll!TabContentsContainerView::SetTabContents+0xc3 [ c:\\g\\trunk\\src\\chrome\\browser\\views\\tab_contents_container_view.cc:83 ]'], [23148817, 'chrome.dll!BrowserView2::TabSelectedAt+0x81 [ c:\\g\\trunk\\src\\chrome\\browser\\views\\frame\\browser_view2.cc:530 ]'], [21206163, 'chrome.dll!TabStripModel::ChangeSelectedContentsFrom+0xe3 [ c:\\g\\trunk\\src\\chrome\\browser\\tabs\\tab_strip_model.cc:585 ]'], [21208866, 'chrome.dll!TabStripModel::InsertTabContentsAt+0x142 [ c:\\g\\trunk\\src\\chrome\\browser\\tabs\\tab_strip_model.cc:103 ]'], [21209292, 'chrome.dll!TabStripModel::AddTabContents+0xac [ c:\\g\\trunk\\src\\chrome\\browser\\tabs\\tab_strip_model.cc:378 ]'], [20651916, 'chrome.dll!Browser::AddTabWithURL+0x13c [ c:\\g\\trunk\\src\\chrome\\browser\\browser.cc:1232 ]'], [20567357, 'chrome.dll!BrowserInit::LaunchWithProfile::OpenURLsInBrowser+0xfd [ c:\\g\\trunk\\src\\chrome\\browser\\browser_init.cc:540 ]'], [20570295, 'chrome.dll!BrowserInit::LaunchWithProfile::Launch+0x5d7 [ c:\\g\\trunk\\src\\chrome\\browser\\browser_init.cc:472 ]'], [20571326, 'chrome.dll!BrowserInit::LaunchBrowserImpl+0x2de [ c:\\g\\trunk\\src\\chrome\\browser\\browser_init.cc:720 ]'], [20572818, 'chrome.dll!BrowserInit::ProcessCommandLine+0x522 [ c:\\g\\trunk\\src\\chrome\\browser\\browser_init.cc:659 ]'], [20405083, 'chrome.dll!BrowserMain+0xfdb [ c:\\g\\trunk\\src\\chrome\\browser\\browser_main.cc:579 ]'], [19354554, 'chrome.dll!ChromeMain+0x83a [ c:\\g\\trunk\\src\\chrome\\app\\chrome_dll_main.cc:224 ]'], [4205604, 'chrome.exe!wWinMain+0x304 [ c:\\g\\trunk\\src\\chrome\\app\\chrome_exe_main.cc:103 ]'], [4482934, 'chrome.exe!__tmainCRTStartup+0x176 [ f:\\sp\\vctools\\crt_bld\\self_x86\\crt\\src\\crt0.c:324 ]'], [2088857559, 'kernel32.dll!BaseProcessStart+0x23']], 'thread': 3956, 'syscall': 4642, 'eventtype': 'EVENT_TYPE_SYSCALL', 'syscallname': 'user32.dll!NtUserSetWindowPos', 'done': 129.14797799999999, 'ms': 128.71188900000001, 'syscallargs': [24969860, 0, 5], 'cpu': 2147742720},
{'stacktrace': [[2118227449, 'USER32.dll!RealMsgWaitForMultipleObjectsEx+0xd9'], [19469071, 'chrome.dll!base::MessagePumpForIO::WaitForWork+0x18f [ c:\\g\\trunk\\src\\base\\message_pump_win.cc:613 ]'], [19470371, 'chrome.dll!base::MessagePumpForIO::DoRunLoop+0xd3 [ c:\\g\\trunk\\src\\base\\message_pump_win.cc:562 ]'], [19464514, 'chrome.dll!base::MessagePumpWin::RunWithDispatcher+0x42 [ c:\\g\\trunk\\src\\base\\message_pump_win.cc:134 ]'], [19397518, 'chrome.dll!base::MessagePumpWin::Run+0xe [ c:\\g\\trunk\\src\\base\\message_pump_win.h:124 ]'], [19407831, 'chrome.dll!MessageLoop::RunInternal+0xb7 [ c:\\g\\trunk\\src\\base\\message_loop.cc:197 ]'], [19408240, 'chrome.dll!MessageLoop::RunHandler+0xa0 [ c:\\g\\trunk\\src\\base\\message_loop.cc:181 ]'], [19410461, 'chrome.dll!MessageLoop::Run+0x3d [ c:\\g\\trunk\\src\\base\\message_loop.cc:155 ]'], [23799658, 'chrome.dll!base::Thread::ThreadMain+0x8a [ c:\\g\\trunk\\src\\base\\thread.cc:159 ]'], [19417293, "chrome.dll!`anonymous namespace'::ThreadFunc+0xd [ c:\\g\\trunk\\src\\base\\platform_thread_win.cc:27 ]"], [2088810115, 'kernel32.dll!BaseThreadStart+0x37']], 'thread': 708, 'syscall': 270, 'eventtype': 'EVENT_TYPE_SYSCALL', 'syscallname': 'ntdll.dll!NtWaitForMultipleObjects', 'waiting': 1, 'done': 147.204184, 'ms': 129.097972, 'syscallargs': [2, 18348996, 1], 'cpu': 2147742720},
-{'stacktrace': [[2088925701, 'kernel32.dll!BasepCopyFileExW+0x3f2'], [2088926059, 'kernel32.dll!CopyFileExW+0x39'], [2088958097, 'kernel32.dll!CopyFileW+0x1e'], [19457905, 'chrome.dll!file_util::CopyFileW+0x41 [ c:\\g\\trunk\\src\\base\\file_util_win.cc:115 ]'], [19447294, 'chrome.dll!file_util::CopyFileW+0x2e [ c:\\g\\trunk\\src\\base\\file_util.cc:324 ]'], [21848115, 'chrome.dll!BookmarkStorageBackend::BookmarkStorageBackend+0xc3 [ c:\\g\\trunk\\src\\chrome\\browser\\bookmarks\\bookmark_storage.cc:123 ]'], [21848622, 'chrome.dll!BookmarkStorage::BookmarkStorage+0x12e [ c:\\g\\trunk\\src\\chrome\\browser\\bookmarks\\bookmark_storage.cc:41 ]'], [21452155, 'chrome.dll!BookmarkModel::Load+0xcb [ c:\\g\\trunk\\src\\chrome\\browser\\bookmarks\\bookmark_model.cc:137 ]'], [20848903, 'chrome.dll!ProfileImpl::GetBookmarkModel+0x47 [ c:\\g\\trunk\\src\\chrome\\browser\\profile.cc:853 ]'], [22957786, 'chrome.dll!BookmarkBarView::BookmarkBarView+0x13a [ c:\\g\\trunk\\src\\chrome\\browser\\views\\bookmark_bar_view.cc:692 ]'], [23141288, 'chrome.dll!BrowserView2::GetBookmarkBarView+0x48 [ c:\\g\\trunk\\src\\chrome\\browser\\views\\frame\\browser_view2.cc:444 ]'], [23147457, 'chrome.dll!BrowserView2::UpdateUIForContents+0x11 [ c:\\g\\trunk\\src\\chrome\\browser\\views\\frame\\browser_view2.cc:1020 ]'], [23148906, 'chrome.dll!BrowserView2::TabSelectedAt+0xda [ c:\\g\\trunk\\src\\chrome\\browser\\views\\frame\\browser_view2.cc:538 ]'], [21206163, 'chrome.dll!TabStripModel::ChangeSelectedContentsFrom+0xe3 [ c:\\g\\trunk\\src\\chrome\\browser\\tabs\\tab_strip_model.cc:585 ]'], [21208866, 'chrome.dll!TabStripModel::InsertTabContentsAt+0x142 [ c:\\g\\trunk\\src\\chrome\\browser\\tabs\\tab_strip_model.cc:103 ]'], [21209292, 'chrome.dll!TabStripModel::AddTabContents+0xac [ c:\\g\\trunk\\src\\chrome\\browser\\tabs\\tab_strip_model.cc:378 ]']], 'thread': 3956, 'syscall': 37, 'eventtype': 'EVENT_TYPE_SYSCALL', 'syscallname': 'ntdll.dll!NtCreateFile', 'done': 132.690607, 'ms': 132.46627699999999, 'syscallargs': [1238200, 1074856064, 1237976], 'cpu': 2147742720},
+{'stacktrace': [[2088925701, 'kernel32.dll!BasepCopyFileExW+0x3f2'], [2088926059, 'kernel32.dll!CopyFileExW+0x39'], [2088958097, 'kernel32.dll!CopyFileW+0x1e'], [19457905, 'chrome.dll!base::CopyFileW+0x41 [ c:\\g\\trunk\\src\\base\\file_util_win.cc:115 ]'], [19447294, 'chrome.dll!base::CopyFileW+0x2e [ c:\\g\\trunk\\src\\base\\file_util.cc:324 ]'], [21848115, 'chrome.dll!BookmarkStorageBackend::BookmarkStorageBackend+0xc3 [ c:\\g\\trunk\\src\\chrome\\browser\\bookmarks\\bookmark_storage.cc:123 ]'], [21848622, 'chrome.dll!BookmarkStorage::BookmarkStorage+0x12e [ c:\\g\\trunk\\src\\chrome\\browser\\bookmarks\\bookmark_storage.cc:41 ]'], [21452155, 'chrome.dll!BookmarkModel::Load+0xcb [ c:\\g\\trunk\\src\\chrome\\browser\\bookmarks\\bookmark_model.cc:137 ]'], [20848903, 'chrome.dll!ProfileImpl::GetBookmarkModel+0x47 [ c:\\g\\trunk\\src\\chrome\\browser\\profile.cc:853 ]'], [22957786, 'chrome.dll!BookmarkBarView::BookmarkBarView+0x13a [ c:\\g\\trunk\\src\\chrome\\browser\\views\\bookmark_bar_view.cc:692 ]'], [23141288, 'chrome.dll!BrowserView2::GetBookmarkBarView+0x48 [ c:\\g\\trunk\\src\\chrome\\browser\\views\\frame\\browser_view2.cc:444 ]'], [23147457, 'chrome.dll!BrowserView2::UpdateUIForContents+0x11 [ c:\\g\\trunk\\src\\chrome\\browser\\views\\frame\\browser_view2.cc:1020 ]'], [23148906, 'chrome.dll!BrowserView2::TabSelectedAt+0xda [ c:\\g\\trunk\\src\\chrome\\browser\\views\\frame\\browser_view2.cc:538 ]'], [21206163, 'chrome.dll!TabStripModel::ChangeSelectedContentsFrom+0xe3 [ c:\\g\\trunk\\src\\chrome\\browser\\tabs\\tab_strip_model.cc:585 ]'], [21208866, 'chrome.dll!TabStripModel::InsertTabContentsAt+0x142 [ c:\\g\\trunk\\src\\chrome\\browser\\tabs\\tab_strip_model.cc:103 ]'], [21209292, 'chrome.dll!TabStripModel::AddTabContents+0xac [ c:\\g\\trunk\\src\\chrome\\browser\\tabs\\tab_strip_model.cc:378 ]']], 'thread': 3956, 'syscall': 37, 'eventtype': 'EVENT_TYPE_SYSCALL', 'syscallname': 'ntdll.dll!NtCreateFile', 'done': 132.690607, 'ms': 132.46627699999999, 'syscallargs': [1238200, 1074856064, 1237976], 'cpu': 2147742720},
{'stacktrace': [[2088810115, 'kernel32.dll!BaseThreadStart+0x37']], 'thread': 3500, 'syscall': 270, 'eventtype': 'EVENT_TYPE_SYSCALL', 'syscallname': 'ntdll.dll!NtWaitForMultipleObjects', 'waiting': 1, 'done': 146.83514199999999, 'ms': 132.61238499999999, 'syscallargs': [12, 32505136, 1], 'cpu': 3124053392},
{'stacktrace': [[19407956, 'chrome.dll!MessageLoop::PostTask+0x14 [ c:\\g\\trunk\\src\\base\\message_loop.cc:231 ]'], [21849655, 'chrome.dll!BookmarkStorage::LoadBookmarks+0x87 [ c:\\g\\trunk\\src\\chrome\\browser\\bookmarks\\bookmark_storage.cc:53 ]'], [21452202, 'chrome.dll!BookmarkModel::Load+0xfa [ c:\\g\\trunk\\src\\chrome\\browser\\bookmarks\\bookmark_model.cc:138 ]'], [20848903, 'chrome.dll!ProfileImpl::GetBookmarkModel+0x47 [ c:\\g\\trunk\\src\\chrome\\browser\\profile.cc:853 ]'], [22957786, 'chrome.dll!BookmarkBarView::BookmarkBarView+0x13a [ c:\\g\\trunk\\src\\chrome\\browser\\views\\bookmark_bar_view.cc:692 ]'], [23141288, 'chrome.dll!BrowserView2::GetBookmarkBarView+0x48 [ c:\\g\\trunk\\src\\chrome\\browser\\views\\frame\\browser_view2.cc:444 ]'], [23147457, 'chrome.dll!BrowserView2::UpdateUIForContents+0x11 [ c:\\g\\trunk\\src\\chrome\\browser\\views\\frame\\browser_view2.cc:1020 ]'], [23148906, 'chrome.dll!BrowserView2::TabSelectedAt+0xda [ c:\\g\\trunk\\src\\chrome\\browser\\views\\frame\\browser_view2.cc:538 ]'], [21206163, 'chrome.dll!TabStripModel::ChangeSelectedContentsFrom+0xe3 [ c:\\g\\trunk\\src\\chrome\\browser\\tabs\\tab_strip_model.cc:585 ]'], [21208866, 'chrome.dll!TabStripModel::InsertTabContentsAt+0x142 [ c:\\g\\trunk\\src\\chrome\\browser\\tabs\\tab_strip_model.cc:103 ]'], [21209292, 'chrome.dll!TabStripModel::AddTabContents+0xac [ c:\\g\\trunk\\src\\chrome\\browser\\tabs\\tab_strip_model.cc:378 ]'], [20651916, 'chrome.dll!Browser::AddTabWithURL+0x13c [ c:\\g\\trunk\\src\\chrome\\browser\\browser.cc:1232 ]'], [20567357, 'chrome.dll!BrowserInit::LaunchWithProfile::OpenURLsInBrowser+0xfd [ c:\\g\\trunk\\src\\chrome\\browser\\browser_init.cc:540 ]'], [20570295, 'chrome.dll!BrowserInit::LaunchWithProfile::Launch+0x5d7 [ c:\\g\\trunk\\src\\chrome\\browser\\browser_init.cc:472 ]'], [20571326, 'chrome.dll!BrowserInit::LaunchBrowserImpl+0x2de [ c:\\g\\trunk\\src\\chrome\\browser\\browser_init.cc:720 ]'], [20572818, 'chrome.dll!BrowserInit::ProcessCommandLine+0x522 [ c:\\g\\trunk\\src\\chrome\\browser\\browser_init.cc:659 ]']], 'thread': 3956, 'syscall': 4571, 'eventtype': 'EVENT_TYPE_SYSCALL', 'syscallname': 'user32.dll!NtUserPostMessage', 'done': 135.53007400000001, 'ms': 133.02305200000001, 'syscallargs': [8585726, 1025, 13802976], 'cpu': 3124053392},
{'stacktrace': [[2118227449, 'USER32.dll!RealMsgWaitForMultipleObjectsEx+0xd9'], [19467175, 'chrome.dll!base::MessagePumpForUI::WaitForWork+0x27 [ c:\\g\\trunk\\src\\base\\message_pump_win.cc:408 ]'], [19470141, 'chrome.dll!base::MessagePumpForUI::DoRunLoop+0xbd [ c:\\g\\trunk\\src\\base\\message_pump_win.cc:393 ]'], [19464514, 'chrome.dll!base::MessagePumpWin::RunWithDispatcher+0x42 [ c:\\g\\trunk\\src\\base\\message_pump_win.cc:134 ]'], [19397518, 'chrome.dll!base::MessagePumpWin::Run+0xe [ c:\\g\\trunk\\src\\base\\message_pump_win.h:124 ]'], [19407831, 'chrome.dll!MessageLoop::RunInternal+0xb7 [ c:\\g\\trunk\\src\\base\\message_loop.cc:197 ]'], [19408240, 'chrome.dll!MessageLoop::RunHandler+0xa0 [ c:\\g\\trunk\\src\\base\\message_loop.cc:181 ]'], [19410461, 'chrome.dll!MessageLoop::Run+0x3d [ c:\\g\\trunk\\src\\base\\message_loop.cc:155 ]'], [23799658, 'chrome.dll!base::Thread::ThreadMain+0x8a [ c:\\g\\trunk\\src\\base\\thread.cc:159 ]'], [19417293, "chrome.dll!`anonymous namespace'::ThreadFunc+0xd [ c:\\g\\trunk\\src\\base\\platform_thread_win.cc:27 ]"], [2088810115, 'kernel32.dll!BaseThreadStart+0x37']], 'thread': 2736, 'syscall': 270, 'eventtype': 'EVENT_TYPE_SYSCALL', 'syscallname': 'ntdll.dll!NtWaitForMultipleObjects', 'waiting': 1, 'done': 220.41153299999999, 'ms': 135.494316, 'syscallargs': [1, 15858672, 1], 'cpu': 3124053392},
diff --git a/webkit/browser/fileapi/native_file_util.cc b/webkit/browser/fileapi/native_file_util.cc
index e27cb4a..7b12a62 100644
--- a/webkit/browser/fileapi/native_file_util.cc
+++ b/webkit/browser/fileapi/native_file_util.cc
@@ -228,7 +228,7 @@ PlatformFileError NativeFileUtil::CopyOrMoveFile(
}
if (copy) {
- if (file_util::CopyFile(src_path, dest_path))
+ if (base::CopyFile(src_path, dest_path))
return base::PLATFORM_FILE_OK;
} else {
if (base::Move(src_path, dest_path))