diff options
223 files changed, 540 insertions, 541 deletions
diff --git a/base/base_paths_mac.mm b/base/base_paths_mac.mm index 5d4461c..86d6a80 100644 --- a/base/base_paths_mac.mm +++ b/base/base_paths_mac.mm @@ -71,7 +71,7 @@ bool PathProviderMac(int key, base::FilePath* result) { #if defined(OS_IOS) // On IOS, this directory does not exist unless it is created explicitly. if (success && !base::PathExists(*result)) - success = file_util::CreateDirectory(*result); + success = base::CreateDirectory(*result); #endif // defined(OS_IOS) return success; } diff --git a/base/file_util.cc b/base/file_util.cc index f6d8657..1639cce 100644 --- a/base/file_util.cc +++ b/base/file_util.cc @@ -161,6 +161,10 @@ FILE* CreateAndOpenTemporaryFile(FilePath* path) { return CreateAndOpenTemporaryFileInDir(directory, path); } +bool CreateDirectory(const FilePath& full_path) { + return CreateDirectoryAndGetError(full_path, NULL); +} + } // namespace base // ----------------------------------------------------------------------------- @@ -171,10 +175,6 @@ using base::FileEnumerator; using base::FilePath; using base::kMaxUniqueFiles; -bool CreateDirectory(const base::FilePath& full_path) { - return CreateDirectoryAndGetError(full_path, NULL); -} - bool GetFileSize(const FilePath& file_path, int64* file_size) { base::PlatformFileInfo info; if (!GetFileInfo(file_path, &info)) diff --git a/base/file_util.h b/base/file_util.h index 3437890..30d9d09 100644 --- a/base/file_util.h +++ b/base/file_util.h @@ -250,22 +250,22 @@ BASE_EXPORT bool CreateTemporaryDirInDir(const FilePath& base_dir, const FilePath::StringType& prefix, FilePath* new_dir); -} // namespace base - -// ----------------------------------------------------------------------------- - -namespace file_util { - // Creates a directory, as well as creating any parent directories, if they // don't exist. Returns 'true' on successful creation, or if the directory // already exists. The directory is only readable by the current user. // Returns true on success, leaving *error unchanged. // Returns false on failure and sets *error appropriately, if it is non-NULL. -BASE_EXPORT bool CreateDirectoryAndGetError(const base::FilePath& full_path, - base::PlatformFileError* error); +BASE_EXPORT bool CreateDirectoryAndGetError(const FilePath& full_path, + PlatformFileError* error); // Backward-compatible convenience method for the above. -BASE_EXPORT bool CreateDirectory(const base::FilePath& full_path); +BASE_EXPORT bool CreateDirectory(const FilePath& full_path); + +} // namespace base + +// ----------------------------------------------------------------------------- + +namespace file_util { // Returns the file size. Returns true on success. BASE_EXPORT bool GetFileSize(const base::FilePath& file_path, int64* file_size); diff --git a/base/file_util_posix.cc b/base/file_util_posix.cc index bfdc9269..f566efb 100644 --- a/base/file_util_posix.cc +++ b/base/file_util_posix.cc @@ -588,27 +588,9 @@ bool CreateNewTempDirectory(const FilePath::StringType& prefix, return CreateTemporaryDirInDirImpl(tmpdir, TempFileName(), new_temp_path); } - -} // namespace base - -// ----------------------------------------------------------------------------- - -namespace file_util { - -using base::stat_wrapper_t; -using base::CallStat; -using base::CallLstat; -using base::CreateAndOpenFdForTemporaryFile; -using base::DirectoryExists; -using base::FileEnumerator; -using base::FilePath; -using base::MakeAbsoluteFilePath; -using base::RealPath; -using base::VerifySpecificPathControlledByUser; - bool CreateDirectoryAndGetError(const FilePath& full_path, - base::PlatformFileError* error) { - base::ThreadRestrictions::AssertIOAllowed(); // For call to mkdir(). + PlatformFileError* error) { + ThreadRestrictions::AssertIOAllowed(); // For call to mkdir(). std::vector<FilePath> subpaths; // Collect a list of all parent directories. @@ -634,13 +616,30 @@ bool CreateDirectoryAndGetError(const FilePath& full_path, int saved_errno = errno; if (!DirectoryExists(*i)) { if (error) - *error = base::ErrnoToPlatformFileError(saved_errno); + *error = ErrnoToPlatformFileError(saved_errno); return false; } } return true; } +} // namespace base + +// ----------------------------------------------------------------------------- + +namespace file_util { + +using base::stat_wrapper_t; +using base::CallStat; +using base::CallLstat; +using base::CreateAndOpenFdForTemporaryFile; +using base::DirectoryExists; +using base::FileEnumerator; +using base::FilePath; +using base::MakeAbsoluteFilePath; +using base::RealPath; +using base::VerifySpecificPathControlledByUser; + base::FilePath MakeUniqueDirectory(const base::FilePath& path) { const int kMaxAttempts = 20; for (int attempts = 0; attempts < kMaxAttempts; attempts++) { diff --git a/base/file_util_unittest.cc b/base/file_util_unittest.cc index 2dac484..9289438 100644 --- a/base/file_util_unittest.cc +++ b/base/file_util_unittest.cc @@ -254,7 +254,7 @@ TEST_F(FileUtilTest, FileAndDirectorySize) { EXPECT_EQ(20ll, size_f1); FilePath subdir_path = temp_dir_.path().Append(FPL("Level2")); - file_util::CreateDirectory(subdir_path); + base::CreateDirectory(subdir_path); FilePath file_02 = subdir_path.Append(FPL("The file 02.txt")); CreateTextFile(file_02, L"123456789012345678901234567890"); @@ -263,7 +263,7 @@ TEST_F(FileUtilTest, FileAndDirectorySize) { EXPECT_EQ(30ll, size_f2); FilePath subsubdir_path = subdir_path.Append(FPL("Level3")); - file_util::CreateDirectory(subsubdir_path); + base::CreateDirectory(subsubdir_path); FilePath file_03 = subsubdir_path.Append(FPL("The file 03.txt")); CreateTextFile(file_03, L"123"); @@ -278,7 +278,7 @@ TEST_F(FileUtilTest, NormalizeFilePathBasic) { FilePath file_a_path = temp_dir_.path().Append(FPL("file_a")); FilePath dir_path = temp_dir_.path().Append(FPL("dir")); FilePath file_b_path = dir_path.Append(FPL("file_b")); - file_util::CreateDirectory(dir_path); + base::CreateDirectory(dir_path); FilePath normalized_file_a_path, normalized_file_b_path; ASSERT_FALSE(PathExists(file_a_path)); @@ -321,10 +321,10 @@ TEST_F(FileUtilTest, NormalizeFilePathReparsePoints) { // |-> to_sub_long (reparse point to temp_dir\sub_a\long_name_\sub_long) FilePath base_a = temp_dir_.path().Append(FPL("base_a")); - ASSERT_TRUE(file_util::CreateDirectory(base_a)); + ASSERT_TRUE(base::CreateDirectory(base_a)); FilePath sub_a = base_a.Append(FPL("sub_a")); - ASSERT_TRUE(file_util::CreateDirectory(sub_a)); + ASSERT_TRUE(base::CreateDirectory(sub_a)); FilePath file_txt = sub_a.Append(FPL("file.txt")); CreateTextFile(file_txt, bogus_content); @@ -352,26 +352,26 @@ TEST_F(FileUtilTest, NormalizeFilePathReparsePoints) { ASSERT_EQ(MAX_PATH - kCreateDirLimit, deep_file.value().length()); FilePath sub_long = deep_file.DirName(); - ASSERT_TRUE(file_util::CreateDirectory(sub_long)); + ASSERT_TRUE(base::CreateDirectory(sub_long)); CreateTextFile(deep_file, bogus_content); FilePath base_b = temp_dir_.path().Append(FPL("base_b")); - ASSERT_TRUE(file_util::CreateDirectory(base_b)); + ASSERT_TRUE(base::CreateDirectory(base_b)); FilePath to_sub_a = base_b.Append(FPL("to_sub_a")); - ASSERT_TRUE(file_util::CreateDirectory(to_sub_a)); + ASSERT_TRUE(base::CreateDirectory(to_sub_a)); FilePath normalized_path; { ReparsePoint reparse_to_sub_a(to_sub_a, sub_a); ASSERT_TRUE(reparse_to_sub_a.IsValid()); FilePath to_base_b = base_b.Append(FPL("to_base_b")); - ASSERT_TRUE(file_util::CreateDirectory(to_base_b)); + ASSERT_TRUE(base::CreateDirectory(to_base_b)); ReparsePoint reparse_to_base_b(to_base_b, base_b); ASSERT_TRUE(reparse_to_base_b.IsValid()); FilePath to_sub_long = base_b.Append(FPL("to_sub_long")); - ASSERT_TRUE(file_util::CreateDirectory(to_sub_long)); + ASSERT_TRUE(base::CreateDirectory(to_sub_long)); ReparsePoint reparse_to_sub_long(to_sub_long, sub_long); ASSERT_TRUE(reparse_to_sub_long.IsValid()); @@ -492,7 +492,7 @@ TEST_F(FileUtilTest, DevicePathToDriveLetter) { TEST_F(FileUtilTest, GetPlatformFileInfoForDirectory) { FilePath empty_dir = temp_dir_.path().Append(FPL("gpfi_test")); - ASSERT_TRUE(file_util::CreateDirectory(empty_dir)); + ASSERT_TRUE(base::CreateDirectory(empty_dir)); win::ScopedHandle dir( ::CreateFile(empty_dir.value().c_str(), FILE_ALL_ACCESS, @@ -518,7 +518,7 @@ TEST_F(FileUtilTest, CreateTemporaryFileInDirLongPathTest) { const FilePath::CharType kLongDirName[] = FPL("A long path"); const FilePath::CharType kTestSubDirName[] = FPL("test"); FilePath long_test_dir = temp_dir_.path().Append(kLongDirName); - ASSERT_TRUE(file_util::CreateDirectory(long_test_dir)); + ASSERT_TRUE(base::CreateDirectory(long_test_dir)); // kLongDirName is not a 8.3 component. So GetShortName() should give us a // different short name. @@ -543,7 +543,7 @@ TEST_F(FileUtilTest, CreateTemporaryFileInDirLongPathTest) { // directories. (Note that this assumption is true for NTFS, but not for some // network file systems. E.g. AFS). FilePath access_test_dir = long_test_dir.Append(kTestSubDirName); - ASSERT_TRUE(file_util::CreateDirectory(access_test_dir)); + ASSERT_TRUE(base::CreateDirectory(access_test_dir)); file_util::PermissionRestorer long_test_dir_restorer(long_test_dir); ASSERT_TRUE(file_util::MakeFileUnreadable(long_test_dir)); @@ -583,7 +583,7 @@ TEST_F(FileUtilTest, CreateAndReadSymlinks) { // Link to a directory. link_from = temp_dir_.path().Append(FPL("from_dir")); link_to = temp_dir_.path().Append(FPL("to_dir")); - ASSERT_TRUE(file_util::CreateDirectory(link_to)); + ASSERT_TRUE(base::CreateDirectory(link_to)); ASSERT_TRUE(CreateSymbolicLink(link_to, link_from)) << "Failed to create directory symlink."; @@ -618,7 +618,7 @@ TEST_F(FileUtilTest, NormalizeFilePathSymlinks) { // Link to a directory. link_from = temp_dir_.path().Append(FPL("from_dir")); link_to = temp_dir_.path().Append(FPL("to_dir")); - ASSERT_TRUE(file_util::CreateDirectory(link_to)); + ASSERT_TRUE(base::CreateDirectory(link_to)); ASSERT_TRUE(CreateSymbolicLink(link_to, link_from)) << "Failed to create directory symlink."; @@ -797,7 +797,7 @@ TEST_F(FileUtilTest, ChangeDirectoryPermissionsAndEnumerate) { // Create a directory path. FilePath subdir_path = temp_dir_.path().Append(FPL("PermissionTest1")); - file_util::CreateDirectory(subdir_path); + base::CreateDirectory(subdir_path); ASSERT_TRUE(PathExists(subdir_path)); // Create a dummy file to enumerate. @@ -854,7 +854,7 @@ TEST_F(FileUtilTest, DeleteWildCard) { ASSERT_TRUE(PathExists(file_name)); FilePath subdir_path = temp_dir_.path().Append(FPL("DeleteWildCardDir")); - file_util::CreateDirectory(subdir_path); + base::CreateDirectory(subdir_path); ASSERT_TRUE(PathExists(subdir_path)); // Create the wildcard path @@ -877,7 +877,7 @@ TEST_F(FileUtilTest, DeleteNonExistantWildCard) { // Create a file and a directory FilePath subdir_path = temp_dir_.path().Append(FPL("DeleteNonExistantWildCard")); - file_util::CreateDirectory(subdir_path); + base::CreateDirectory(subdir_path); ASSERT_TRUE(PathExists(subdir_path)); // Create the wildcard path @@ -898,7 +898,7 @@ TEST_F(FileUtilTest, DeleteNonExistantWildCard) { TEST_F(FileUtilTest, DeleteDirNonRecursive) { // Create a subdirectory and put a file and two directories inside. FilePath test_subdir = temp_dir_.path().Append(FPL("DeleteDirNonRecursive")); - file_util::CreateDirectory(test_subdir); + base::CreateDirectory(test_subdir); ASSERT_TRUE(PathExists(test_subdir)); FilePath file_name = test_subdir.Append(FPL("Test DeleteDir.txt")); @@ -906,11 +906,11 @@ TEST_F(FileUtilTest, DeleteDirNonRecursive) { ASSERT_TRUE(PathExists(file_name)); FilePath subdir_path1 = test_subdir.Append(FPL("TestSubDir1")); - file_util::CreateDirectory(subdir_path1); + base::CreateDirectory(subdir_path1); ASSERT_TRUE(PathExists(subdir_path1)); FilePath subdir_path2 = test_subdir.Append(FPL("TestSubDir2")); - file_util::CreateDirectory(subdir_path2); + base::CreateDirectory(subdir_path2); ASSERT_TRUE(PathExists(subdir_path2)); // Delete non-recursively and check that the empty dir got deleted @@ -928,7 +928,7 @@ TEST_F(FileUtilTest, DeleteDirNonRecursive) { TEST_F(FileUtilTest, DeleteDirRecursive) { // Create a subdirectory and put a file and two directories inside. FilePath test_subdir = temp_dir_.path().Append(FPL("DeleteDirRecursive")); - file_util::CreateDirectory(test_subdir); + base::CreateDirectory(test_subdir); ASSERT_TRUE(PathExists(test_subdir)); FilePath file_name = test_subdir.Append(FPL("Test DeleteDirRecursive.txt")); @@ -936,11 +936,11 @@ TEST_F(FileUtilTest, DeleteDirRecursive) { ASSERT_TRUE(PathExists(file_name)); FilePath subdir_path1 = test_subdir.Append(FPL("TestSubDir1")); - file_util::CreateDirectory(subdir_path1); + base::CreateDirectory(subdir_path1); ASSERT_TRUE(PathExists(subdir_path1)); FilePath subdir_path2 = test_subdir.Append(FPL("TestSubDir2")); - file_util::CreateDirectory(subdir_path2); + base::CreateDirectory(subdir_path2); ASSERT_TRUE(PathExists(subdir_path2)); // Delete recursively and check that the empty dir got deleted @@ -1004,7 +1004,7 @@ TEST_F(FileUtilTest, MoveFileDirExists) { // The destination directory FilePath dir_name_to = temp_dir_.path().Append(FILE_PATH_LITERAL("Destination")); - file_util::CreateDirectory(dir_name_to); + base::CreateDirectory(dir_name_to); ASSERT_TRUE(PathExists(dir_name_to)); EXPECT_FALSE(Move(file_name_from, dir_name_to)); @@ -1015,7 +1015,7 @@ TEST_F(FileUtilTest, MoveNew) { // Create a directory FilePath dir_name_from = temp_dir_.path().Append(FILE_PATH_LITERAL("Move_From_Subdir")); - file_util::CreateDirectory(dir_name_from); + base::CreateDirectory(dir_name_from); ASSERT_TRUE(PathExists(dir_name_from)); // Create a file under the directory @@ -1056,7 +1056,7 @@ TEST_F(FileUtilTest, MoveExist) { // Create a directory FilePath dir_name_from = temp_dir_.path().Append(FILE_PATH_LITERAL("Move_From_Subdir")); - file_util::CreateDirectory(dir_name_from); + base::CreateDirectory(dir_name_from); ASSERT_TRUE(PathExists(dir_name_from)); // Create a file under the directory @@ -1075,7 +1075,7 @@ TEST_F(FileUtilTest, MoveExist) { dir_name_to.Append(FILE_PATH_LITERAL("Move_Test_File.txt")); // Create the destination directory. - file_util::CreateDirectory(dir_name_exists); + base::CreateDirectory(dir_name_exists); ASSERT_TRUE(PathExists(dir_name_exists)); EXPECT_TRUE(Move(dir_name_from, dir_name_to)); @@ -1091,7 +1091,7 @@ TEST_F(FileUtilTest, CopyDirectoryRecursivelyNew) { // Create a directory. FilePath dir_name_from = temp_dir_.path().Append(FILE_PATH_LITERAL("Copy_From_Subdir")); - file_util::CreateDirectory(dir_name_from); + base::CreateDirectory(dir_name_from); ASSERT_TRUE(PathExists(dir_name_from)); // Create a file under the directory. @@ -1103,7 +1103,7 @@ TEST_F(FileUtilTest, CopyDirectoryRecursivelyNew) { // Create a subdirectory. FilePath subdir_name_from = dir_name_from.Append(FILE_PATH_LITERAL("Subdir")); - file_util::CreateDirectory(subdir_name_from); + base::CreateDirectory(subdir_name_from); ASSERT_TRUE(PathExists(subdir_name_from)); // Create a file under the subdirectory. @@ -1141,7 +1141,7 @@ TEST_F(FileUtilTest, CopyDirectoryRecursivelyExists) { // Create a directory. FilePath dir_name_from = temp_dir_.path().Append(FILE_PATH_LITERAL("Copy_From_Subdir")); - file_util::CreateDirectory(dir_name_from); + base::CreateDirectory(dir_name_from); ASSERT_TRUE(PathExists(dir_name_from)); // Create a file under the directory. @@ -1153,7 +1153,7 @@ TEST_F(FileUtilTest, CopyDirectoryRecursivelyExists) { // Create a subdirectory. FilePath subdir_name_from = dir_name_from.Append(FILE_PATH_LITERAL("Subdir")); - file_util::CreateDirectory(subdir_name_from); + base::CreateDirectory(subdir_name_from); ASSERT_TRUE(PathExists(subdir_name_from)); // Create a file under the subdirectory. @@ -1176,7 +1176,7 @@ TEST_F(FileUtilTest, CopyDirectoryRecursivelyExists) { subdir_name_to.Append(FILE_PATH_LITERAL("Copy_Test_File.txt")); // Create the destination directory. - file_util::CreateDirectory(dir_name_exists); + base::CreateDirectory(dir_name_exists); ASSERT_TRUE(PathExists(dir_name_exists)); EXPECT_TRUE(CopyDirectory(dir_name_from, dir_name_exists, true)); @@ -1196,7 +1196,7 @@ TEST_F(FileUtilTest, CopyDirectoryNew) { // Create a directory. FilePath dir_name_from = temp_dir_.path().Append(FILE_PATH_LITERAL("Copy_From_Subdir")); - file_util::CreateDirectory(dir_name_from); + base::CreateDirectory(dir_name_from); ASSERT_TRUE(PathExists(dir_name_from)); // Create a file under the directory. @@ -1208,7 +1208,7 @@ TEST_F(FileUtilTest, CopyDirectoryNew) { // Create a subdirectory. FilePath subdir_name_from = dir_name_from.Append(FILE_PATH_LITERAL("Subdir")); - file_util::CreateDirectory(subdir_name_from); + base::CreateDirectory(subdir_name_from); ASSERT_TRUE(PathExists(subdir_name_from)); // Create a file under the subdirectory. @@ -1243,7 +1243,7 @@ TEST_F(FileUtilTest, CopyDirectoryExists) { // Create a directory. FilePath dir_name_from = temp_dir_.path().Append(FILE_PATH_LITERAL("Copy_From_Subdir")); - file_util::CreateDirectory(dir_name_from); + base::CreateDirectory(dir_name_from); ASSERT_TRUE(PathExists(dir_name_from)); // Create a file under the directory. @@ -1255,7 +1255,7 @@ TEST_F(FileUtilTest, CopyDirectoryExists) { // Create a subdirectory. FilePath subdir_name_from = dir_name_from.Append(FILE_PATH_LITERAL("Subdir")); - file_util::CreateDirectory(subdir_name_from); + base::CreateDirectory(subdir_name_from); ASSERT_TRUE(PathExists(subdir_name_from)); // Create a file under the subdirectory. @@ -1273,7 +1273,7 @@ TEST_F(FileUtilTest, CopyDirectoryExists) { dir_name_to.Append(FILE_PATH_LITERAL("Subdir")); // Create the destination directory. - file_util::CreateDirectory(dir_name_to); + base::CreateDirectory(dir_name_to); ASSERT_TRUE(PathExists(dir_name_to)); EXPECT_TRUE(CopyDirectory(dir_name_from, dir_name_to, false)); @@ -1336,7 +1336,7 @@ TEST_F(FileUtilTest, CopyFileWithCopyDirectoryRecursiveToExistingDirectory) { // The destination FilePath dir_name_to = temp_dir_.path().Append(FILE_PATH_LITERAL("Destination")); - file_util::CreateDirectory(dir_name_to); + base::CreateDirectory(dir_name_to); ASSERT_TRUE(PathExists(dir_name_to)); FilePath file_name_to = dir_name_to.Append(FILE_PATH_LITERAL("Copy_Test_File.txt")); @@ -1351,7 +1351,7 @@ TEST_F(FileUtilTest, CopyDirectoryWithTrailingSeparators) { // Create a directory. FilePath dir_name_from = temp_dir_.path().Append(FILE_PATH_LITERAL("Copy_From_Subdir")); - file_util::CreateDirectory(dir_name_from); + base::CreateDirectory(dir_name_from); ASSERT_TRUE(PathExists(dir_name_from)); // Create a file under the directory. @@ -1388,7 +1388,7 @@ TEST_F(FileUtilTest, CopyFile) { // Create a directory FilePath dir_name_from = temp_dir_.path().Append(FILE_PATH_LITERAL("Copy_From_Subdir")); - file_util::CreateDirectory(dir_name_from); + base::CreateDirectory(dir_name_from); ASSERT_TRUE(PathExists(dir_name_from)); // Create a file under the directory @@ -1523,7 +1523,7 @@ TEST_F(FileUtilTest, CopyAndDeleteDirectoryTest) { // Create a directory FilePath dir_name_from = temp_dir_.path().Append(FILE_PATH_LITERAL("CopyAndDelete_From_Subdir")); - file_util::CreateDirectory(dir_name_from); + base::CreateDirectory(dir_name_from); ASSERT_TRUE(PathExists(dir_name_from)); // Create a file under the directory @@ -1652,17 +1652,17 @@ TEST_F(FileUtilTest, CreateDirectoryTest) { #endif EXPECT_FALSE(PathExists(test_path)); - EXPECT_TRUE(file_util::CreateDirectory(test_path)); + EXPECT_TRUE(base::CreateDirectory(test_path)); EXPECT_TRUE(PathExists(test_path)); // CreateDirectory returns true if the DirectoryExists returns true. - EXPECT_TRUE(file_util::CreateDirectory(test_path)); + EXPECT_TRUE(base::CreateDirectory(test_path)); // Doesn't work to create it on top of a non-dir test_path = test_path.Append(FILE_PATH_LITERAL("foobar.txt")); EXPECT_FALSE(PathExists(test_path)); CreateTextFile(test_path, L"test file"); EXPECT_TRUE(PathExists(test_path)); - EXPECT_FALSE(file_util::CreateDirectory(test_path)); + EXPECT_FALSE(base::CreateDirectory(test_path)); EXPECT_TRUE(DeleteFile(test_root, true)); EXPECT_FALSE(PathExists(test_root)); @@ -1680,16 +1680,16 @@ TEST_F(FileUtilTest, CreateDirectoryTest) { // Given these assumptions hold, it should be safe to // test that "creating" these directories succeeds. - EXPECT_TRUE(file_util::CreateDirectory( + EXPECT_TRUE(base::CreateDirectory( FilePath(FilePath::kCurrentDirectory))); - EXPECT_TRUE(file_util::CreateDirectory(top_level)); + EXPECT_TRUE(base::CreateDirectory(top_level)); #if defined(OS_WIN) FilePath invalid_drive(FILE_PATH_LITERAL("o:\\")); FilePath invalid_path = invalid_drive.Append(FILE_PATH_LITERAL("some\\inaccessible\\dir")); if (!PathExists(invalid_drive)) { - EXPECT_FALSE(file_util::CreateDirectory(invalid_path)); + EXPECT_FALSE(base::CreateDirectory(invalid_path)); } #endif } @@ -1699,7 +1699,7 @@ TEST_F(FileUtilTest, DetectDirectoryTest) { FilePath test_root = temp_dir_.path().Append(FILE_PATH_LITERAL("detect_directory_test")); EXPECT_FALSE(PathExists(test_root)); - EXPECT_TRUE(file_util::CreateDirectory(test_root)); + EXPECT_TRUE(base::CreateDirectory(test_root)); EXPECT_TRUE(PathExists(test_root)); EXPECT_TRUE(DirectoryExists(test_root)); // Check a file @@ -1729,11 +1729,11 @@ TEST_F(FileUtilTest, FileEnumeratorTest) { // create the directories FilePath dir1 = temp_dir_.path().Append(FPL("dir1")); - EXPECT_TRUE(file_util::CreateDirectory(dir1)); + EXPECT_TRUE(base::CreateDirectory(dir1)); FilePath dir2 = temp_dir_.path().Append(FPL("dir2")); - EXPECT_TRUE(file_util::CreateDirectory(dir2)); + EXPECT_TRUE(base::CreateDirectory(dir2)); FilePath dir2inner = dir2.Append(FPL("inner")); - EXPECT_TRUE(file_util::CreateDirectory(dir2inner)); + EXPECT_TRUE(base::CreateDirectory(dir2inner)); // create the files FilePath dir2file = dir2.Append(FPL("dir2file.txt")); @@ -1870,13 +1870,13 @@ TEST_F(FileUtilTest, AppendToFile) { if (PathExists(data_dir)) { ASSERT_TRUE(DeleteFile(data_dir, true)); } - ASSERT_TRUE(file_util::CreateDirectory(data_dir)); + ASSERT_TRUE(base::CreateDirectory(data_dir)); // Create a fresh, empty copy of this directory. if (PathExists(data_dir)) { ASSERT_TRUE(DeleteFile(data_dir, true)); } - ASSERT_TRUE(file_util::CreateDirectory(data_dir)); + ASSERT_TRUE(base::CreateDirectory(data_dir)); FilePath foobar(data_dir.Append(FILE_PATH_LITERAL("foobar.txt"))); std::string data("hello"); @@ -1898,7 +1898,7 @@ TEST_F(FileUtilTest, TouchFile) { if (PathExists(data_dir)) { ASSERT_TRUE(DeleteFile(data_dir, true)); } - ASSERT_TRUE(file_util::CreateDirectory(data_dir)); + ASSERT_TRUE(base::CreateDirectory(data_dir)); FilePath foobar(data_dir.Append(FILE_PATH_LITERAL("foobar.txt"))); std::string data("hello"); @@ -1930,7 +1930,7 @@ TEST_F(FileUtilTest, IsDirectoryEmpty) { ASSERT_FALSE(PathExists(empty_dir)); - ASSERT_TRUE(file_util::CreateDirectory(empty_dir)); + ASSERT_TRUE(base::CreateDirectory(empty_dir)); EXPECT_TRUE(base::IsDirectoryEmpty(empty_dir)); @@ -1962,10 +1962,10 @@ class VerifyPathControlledByUserTest : public FileUtilTest { // |-> text_file_ base_dir_ = temp_dir_.path().AppendASCII("base_dir"); - ASSERT_TRUE(file_util::CreateDirectory(base_dir_)); + ASSERT_TRUE(base::CreateDirectory(base_dir_)); sub_dir_ = base_dir_.AppendASCII("sub_dir"); - ASSERT_TRUE(file_util::CreateDirectory(sub_dir_)); + ASSERT_TRUE(base::CreateDirectory(sub_dir_)); text_file_ = sub_dir_.AppendASCII("file.txt"); CreateTextFile(text_file_, L"This text file has some text in it."); diff --git a/base/file_util_win.cc b/base/file_util_win.cc index ac35c74..be58630 100644 --- a/base/file_util_win.cc +++ b/base/file_util_win.cc @@ -178,7 +178,7 @@ bool CopyDirectory(const FilePath& from_path, const FilePath& 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) - file_util::CreateDirectory(to_path); + CreateDirectory(to_path); else ShellCopy(from_path, to_path, false); } @@ -329,19 +329,9 @@ bool CreateNewTempDirectory(const FilePath::StringType& prefix, return CreateTemporaryDirInDir(system_temp_dir, prefix, new_temp_path); } -} // namespace base - -// ----------------------------------------------------------------------------- - -namespace file_util { - -using base::DirectoryExists; -using base::FilePath; -using base::kFileShareAll; - bool CreateDirectoryAndGetError(const FilePath& full_path, - base::PlatformFileError* error) { - base::ThreadRestrictions::AssertIOAllowed(); + PlatformFileError* error) { + ThreadRestrictions::AssertIOAllowed(); // If the path exists, we've succeeded if it's a directory, failed otherwise. const wchar_t* full_path_str = full_path.value().c_str(); @@ -355,7 +345,7 @@ bool CreateDirectoryAndGetError(const FilePath& full_path, DLOG(WARNING) << "CreateDirectory(" << full_path_str << "), " << "conflicts with existing file."; if (error) { - *error = base::PLATFORM_FILE_ERROR_NOT_A_DIRECTORY; + *error = PLATFORM_FILE_ERROR_NOT_A_DIRECTORY; } return false; } @@ -368,14 +358,14 @@ bool CreateDirectoryAndGetError(const FilePath& full_path, FilePath parent_path(full_path.DirName()); if (parent_path.value() == full_path.value()) { if (error) { - *error = base::PLATFORM_FILE_ERROR_NOT_FOUND; + *error = PLATFORM_FILE_ERROR_NOT_FOUND; } return false; } if (!CreateDirectoryAndGetError(parent_path, error)) { DLOG(WARNING) << "Failed to create one of the parent directories."; if (error) { - DCHECK(*error != base::PLATFORM_FILE_OK); + DCHECK(*error != PLATFORM_FILE_OK); } return false; } @@ -390,7 +380,7 @@ bool CreateDirectoryAndGetError(const FilePath& full_path, return true; } else { if (error) - *error = base::LastErrorToPlatformFileError(error_code); + *error = LastErrorToPlatformFileError(error_code); DLOG(WARNING) << "Failed to create directory " << full_path_str << ", last error is " << error_code << "."; return false; @@ -400,6 +390,16 @@ bool CreateDirectoryAndGetError(const FilePath& full_path, } } +} // namespace base + +// ----------------------------------------------------------------------------- + +namespace file_util { + +using base::DirectoryExists; +using base::FilePath; +using base::kFileShareAll; + // TODO(rkc): Work out if we want to handle NTFS junctions here or not, handle // them if we do decide to. bool IsLink(const FilePath& file_path) { diff --git a/base/files/file_path_watcher_browsertest.cc b/base/files/file_path_watcher_browsertest.cc index d42aab2..aed409c 100644 --- a/base/files/file_path_watcher_browsertest.cc +++ b/base/files/file_path_watcher_browsertest.cc @@ -339,7 +339,7 @@ TEST_F(FilePathWatcherTest, NonExistentDirectory) { scoped_ptr<TestDelegate> delegate(new TestDelegate(collector())); ASSERT_TRUE(SetupWatch(file, &watcher, delegate.get(), false)); - ASSERT_TRUE(file_util::CreateDirectory(dir)); + ASSERT_TRUE(base::CreateDirectory(dir)); ASSERT_TRUE(WriteFile(file, "content")); @@ -376,7 +376,7 @@ TEST_F(FilePathWatcherTest, DirectoryChain) { for (std::vector<std::string>::const_iterator d(dir_names.begin()); d != dir_names.end(); ++d) { sub_path = sub_path.AppendASCII(*d); - ASSERT_TRUE(file_util::CreateDirectory(sub_path)); + ASSERT_TRUE(base::CreateDirectory(sub_path)); } VLOG(1) << "Create File"; ASSERT_TRUE(WriteFile(file, "content")); @@ -397,7 +397,7 @@ TEST_F(FilePathWatcherTest, DisappearingDirectory) { FilePathWatcher watcher; FilePath dir(temp_dir_.path().AppendASCII("dir")); FilePath file(dir.AppendASCII("file")); - ASSERT_TRUE(file_util::CreateDirectory(dir)); + ASSERT_TRUE(base::CreateDirectory(dir)); ASSERT_TRUE(WriteFile(file, "content")); scoped_ptr<TestDelegate> delegate(new TestDelegate(collector())); ASSERT_TRUE(SetupWatch(file, &watcher, delegate.get(), false)); @@ -432,7 +432,7 @@ TEST_F(FilePathWatcherTest, WatchDirectory) { scoped_ptr<TestDelegate> delegate(new TestDelegate(collector())); ASSERT_TRUE(SetupWatch(dir, &watcher, delegate.get(), false)); - ASSERT_TRUE(file_util::CreateDirectory(dir)); + ASSERT_TRUE(base::CreateDirectory(dir)); VLOG(1) << "Waiting for directory creation"; ASSERT_TRUE(WaitForEvents()); @@ -471,7 +471,7 @@ TEST_F(FilePathWatcherTest, MoveParent) { false)); // Setup a directory hierarchy. - ASSERT_TRUE(file_util::CreateDirectory(subdir)); + ASSERT_TRUE(base::CreateDirectory(subdir)); ASSERT_TRUE(WriteFile(file, "content")); VLOG(1) << "Waiting for file creation"; ASSERT_TRUE(WaitForEvents()); @@ -492,7 +492,7 @@ TEST_F(FilePathWatcherTest, RecursiveWatch) { ASSERT_TRUE(SetupWatch(dir, &watcher, delegate.get(), true)); // Main directory("dir") creation. - ASSERT_TRUE(file_util::CreateDirectory(dir)); + ASSERT_TRUE(base::CreateDirectory(dir)); ASSERT_TRUE(WaitForEvents()); // Create "$dir/file1". @@ -502,7 +502,7 @@ TEST_F(FilePathWatcherTest, RecursiveWatch) { // Create "$dir/subdir". FilePath subdir(dir.AppendASCII("subdir")); - ASSERT_TRUE(file_util::CreateDirectory(subdir)); + ASSERT_TRUE(base::CreateDirectory(subdir)); ASSERT_TRUE(WaitForEvents()); // Create "$dir/subdir/subdir_file1". @@ -512,7 +512,7 @@ TEST_F(FilePathWatcherTest, RecursiveWatch) { // Create "$dir/subdir/subdir_child_dir". FilePath subdir_child_dir(subdir.AppendASCII("subdir_child_dir")); - ASSERT_TRUE(file_util::CreateDirectory(subdir_child_dir)); + ASSERT_TRUE(base::CreateDirectory(subdir_child_dir)); ASSERT_TRUE(WaitForEvents()); // Create "$dir/subdir/subdir_child_dir/child_dir_file1". @@ -559,7 +559,7 @@ TEST_F(FilePathWatcherTest, MoveChild) { FilePath dest_file(dest_subdir.AppendASCII("file")); // Setup a directory hierarchy. - ASSERT_TRUE(file_util::CreateDirectory(source_subdir)); + ASSERT_TRUE(base::CreateDirectory(source_subdir)); ASSERT_TRUE(WriteFile(source_file, "content")); scoped_ptr<TestDelegate> file_delegate(new TestDelegate(collector())); @@ -683,7 +683,7 @@ TEST_F(FilePathWatcherTest, LinkedDirectoryPart1) { FilePath linkfile(link_dir.AppendASCII("file")); scoped_ptr<TestDelegate> delegate(new TestDelegate(collector())); // dir/file should exist. - ASSERT_TRUE(file_util::CreateDirectory(dir)); + ASSERT_TRUE(base::CreateDirectory(dir)); ASSERT_TRUE(WriteFile(file, "content")); // Note that we are watching dir.lnk/file which doesn't exist yet. ASSERT_TRUE(SetupWatch(linkfile, &watcher, delegate.get(), false)); @@ -717,7 +717,7 @@ TEST_F(FilePathWatcherTest, LinkedDirectoryPart2) { // Note that we are watching dir.lnk/file. ASSERT_TRUE(SetupWatch(linkfile, &watcher, delegate.get(), false)); - ASSERT_TRUE(file_util::CreateDirectory(dir)); + ASSERT_TRUE(base::CreateDirectory(dir)); ASSERT_TRUE(WriteFile(file, "content")); VLOG(1) << "Waiting for dir/file creation"; ASSERT_TRUE(WaitForEvents()); @@ -741,7 +741,7 @@ TEST_F(FilePathWatcherTest, LinkedDirectoryPart3) { FilePath file(dir.AppendASCII("file")); FilePath linkfile(link_dir.AppendASCII("file")); scoped_ptr<TestDelegate> delegate(new TestDelegate(collector())); - ASSERT_TRUE(file_util::CreateDirectory(dir)); + ASSERT_TRUE(base::CreateDirectory(dir)); ASSERT_TRUE(CreateSymbolicLink(dir, link_dir)); // Note that we are watching dir.lnk/file but the file doesn't exist yet. ASSERT_TRUE(SetupWatch(linkfile, &watcher, delegate.get(), false)); @@ -812,8 +812,8 @@ TEST_F(FilePathWatcherTest, DirAttributesChanged) { FilePath test_dir2(test_dir1.AppendASCII("DirAttributesChangedDir2")); FilePath test_file(test_dir2.AppendASCII("DirAttributesChangedFile")); // Setup a directory hierarchy. - ASSERT_TRUE(file_util::CreateDirectory(test_dir1)); - ASSERT_TRUE(file_util::CreateDirectory(test_dir2)); + ASSERT_TRUE(base::CreateDirectory(test_dir1)); + ASSERT_TRUE(base::CreateDirectory(test_dir2)); ASSERT_TRUE(WriteFile(test_file, "content")); FilePathWatcher watcher; diff --git a/base/files/file_util_proxy_unittest.cc b/base/files/file_util_proxy_unittest.cc index 73ac8a6..7691d44 100644 --- a/base/files/file_util_proxy_unittest.cc +++ b/base/files/file_util_proxy_unittest.cc @@ -247,7 +247,7 @@ TEST_F(FileUtilProxyTest, GetFileInfo_File) { TEST_F(FileUtilProxyTest, GetFileInfo_Directory) { // Setup. - ASSERT_TRUE(file_util::CreateDirectory(test_path())); + ASSERT_TRUE(base::CreateDirectory(test_path())); PlatformFileInfo expected_info; file_util::GetFileInfo(test_path(), &expected_info); diff --git a/base/files/scoped_temp_dir.cc b/base/files/scoped_temp_dir.cc index 5624a06..b893b02 100644 --- a/base/files/scoped_temp_dir.cc +++ b/base/files/scoped_temp_dir.cc @@ -34,7 +34,7 @@ bool ScopedTempDir::CreateUniqueTempDirUnderPath(const FilePath& base_path) { return false; // If |base_path| does not exist, create it. - if (!file_util::CreateDirectory(base_path)) + if (!base::CreateDirectory(base_path)) return false; // Create a new, uniquely named directory under |base_path|. @@ -50,7 +50,7 @@ bool ScopedTempDir::Set(const FilePath& path) { if (!path_.empty()) return false; - if (!DirectoryExists(path) && !file_util::CreateDirectory(path)) + if (!DirectoryExists(path) && !base::CreateDirectory(path)) return false; path_ = path; diff --git a/base/mac/mac_util_unittest.mm b/base/mac/mac_util_unittest.mm index 15ceca3..1b56814 100644 --- a/base/mac/mac_util_unittest.mm +++ b/base/mac/mac_util_unittest.mm @@ -220,7 +220,7 @@ TEST_F(MacUtilTest, TestRemoveQuarantineAttribute) { ScopedTempDir temp_dir_; ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); FilePath dummy_folder_path = temp_dir_.path().Append("DummyFolder"); - ASSERT_TRUE(file_util::CreateDirectory(dummy_folder_path)); + ASSERT_TRUE(base::CreateDirectory(dummy_folder_path)); const char* quarantine_str = "0000;4b392bb2;Chromium;|org.chromium.Chromium"; const char* file_path_str = dummy_folder_path.value().c_str(); EXPECT_EQ(0, setxattr(file_path_str, "com.apple.quarantine", @@ -238,7 +238,7 @@ TEST_F(MacUtilTest, TestRemoveQuarantineAttributeTwice) { ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); FilePath dummy_folder_path = temp_dir_.path().Append("DummyFolder"); const char* file_path_str = dummy_folder_path.value().c_str(); - ASSERT_TRUE(file_util::CreateDirectory(dummy_folder_path)); + ASSERT_TRUE(base::CreateDirectory(dummy_folder_path)); EXPECT_EQ(-1, getxattr(file_path_str, "com.apple.quarantine", NULL, 0, 0, 0)); // No quarantine attribute to begin with, but RemoveQuarantineAttribute still // succeeds because in the end the folder still doesn't have the quarantine diff --git a/base/path_service.cc b/base/path_service.cc index 89e58b2..f0a6a84 100644 --- a/base/path_service.cc +++ b/base/path_service.cc @@ -254,7 +254,7 @@ bool PathService::OverrideAndCreateIfNeeded(int key, // this to the absolute path because on POSIX, MakeAbsoluteFilePath fails // if called on a non-existent path. if (!base::PathExists(file_path) && - !file_util::CreateDirectory(file_path)) + !base::CreateDirectory(file_path)) return false; } diff --git a/base/test/launcher/test_results_tracker.cc b/base/test/launcher/test_results_tracker.cc index 905b0f1..b2140da 100644 --- a/base/test/launcher/test_results_tracker.cc +++ b/base/test/launcher/test_results_tracker.cc @@ -130,7 +130,7 @@ bool TestResultsTracker::Init(const CommandLine& command_line) { LOG(WARNING) << "The output directory does not exist. " << "Creating the directory: " << dir_name.value(); // Create the directory if necessary (because the gtest does the same). - if (!file_util::CreateDirectory(dir_name)) { + if (!base::CreateDirectory(dir_name)) { LOG(ERROR) << "Failed to created directory " << dir_name.value(); return false; } diff --git a/cc/test/pixel_test_utils.cc b/cc/test/pixel_test_utils.cc index d913492..f6b2a8c 100644 --- a/cc/test/pixel_test_utils.cc +++ b/cc/test/pixel_test_utils.cc @@ -20,7 +20,7 @@ bool WritePNGFile(const SkBitmap& bitmap, const base::FilePath& file_path, if (gfx::PNGCodec::EncodeBGRASkBitmap(bitmap, discard_transparency, &png_data) && - file_util::CreateDirectory(file_path.DirName())) { + base::CreateDirectory(file_path.DirName())) { char* data = reinterpret_cast<char*>(&png_data[0]); int size = static_cast<int>(png_data.size()); return file_util::WriteFile(file_path, data, size) == size; diff --git a/chrome/browser/browsing_data/browsing_data_database_helper_browsertest.cc b/chrome/browser/browsing_data/browsing_data_database_helper_browsertest.cc index ab1ea67..f9ad7e4 100644 --- a/chrome/browser/browsing_data/browsing_data_database_helper_browsertest.cc +++ b/chrome/browser/browsing_data/browsing_data_database_helper_browsertest.cc @@ -41,14 +41,14 @@ class BrowsingDataDatabaseHelperTest : public InProcessBrowserTest { db_tracker->DatabaseClosed(kTestIdentifier1, db_name); base::FilePath db_path1 = db_tracker->GetFullDBFilePath(kTestIdentifier1, db_name); - file_util::CreateDirectory(db_path1.DirName()); + base::CreateDirectory(db_path1.DirName()); ASSERT_EQ(0, file_util::WriteFile(db_path1, NULL, 0)); db_tracker->DatabaseOpened(kTestIdentifierExtension, db_name, description, 1, &size); db_tracker->DatabaseClosed(kTestIdentifierExtension, db_name); base::FilePath db_path2 = db_tracker->GetFullDBFilePath(kTestIdentifierExtension, db_name); - file_util::CreateDirectory(db_path2.DirName()); + base::CreateDirectory(db_path2.DirName()); ASSERT_EQ(0, file_util::WriteFile(db_path2, NULL, 0)); std::vector<webkit_database::OriginInfo> origins; db_tracker->GetAllOriginsInfo(&origins); diff --git a/chrome/browser/browsing_data/browsing_data_local_storage_helper_browsertest.cc b/chrome/browser/browsing_data/browsing_data_local_storage_helper_browsertest.cc index 370495b..564e07f9 100644 --- a/chrome/browser/browsing_data/browsing_data_local_storage_helper_browsertest.cc +++ b/chrome/browser/browsing_data/browsing_data_local_storage_helper_browsertest.cc @@ -54,7 +54,7 @@ class BrowsingDataLocalStorageHelperTest : public InProcessBrowserTest { // Note: This helper depends on details of how the dom_storage library // stores data in the host file system. base::FilePath storage_path = GetLocalStoragePathForTestingProfile(); - file_util::CreateDirectory(storage_path); + base::CreateDirectory(storage_path); const base::FilePath::CharType* kFilesToCreate[] = { kTestFile0, kTestFile1, kTestFileInvalid, kTestFileExtension }; diff --git a/chrome/browser/browsing_data/browsing_data_remover_unittest.cc b/chrome/browser/browsing_data/browsing_data_remover_unittest.cc index d15052d..848c271 100644 --- a/chrome/browser/browsing_data/browsing_data_remover_unittest.cc +++ b/chrome/browser/browsing_data/browsing_data_remover_unittest.cc @@ -554,7 +554,7 @@ class RemoveLocalStorageTester { // stores data in the host file system. base::FilePath storage_path = profile_->GetPath().AppendASCII("Local Storage"); - file_util::CreateDirectory(storage_path); + base::CreateDirectory(storage_path); // Write some files. file_util::WriteFile(storage_path.Append(kDomStorageOrigin1), NULL, 0); diff --git a/chrome/browser/chromeos/app_mode/kiosk_app_data.cc b/chrome/browser/chromeos/app_mode/kiosk_app_data.cc index 0aaa29e..f481ea7 100644 --- a/chrome/browser/chromeos/app_mode/kiosk_app_data.cc +++ b/chrome/browser/chromeos/app_mode/kiosk_app_data.cc @@ -54,7 +54,7 @@ void SaveIconToLocalOnBlockingPool( base::FilePath dir = icon_path.DirName(); if (!base::PathExists(dir)) - CHECK(file_util::CreateDirectory(dir)); + CHECK(base::CreateDirectory(dir)); CHECK_EQ(static_cast<int>(raw_icon->size()), file_util::WriteFile(icon_path, diff --git a/chrome/browser/chromeos/drive/download_handler.cc b/chrome/browser/chromeos/drive/download_handler.cc index 50599c3..c87ca90 100644 --- a/chrome/browser/chromeos/drive/download_handler.cc +++ b/chrome/browser/chromeos/drive/download_handler.cc @@ -56,7 +56,7 @@ DriveUserData* GetDriveUserData(DownloadItem* download) { // operations. base::FilePath GetDriveTempDownloadPath( const base::FilePath& drive_tmp_download_dir) { - bool created = file_util::CreateDirectory(drive_tmp_download_dir); + bool created = base::CreateDirectory(drive_tmp_download_dir); DCHECK(created) << "Can not create temp download directory at " << drive_tmp_download_dir.value(); base::FilePath drive_tmp_download_path; diff --git a/chrome/browser/chromeos/drive/drive_integration_service.cc b/chrome/browser/chromeos/drive/drive_integration_service.cc index 4044de2..3aeae1c 100644 --- a/chrome/browser/chromeos/drive/drive_integration_service.cc +++ b/chrome/browser/chromeos/drive/drive_integration_service.cc @@ -100,11 +100,11 @@ FileError InitializeMetadata( internal::ResourceMetadata* resource_metadata, const ResourceIdCanonicalizer& id_canonicalizer, const base::FilePath& downloads_directory) { - if (!file_util::CreateDirectory(cache_root_directory.Append( + if (!base::CreateDirectory(cache_root_directory.Append( kMetadataDirectory)) || - !file_util::CreateDirectory(cache_root_directory.Append( + !base::CreateDirectory(cache_root_directory.Append( kCacheFileDirectory)) || - !file_util::CreateDirectory(cache_root_directory.Append( + !base::CreateDirectory(cache_root_directory.Append( kTemporaryFileDirectory))) { LOG(WARNING) << "Failed to create directories."; return FILE_ERROR_FAILED; diff --git a/chrome/browser/chromeos/drive/file_cache.cc b/chrome/browser/chromeos/drive/file_cache.cc index 9049eda..bbdcb56 100644 --- a/chrome/browser/chromeos/drive/file_cache.cc +++ b/chrome/browser/chromeos/drive/file_cache.cc @@ -474,7 +474,7 @@ bool FileCache::RecoverFilesFromCacheDirectory( // Add file number to the file name and move. const base::FilePath& dest_path = dest_directory.Append(dest_base_name) .InsertBeforeExtensionASCII(base::StringPrintf("%08d", file_number++)); - if (!file_util::CreateDirectory(dest_directory) || + if (!base::CreateDirectory(dest_directory) || !base::Move(current, dest_path)) { LOG(WARNING) << "Failed to move: " << current.value() << " to " << dest_path.value(); diff --git a/chrome/browser/chromeos/drive/file_cache_unittest.cc b/chrome/browser/chromeos/drive/file_cache_unittest.cc index dd16cf4..41edfaa 100644 --- a/chrome/browser/chromeos/drive/file_cache_unittest.cc +++ b/chrome/browser/chromeos/drive/file_cache_unittest.cc @@ -55,8 +55,8 @@ class FileCacheTestOnUIThread : public testing::Test { const base::FilePath cache_dir = temp_dir_.path().AppendASCII(kCacheFileDirectory); - ASSERT_TRUE(file_util::CreateDirectory(metadata_dir)); - ASSERT_TRUE(file_util::CreateDirectory(cache_dir)); + ASSERT_TRUE(base::CreateDirectory(metadata_dir)); + ASSERT_TRUE(base::CreateDirectory(cache_dir)); ASSERT_TRUE(base::CreateTemporaryFileInDir(temp_dir_.path(), &dummy_file_path_)); @@ -720,8 +720,8 @@ class FileCacheTest : public testing::Test { const base::FilePath metadata_dir = temp_dir_.path().AppendASCII("meta"); cache_files_dir_ = temp_dir_.path().AppendASCII(kCacheFileDirectory); - ASSERT_TRUE(file_util::CreateDirectory(metadata_dir)); - ASSERT_TRUE(file_util::CreateDirectory(cache_files_dir_)); + ASSERT_TRUE(base::CreateDirectory(metadata_dir)); + ASSERT_TRUE(base::CreateDirectory(cache_files_dir_)); fake_free_disk_space_getter_.reset(new FakeFreeDiskSpaceGetter); diff --git a/chrome/browser/chromeos/drive/file_system_unittest.cc b/chrome/browser/chromeos/drive/file_system_unittest.cc index 09d5f85..9f36e46 100644 --- a/chrome/browser/chromeos/drive/file_system_unittest.cc +++ b/chrome/browser/chromeos/drive/file_system_unittest.cc @@ -100,13 +100,13 @@ class FileSystemTest : public testing::Test { void SetUpResourceMetadataAndFileSystem() { const base::FilePath metadata_dir = temp_dir_.path().AppendASCII("meta"); - ASSERT_TRUE(file_util::CreateDirectory(metadata_dir)); + ASSERT_TRUE(base::CreateDirectory(metadata_dir)); metadata_storage_.reset(new internal::ResourceMetadataStorage( metadata_dir, base::MessageLoopProxy::current().get())); ASSERT_TRUE(metadata_storage_->Initialize()); const base::FilePath cache_dir = temp_dir_.path().AppendASCII("files"); - ASSERT_TRUE(file_util::CreateDirectory(cache_dir)); + ASSERT_TRUE(base::CreateDirectory(cache_dir)); cache_.reset(new internal::FileCache( metadata_storage_.get(), cache_dir, @@ -119,7 +119,7 @@ class FileSystemTest : public testing::Test { ASSERT_EQ(FILE_ERROR_OK, resource_metadata_->Initialize()); const base::FilePath temp_file_dir = temp_dir_.path().AppendASCII("tmp"); - ASSERT_TRUE(file_util::CreateDirectory(temp_file_dir)); + ASSERT_TRUE(base::CreateDirectory(temp_file_dir)); file_system_.reset(new FileSystem( pref_service_.get(), cache_.get(), @@ -192,7 +192,7 @@ class FileSystemTest : public testing::Test { resource_metadata_.reset(); const base::FilePath metadata_dir = temp_dir_.path().AppendASCII("meta"); - ASSERT_TRUE(file_util::CreateDirectory(metadata_dir)); + ASSERT_TRUE(base::CreateDirectory(metadata_dir)); scoped_ptr<internal::ResourceMetadataStorage, test_util::DestroyHelperForTests> metadata_storage( new internal::ResourceMetadataStorage( diff --git a/chrome/browser/chromeos/extensions/device_local_account_external_policy_loader_unittest.cc b/chrome/browser/chromeos/extensions/device_local_account_external_policy_loader_unittest.cc index 68281df..9f30f7a 100644 --- a/chrome/browser/chromeos/extensions/device_local_account_external_policy_loader_unittest.cc +++ b/chrome/browser/chromeos/extensions/device_local_account_external_policy_loader_unittest.cc @@ -127,7 +127,7 @@ DeviceLocalAccountExternalPolicyLoaderTest:: void DeviceLocalAccountExternalPolicyLoaderTest::SetUp() { ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); cache_dir_ = temp_dir_.path().Append(kCacheDir); - ASSERT_TRUE(file_util::CreateDirectoryAndGetError(cache_dir_, NULL)); + ASSERT_TRUE(base::CreateDirectoryAndGetError(cache_dir_, NULL)); request_context_getter_ = new net::TestURLRequestContextGetter(base::MessageLoopProxy::current()); TestingBrowserProcess::GetGlobal()->SetSystemRequestContext( diff --git a/chrome/browser/chromeos/extensions/external_cache.cc b/chrome/browser/chromeos/extensions/external_cache.cc index 02a115e..d56d301 100644 --- a/chrome/browser/chromeos/extensions/external_cache.cc +++ b/chrome/browser/chromeos/extensions/external_cache.cc @@ -290,7 +290,7 @@ void ExternalCache::BackendCheckCacheContentsInternal( // Start by verifying that the cache_dir exists. if (!base::DirectoryExists(cache_dir)) { // Create it now. - if (!file_util::CreateDirectory(cache_dir)) { + if (!base::CreateDirectory(cache_dir)) { LOG(ERROR) << "Failed to create ExternalCache directory at " << cache_dir.value(); } @@ -492,7 +492,7 @@ void ExternalCache::BackendInstallCacheEntry( if (!base::DirectoryExists(cache_dir)) { LOG(ERROR) << "AppPack cache directory does not exist, creating now: " << cache_dir.value(); - if (!file_util::CreateDirectory(cache_dir)) { + if (!base::CreateDirectory(cache_dir)) { LOG(ERROR) << "Failed to create the AppPack cache dir!"; base::DeleteFile(path, true /* recursive */); return; diff --git a/chrome/browser/chromeos/extensions/file_manager/file_browser_handler_api_test.cc b/chrome/browser/chromeos/extensions/file_manager/file_browser_handler_api_test.cc index 5386cc7..a8f757e 100644 --- a/chrome/browser/chromeos/extensions/file_manager/file_browser_handler_api_test.cc +++ b/chrome/browser/chromeos/extensions/file_manager/file_browser_handler_api_test.cc @@ -164,7 +164,7 @@ class FileBrowserHandlerExtensionTest : public ExtensionApiTest { // directory with an unique name. ASSERT_TRUE(scoped_tmp_dir_.CreateUniqueTempDir()); tmp_mount_point_ = scoped_tmp_dir_.path().Append("tmp"); - file_util::CreateDirectory(tmp_mount_point_); + base::CreateDirectory(tmp_mount_point_); ExtensionApiTest::SetUp(); } diff --git a/chrome/browser/chromeos/extensions/wallpaper_api.cc b/chrome/browser/chromeos/extensions/wallpaper_api.cc index c08bc5c..c87c398 100644 --- a/chrome/browser/chromeos/extensions/wallpaper_api.cc +++ b/chrome/browser/chromeos/extensions/wallpaper_api.cc @@ -162,7 +162,7 @@ void WallpaperSetWallpaperFunction::GenerateThumbnail( sequence_token_)); chromeos::UserImage wallpaper(*image.get()); if (!base::PathExists(thumbnail_path.DirName())) - file_util::CreateDirectory(thumbnail_path.DirName()); + base::CreateDirectory(thumbnail_path.DirName()); scoped_refptr<base::RefCountedBytes> data; chromeos::WallpaperManager::Get()->ResizeWallpaper( diff --git a/chrome/browser/chromeos/extensions/wallpaper_private_api.cc b/chrome/browser/chromeos/extensions/wallpaper_private_api.cc index 7dac171..f58be4c 100644 --- a/chrome/browser/chromeos/extensions/wallpaper_private_api.cc +++ b/chrome/browser/chromeos/extensions/wallpaper_private_api.cc @@ -66,7 +66,7 @@ bool SaveData(int key, const std::string& file_name, const std::string& data) { base::FilePath data_dir; CHECK(PathService::Get(key, &data_dir)); if (!base::DirectoryExists(data_dir) && - !file_util::CreateDirectory(data_dir)) { + !base::CreateDirectory(data_dir)) { return false; } base::FilePath file_path = data_dir.Append(file_name); @@ -83,7 +83,7 @@ bool SaveData(int key, const std::string& file_name, const std::string& data) { bool GetData(const base::FilePath& path, std::string* data) { base::FilePath data_dir = path.DirName(); if (!base::DirectoryExists(data_dir) && - !file_util::CreateDirectory(data_dir)) + !base::CreateDirectory(data_dir)) return false; return !base::PathExists(path) || @@ -573,7 +573,7 @@ void WallpaperPrivateSetCustomWallpaperFunction::GenerateThumbnail( sequence_token_)); chromeos::UserImage wallpaper(*image.get()); if (!base::PathExists(thumbnail_path.DirName())) - file_util::CreateDirectory(thumbnail_path.DirName()); + base::CreateDirectory(thumbnail_path.DirName()); scoped_refptr<base::RefCountedBytes> data; chromeos::WallpaperManager::Get()->ResizeWallpaper( diff --git a/chrome/browser/chromeos/file_manager/external_filesystem_apitest.cc b/chrome/browser/chromeos/file_manager/external_filesystem_apitest.cc index 561aba3..74c23204 100644 --- a/chrome/browser/chromeos/file_manager/external_filesystem_apitest.cc +++ b/chrome/browser/chromeos/file_manager/external_filesystem_apitest.cc @@ -88,19 +88,19 @@ bool InitializeLocalFileSystem(base::ScopedTempDir* tmp_dir, *mount_point_dir = tmp_dir->path().AppendASCII("mount"); // Create the mount point. - if (!file_util::CreateDirectory(*mount_point_dir)) + if (!base::CreateDirectory(*mount_point_dir)) return false; base::FilePath test_dir = mount_point_dir->AppendASCII("test_dir"); - if (!file_util::CreateDirectory(test_dir)) + if (!base::CreateDirectory(test_dir)) return false; base::FilePath test_subdir = test_dir.AppendASCII("empty_test_dir"); - if (!file_util::CreateDirectory(test_subdir)) + if (!base::CreateDirectory(test_subdir)) return false; test_subdir = test_dir.AppendASCII("subdir"); - if (!file_util::CreateDirectory(test_subdir)) + if (!base::CreateDirectory(test_subdir)) return false; base::FilePath test_file = test_dir.AppendASCII("test_file.xul"); diff --git a/chrome/browser/chromeos/file_manager/file_manager_browsertest.cc b/chrome/browser/chromeos/file_manager/file_manager_browsertest.cc index 7be96c2..f9ccdbf 100644 --- a/chrome/browser/chromeos/file_manager/file_manager_browsertest.cc +++ b/chrome/browser/chromeos/file_manager/file_manager_browsertest.cc @@ -205,7 +205,7 @@ class LocalTestVolume { return mount_points->RegisterFileSystem( kDownloads, fileapi::kFileSystemTypeNativeLocal, local_path_) && - file_util::CreateDirectory(local_path_); + base::CreateDirectory(local_path_); } void CreateEntry(const TestEntryInfo& entry) { @@ -224,7 +224,7 @@ class LocalTestVolume { break; } case DIRECTORY: - ASSERT_TRUE(file_util::CreateDirectory(target_path)) << + ASSERT_TRUE(base::CreateDirectory(target_path)) << "Failed to create a directory: " << target_path.value(); break; } diff --git a/chrome/browser/chromeos/imageburner/burn_manager.cc b/chrome/browser/chromeos/imageburner/burn_manager.cc index de6f7f6..0a5e84b 100644 --- a/chrome/browser/chromeos/imageburner/burn_manager.cc +++ b/chrome/browser/chromeos/imageburner/burn_manager.cc @@ -40,7 +40,7 @@ BurnManager* g_burn_manager = NULL; // Cretes a directory and calls |callback| with the result on UI thread. void CreateDirectory(const base::FilePath& path, base::Callback<void(bool success)> callback) { - const bool success = file_util::CreateDirectory(path); + const bool success = base::CreateDirectory(path); BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, base::Bind(callback, success)); } diff --git a/chrome/browser/chromeos/login/managed/locally_managed_user_creation_controller.cc b/chrome/browser/chromeos/login/managed/locally_managed_user_creation_controller.cc index f8fc7af..80006dc 100644 --- a/chrome/browser/chromeos/login/managed/locally_managed_user_creation_controller.cc +++ b/chrome/browser/chromeos/login/managed/locally_managed_user_creation_controller.cc @@ -39,7 +39,7 @@ bool StoreManagedUserFiles(const std::string& token, const base::FilePath& base_path) { if (!base::SysInfo::IsRunningOnChromeOS()) { // If running on desktop, cryptohome stub does not create home directory. - file_util::CreateDirectory(base_path); + base::CreateDirectory(base_path); } base::FilePath token_file = base_path.Append(kManagedUserTokenFilename); int bytes = file_util::WriteFile(token_file, token.c_str(), token.length()); diff --git a/chrome/browser/chromeos/login/wallpaper_manager.cc b/chrome/browser/chromeos/login/wallpaper_manager.cc index f838f6f..6043f13 100644 --- a/chrome/browser/chromeos/login/wallpaper_manager.cc +++ b/chrome/browser/chromeos/login/wallpaper_manager.cc @@ -741,19 +741,19 @@ void WallpaperManager::EnsureCustomWallpaperDirectories( dir = GetCustomWallpaperDir(kSmallWallpaperSubDir); dir = dir.Append(user_id_hash); if (!base::PathExists(dir)) - file_util::CreateDirectory(dir); + base::CreateDirectory(dir); dir = GetCustomWallpaperDir(kLargeWallpaperSubDir); dir = dir.Append(user_id_hash); if (!base::PathExists(dir)) - file_util::CreateDirectory(dir); + base::CreateDirectory(dir); dir = GetCustomWallpaperDir(kOriginalWallpaperSubDir); dir = dir.Append(user_id_hash); if (!base::PathExists(dir)) - file_util::CreateDirectory(dir); + base::CreateDirectory(dir); dir = GetCustomWallpaperDir(kThumbnailWallpaperSubDir); dir = dir.Append(user_id_hash); if (!base::PathExists(dir)) - file_util::CreateDirectory(dir); + base::CreateDirectory(dir); } CommandLine* WallpaperManager::GetComandLine() { diff --git a/chrome/browser/chromeos/login/wallpaper_manager_browsertest.cc b/chrome/browser/chromeos/login/wallpaper_manager_browsertest.cc index 55c10b7..191d992 100644 --- a/chrome/browser/chromeos/login/wallpaper_manager_browsertest.cc +++ b/chrome/browser/chromeos/login/wallpaper_manager_browsertest.cc @@ -103,7 +103,7 @@ class WallpaperManagerBrowserTest : public InProcessBrowserTest, username_hash, id); if (!base::DirectoryExists(wallpaper_path.DirName())) - file_util::CreateDirectory(wallpaper_path.DirName()); + base::CreateDirectory(wallpaper_path.DirName()); return wallpaper_path; } diff --git a/chrome/browser/chromeos/policy/device_local_account_browsertest.cc b/chrome/browser/chromeos/policy/device_local_account_browsertest.cc index b01837f..a95e225 100644 --- a/chrome/browser/chromeos/policy/device_local_account_browsertest.cc +++ b/chrome/browser/chromeos/policy/device_local_account_browsertest.cc @@ -723,7 +723,7 @@ IN_PROC_BROWSER_TEST_F(DeviceLocalAccountTest, ExtensionsCached) { // Pre-populate the device local account's extension cache with a hosted app // and an extension. - EXPECT_TRUE(file_util::CreateDirectory( + EXPECT_TRUE(base::CreateDirectory( GetCacheDirectoryForAccountID(kAccountId1))); base::FilePath test_dir; ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &test_dir)); diff --git a/chrome/browser/chromeos/policy/device_local_account_policy_service_unittest.cc b/chrome/browser/chromeos/policy/device_local_account_policy_service_unittest.cc index b5d9a6e..877fdb9 100644 --- a/chrome/browser/chromeos/policy/device_local_account_policy_service_unittest.cc +++ b/chrome/browser/chromeos/policy/device_local_account_policy_service_unittest.cc @@ -549,12 +549,12 @@ TEST_F(DeviceLocalAccountPolicyExtensionCacheTest, Startup) { base::StringPrintf("%s-%s.crx", kExtensionID, kExtensionVersion); // Create and pre-populate a cache directory for account 1. - EXPECT_TRUE(file_util::CreateDirectory(cache_dir_1_)); + EXPECT_TRUE(base::CreateDirectory(cache_dir_1_)); EXPECT_TRUE(CopyFile(source_crx_file, cache_dir_1_.Append(target_crx_file_name))); // Create and pre-populate a cache directory for account 3. - EXPECT_TRUE(file_util::CreateDirectory(cache_dir_3_)); + EXPECT_TRUE(base::CreateDirectory(cache_dir_3_)); EXPECT_TRUE(CopyFile(source_crx_file, cache_dir_3_.Append(target_crx_file_name))); diff --git a/chrome/browser/chromeos/policy/power_policy_browsertest.cc b/chrome/browser/chromeos/policy/power_policy_browsertest.cc index bf58e1a..451b99b 100644 --- a/chrome/browser/chromeos/policy/power_policy_browsertest.cc +++ b/chrome/browser/chromeos/policy/power_policy_browsertest.cc @@ -181,7 +181,7 @@ void PowerPolicyBrowserTestBase::InstallUserKey() { .AppendASCII("policy.pub"); std::vector<uint8> user_key_bits; ASSERT_TRUE(user_policy_.GetSigningKey()->ExportPublicKey(&user_key_bits)); - ASSERT_TRUE(file_util::CreateDirectory(user_key_file.DirName())); + ASSERT_TRUE(base::CreateDirectory(user_key_file.DirName())); ASSERT_EQ(file_util::WriteFile( user_key_file, reinterpret_cast<const char*>(user_key_bits.data()), diff --git a/chrome/browser/chromeos/policy/user_cloud_policy_store_chromeos_unittest.cc b/chrome/browser/chromeos/policy/user_cloud_policy_store_chromeos_unittest.cc index 0f5ab74..7f0694a 100644 --- a/chrome/browser/chromeos/policy/user_cloud_policy_store_chromeos_unittest.cc +++ b/chrome/browser/chromeos/policy/user_cloud_policy_store_chromeos_unittest.cc @@ -125,7 +125,7 @@ class UserCloudPolicyStoreChromeOSTest : public testing::Test { } void StoreUserPolicyKey(const std::vector<uint8>& public_key) { - ASSERT_TRUE(file_util::CreateDirectory(user_policy_key_file().DirName())); + ASSERT_TRUE(base::CreateDirectory(user_policy_key_file().DirName())); ASSERT_TRUE( file_util::WriteFile(user_policy_key_file(), reinterpret_cast<const char*>(public_key.data()), diff --git a/chrome/browser/chromeos/policy/user_policy_disk_cache.cc b/chrome/browser/chromeos/policy/user_policy_disk_cache.cc index d22cddf..e6a669b 100644 --- a/chrome/browser/chromeos/policy/user_policy_disk_cache.cc +++ b/chrome/browser/chromeos/policy/user_policy_disk_cache.cc @@ -121,7 +121,7 @@ void UserPolicyDiskCache::StoreOnFileThread( return; } - if (!file_util::CreateDirectory(backing_file_path_.DirName())) { + if (!base::CreateDirectory(backing_file_path_.DirName())) { LOG(WARNING) << "Failed to create directory " << backing_file_path_.DirName().value(); UMA_HISTOGRAM_ENUMERATION(policy::kMetricPolicy, diff --git a/chrome/browser/component_updater/component_patcher_operation.cc b/chrome/browser/component_updater/component_patcher_operation.cc index 3f5f46a..3f81440 100644 --- a/chrome/browser/component_updater/component_patcher_operation.cc +++ b/chrome/browser/component_updater/component_patcher_operation.cc @@ -73,7 +73,7 @@ ComponentUnpacker::Error DeltaUpdateOp::Run(base::DictionaryValue* command_args, const base::FilePath parent = output_abs_path_.DirName(); if (!base::DirectoryExists(parent)) { - if (!file_util::CreateDirectory(parent)) + if (!base::CreateDirectory(parent)) return ComponentUnpacker::kIoError; } diff --git a/chrome/browser/component_updater/default_component_installer.cc b/chrome/browser/component_updater/default_component_installer.cc index d1b699b..fb478711 100644 --- a/chrome/browser/component_updater/default_component_installer.cc +++ b/chrome/browser/component_updater/default_component_installer.cc @@ -112,7 +112,7 @@ void DefaultComponentInstaller::StartRegistration( ComponentUpdateService* cus) { base::FilePath base_dir = installer_traits_->GetBaseDirectory(); if (!base::PathExists(base_dir) && - !file_util::CreateDirectory(base_dir)) { + !base::CreateDirectory(base_dir)) { NOTREACHED() << "Could not create the base directory for " << installer_traits_->GetName() << " (" << base_dir.MaybeAsASCII() << ")."; diff --git a/chrome/browser/component_updater/pepper_flash_component_installer.cc b/chrome/browser/component_updater/pepper_flash_component_installer.cc index 01a9da8..f91af27 100644 --- a/chrome/browser/component_updater/pepper_flash_component_installer.cc +++ b/chrome/browser/component_updater/pepper_flash_component_installer.cc @@ -363,7 +363,7 @@ void StartPepperFlashUpdateRegistration(ComponentUpdateService* cus) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); base::FilePath path = GetPepperFlashBaseDirectory(); if (!base::PathExists(path)) { - if (!file_util::CreateDirectory(path)) { + if (!base::CreateDirectory(path)) { NOTREACHED() << "Could not create Pepper Flash directory."; return; } diff --git a/chrome/browser/component_updater/pnacl/pnacl_component_installer.cc b/chrome/browser/component_updater/pnacl/pnacl_component_installer.cc index ae7a138..c90a0d9 100644 --- a/chrome/browser/component_updater/pnacl/pnacl_component_installer.cc +++ b/chrome/browser/component_updater/pnacl/pnacl_component_installer.cc @@ -325,7 +325,7 @@ void StartPnaclUpdateRegistration(PnaclComponentInstaller* pci) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); base::FilePath path = pci->GetPnaclBaseDirectory(); if (!base::PathExists(path)) { - if (!file_util::CreateDirectory(path)) { + if (!base::CreateDirectory(path)) { NOTREACHED() << "Could not create base Pnacl directory."; return; } diff --git a/chrome/browser/component_updater/swiftshader_component_installer.cc b/chrome/browser/component_updater/swiftshader_component_installer.cc index 110c0e9..038c294 100644 --- a/chrome/browser/component_updater/swiftshader_component_installer.cc +++ b/chrome/browser/component_updater/swiftshader_component_installer.cc @@ -209,7 +209,7 @@ void RegisterSwiftShaderPath(ComponentUpdateService* cus) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); base::FilePath path = GetSwiftShaderBaseDirectory(); if (!base::PathExists(path)) { - if (!file_util::CreateDirectory(path)) { + if (!base::CreateDirectory(path)) { NOTREACHED() << "Could not create SwiftShader directory."; return; } diff --git a/chrome/browser/component_updater/test/test_installer.cc b/chrome/browser/component_updater/test/test_installer.cc index f379b6f..62ae494 100644 --- a/chrome/browser/component_updater/test/test_installer.cc +++ b/chrome/browser/component_updater/test/test_installer.cc @@ -63,7 +63,7 @@ bool VersionedTestInstaller::Install(const base::DictionaryValue& manifest, base::FilePath path; path = install_directory_.AppendASCII(version.GetString()); - file_util::CreateDirectory(path.DirName()); + base::CreateDirectory(path.DirName()); if (!base::Move(unpack_path, path)) return false; current_version_ = version; diff --git a/chrome/browser/download/download_browsertest.cc b/chrome/browser/download/download_browsertest.cc index 1da3556..db477ee 100644 --- a/chrome/browser/download/download_browsertest.cc +++ b/chrome/browser/download/download_browsertest.cc @@ -2894,7 +2894,7 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, DownloadTest_CrazyFilenames) { static const int kFlags = (base::PLATFORM_FILE_CREATE | base::PLATFORM_FILE_WRITE); base::FilePath origin(FILE_PATH_LITERAL("origin")); - ASSERT_TRUE(file_util::CreateDirectory(DestinationFile(browser(), origin))); + ASSERT_TRUE(base::CreateDirectory(DestinationFile(browser(), origin))); for (size_t index = 0; index < arraysize(kCrazyFilenames); ++index) { string16 crazy16; diff --git a/chrome/browser/download/download_path_reservation_tracker.cc b/chrome/browser/download/download_path_reservation_tracker.cc index 28c3990..18ef800 100644 --- a/chrome/browser/download/download_path_reservation_tracker.cc +++ b/chrome/browser/download/download_path_reservation_tracker.cc @@ -183,7 +183,7 @@ void CreateReservation( (create_directory || (!default_download_path.empty() && (default_download_path == target_dir)))) { - file_util::CreateDirectory(target_dir); + base::CreateDirectory(target_dir); } // Check writability of the suggested path. If we can't write to it, default diff --git a/chrome/browser/download/download_prefs.cc b/chrome/browser/download/download_prefs.cc index 2514d7e..c781121 100644 --- a/chrome/browser/download/download_prefs.cc +++ b/chrome/browser/download/download_prefs.cc @@ -172,7 +172,7 @@ void DownloadPrefs::RegisterProfilePrefs( // Ensure that the download directory specified in the preferences exists. BrowserThread::PostTask( BrowserThread::FILE, FROM_HERE, - base::Bind(base::IgnoreResult(&file_util::CreateDirectory), + base::Bind(base::IgnoreResult(&base::CreateDirectory), default_download_path)); #endif // defined(OS_CHROMEOS) } 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 6c65d1e..79817f1 100644 --- a/chrome/browser/extensions/api/developer_private/developer_private_api.cc +++ b/chrome/browser/extensions/api/developer_private/developer_private_api.cc @@ -1093,7 +1093,7 @@ void DeveloperPrivateExportSyncfsFolderToLocalfsFunction::SnapshotFileCallback( void DeveloperPrivateExportSyncfsFolderToLocalfsFunction::CopyFile( const base::FilePath& src_path, const base::FilePath& target_path) { - if (!file_util::CreateDirectory(target_path.DirName())) { + if (!base::CreateDirectory(target_path.DirName())) { SetError("Error in copying files from sync filesystem."); success_ = false; } 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 762b515..a6b2069 100644 --- a/chrome/browser/extensions/api/file_system/file_system_apitest.cc +++ b/chrome/browser/extensions/api/file_system/file_system_apitest.cc @@ -178,7 +178,7 @@ IN_PROC_BROWSER_TEST_F(FileSystemApiTest, FileSystemApiGetDisplayPathPrettifyMac) { // On Mac, "test.localized" will be localized into just "test". base::FilePath test_path = TempFilePath("test.localized", false); - ASSERT_TRUE(file_util::CreateDirectory(test_path)); + ASSERT_TRUE(base::CreateDirectory(test_path)); base::FilePath test_file = test_path.AppendASCII("gold.txt"); base::FilePath source = test_root_folder_.AppendASCII("gold.txt"); diff --git a/chrome/browser/extensions/api/media_galleries/media_galleries_apitest.cc b/chrome/browser/extensions/api/media_galleries/media_galleries_apitest.cc index f8a03d8..a048d1f 100644 --- a/chrome/browser/extensions/api/media_galleries/media_galleries_apitest.cc +++ b/chrome/browser/extensions/api/media_galleries/media_galleries_apitest.cc @@ -166,16 +166,16 @@ class MediaGalleriesPlatformAppBrowserTest : public PlatformAppBrowserTest { picasa::MakePicasaDatabasePath(picasa_app_data_root); base::FilePath picasa_temp_dir_path = picasa_database_path.DirName().AppendASCII(picasa::kPicasaTempDirName); - ASSERT_TRUE(file_util::CreateDirectory(picasa_database_path)); - ASSERT_TRUE(file_util::CreateDirectory(picasa_temp_dir_path)); + ASSERT_TRUE(base::CreateDirectory(picasa_database_path)); + ASSERT_TRUE(base::CreateDirectory(picasa_temp_dir_path)); // Create fake folder directories. base::FilePath folders_root = ensure_media_directories_exists_->GetFakePicasaFoldersRootPath(); base::FilePath fake_folder_1 = folders_root.AppendASCII("folder1"); base::FilePath fake_folder_2 = folders_root.AppendASCII("folder2"); - ASSERT_TRUE(file_util::CreateDirectory(fake_folder_1)); - ASSERT_TRUE(file_util::CreateDirectory(fake_folder_2)); + ASSERT_TRUE(base::CreateDirectory(fake_folder_1)); + ASSERT_TRUE(base::CreateDirectory(fake_folder_2)); // Write folder and album contents. picasa::WriteTestAlbumTable( diff --git a/chrome/browser/extensions/api/sessions/sessions_apitest.cc b/chrome/browser/extensions/api/sessions/sessions_apitest.cc index 92326af..276a338 100644 --- a/chrome/browser/extensions/api/sessions/sessions_apitest.cc +++ b/chrome/browser/extensions/api/sessions/sessions_apitest.cc @@ -104,7 +104,7 @@ void ExtensionSessionsTest::CreateTestProfileSyncService() { PathService::Get(chrome::DIR_USER_DATA, &path); path = path.AppendASCII("test_profile"); if (!base::PathExists(path)) - CHECK(file_util::CreateDirectory(path)); + CHECK(base::CreateDirectory(path)); Profile* profile = Profile::CreateProfile(path, NULL, Profile::CREATE_MODE_SYNCHRONOUS); profile_manager->RegisterTestingProfile(profile, true, false); diff --git a/chrome/browser/extensions/convert_web_app.cc b/chrome/browser/extensions/convert_web_app.cc index 155181d..f150fa5 100644 --- a/chrome/browser/extensions/convert_web_app.cc +++ b/chrome/browser/extensions/convert_web_app.cc @@ -153,7 +153,7 @@ scoped_refptr<Extension> ConvertWebAppToExtension( // Write the icon files. base::FilePath icons_dir = temp_dir.path().AppendASCII(kIconsDirName); - if (!file_util::CreateDirectory(icons_dir)) { + if (!base::CreateDirectory(icons_dir)) { LOG(ERROR) << "Could not create icons directory."; return NULL; } diff --git a/chrome/browser/extensions/extension_creator_filter_unittest.cc b/chrome/browser/extensions/extension_creator_filter_unittest.cc index bcb8117..bdaf793 100644 --- a/chrome/browser/extensions/extension_creator_filter_unittest.cc +++ b/chrome/browser/extensions/extension_creator_filter_unittest.cc @@ -35,7 +35,7 @@ class ExtensionCreatorFilterTest : public PlatformTest { const base::FilePath::StringType& dir) { base::FilePath temp_sub_dir(test_dir_.Append(dir)); base::FilePath test_file(temp_sub_dir.Append(file_name)); - EXPECT_TRUE(file_util::CreateDirectory(temp_sub_dir)); + EXPECT_TRUE(base::CreateDirectory(temp_sub_dir)); base::FilePath temp_file; EXPECT_TRUE(base::CreateTemporaryFileInDir(temp_sub_dir, &temp_file)); EXPECT_TRUE(base::Move(temp_file, test_file)); diff --git a/chrome/browser/extensions/extension_service_unittest.cc b/chrome/browser/extensions/extension_service_unittest.cc index 73252df..70d2121 100644 --- a/chrome/browser/extensions/extension_service_unittest.cc +++ b/chrome/browser/extensions/extension_service_unittest.cc @@ -559,7 +559,7 @@ void ExtensionServiceTestBase::InitializeInstalledExtensionService( path = path.Append(FILE_PATH_LITERAL("TestingExtensionsPath")); EXPECT_TRUE(base::DeleteFile(path, true)); base::PlatformFileError error = base::PLATFORM_FILE_OK; - EXPECT_TRUE(file_util::CreateDirectoryAndGetError(path, &error)) << error; + EXPECT_TRUE(base::CreateDirectoryAndGetError(path, &error)) << error; base::FilePath temp_prefs = path.Append(FILE_PATH_LITERAL("Preferences")); EXPECT_TRUE(base::CopyFile(prefs_file, temp_prefs)); @@ -637,14 +637,14 @@ ExtensionServiceTestBase::CreateDefaultInitParamsInTempDir( path = path.Append(FILE_PATH_LITERAL("TestingExtensionsPath")); EXPECT_TRUE(base::DeleteFile(path, true)); base::PlatformFileError error = base::PLATFORM_FILE_OK; - EXPECT_TRUE(file_util::CreateDirectoryAndGetError(path, &error)) << error; + EXPECT_TRUE(base::CreateDirectoryAndGetError(path, &error)) << error; base::FilePath prefs_filename = path.Append(FILE_PATH_LITERAL("TestPreferences")); base::FilePath extensions_install_dir = path.Append(FILE_PATH_LITERAL("Extensions")); EXPECT_TRUE(base::DeleteFile(extensions_install_dir, true)); - EXPECT_TRUE(file_util::CreateDirectoryAndGetError(extensions_install_dir, - &error)) << error; + EXPECT_TRUE(base::CreateDirectoryAndGetError(extensions_install_dir, + &error)) << error; params.profile_path = path; params.pref_file = prefs_filename; @@ -4282,7 +4282,7 @@ TEST_F(ExtensionServiceTest, ClearExtensionData) { profile_->GetPath().AppendASCII("Local Storage"); base::FilePath lso_file_path = lso_dir_path.AppendASCII(origin_id) .AddExtension(FILE_PATH_LITERAL(".localstorage")); - EXPECT_TRUE(file_util::CreateDirectory(lso_dir_path)); + EXPECT_TRUE(base::CreateDirectory(lso_dir_path)); EXPECT_EQ(0, file_util::WriteFile(lso_file_path, NULL, 0)); EXPECT_TRUE(base::PathExists(lso_file_path)); @@ -4294,7 +4294,7 @@ TEST_F(ExtensionServiceTest, ClearExtensionData) { idb_context->SetTaskRunnerForTesting( base::MessageLoop::current()->message_loop_proxy().get()); base::FilePath idb_path = idb_context->GetFilePathForTesting(origin_id); - EXPECT_TRUE(file_util::CreateDirectory(idb_path)); + EXPECT_TRUE(base::CreateDirectory(idb_path)); EXPECT_TRUE(base::DirectoryExists(idb_path)); // Uninstall the extension. @@ -4398,7 +4398,7 @@ TEST_F(ExtensionServiceTest, ClearAppData) { profile_->GetPath().AppendASCII("Local Storage"); base::FilePath lso_file_path = lso_dir_path.AppendASCII(origin_id) .AddExtension(FILE_PATH_LITERAL(".localstorage")); - EXPECT_TRUE(file_util::CreateDirectory(lso_dir_path)); + EXPECT_TRUE(base::CreateDirectory(lso_dir_path)); EXPECT_EQ(0, file_util::WriteFile(lso_file_path, NULL, 0)); EXPECT_TRUE(base::PathExists(lso_file_path)); @@ -4410,7 +4410,7 @@ TEST_F(ExtensionServiceTest, ClearAppData) { idb_context->SetTaskRunnerForTesting( base::MessageLoop::current()->message_loop_proxy().get()); base::FilePath idb_path = idb_context->GetFilePathForTesting(origin_id); - EXPECT_TRUE(file_util::CreateDirectory(idb_path)); + EXPECT_TRUE(base::CreateDirectory(idb_path)); EXPECT_TRUE(base::DirectoryExists(idb_path)); // Uninstall one of them, unlimited storage should still be granted diff --git a/chrome/browser/extensions/extension_startup_browsertest.cc b/chrome/browser/extensions/extension_startup_browsertest.cc index d21eab8..0a2f31a 100644 --- a/chrome/browser/extensions/extension_startup_browsertest.cc +++ b/chrome/browser/extensions/extension_startup_browsertest.cc @@ -60,7 +60,7 @@ class ExtensionStartupTestBase : public InProcessBrowserTest { base::FilePath profile_dir; PathService::Get(chrome::DIR_USER_DATA, &profile_dir); profile_dir = profile_dir.AppendASCII(TestingProfile::kTestUserProfileDir); - file_util::CreateDirectory(profile_dir); + base::CreateDirectory(profile_dir); preferences_file_ = profile_dir.AppendASCII("Preferences"); user_scripts_dir_ = profile_dir.AppendASCII("User Scripts"); diff --git a/chrome/browser/extensions/test_extension_prefs.cc b/chrome/browser/extensions/test_extension_prefs.cc index 4f3b268..c14320c 100644 --- a/chrome/browser/extensions/test_extension_prefs.cc +++ b/chrome/browser/extensions/test_extension_prefs.cc @@ -63,7 +63,7 @@ TestExtensionPrefs::TestExtensionPrefs(base::SequencedTaskRunner* task_runner) EXPECT_TRUE(temp_dir_.CreateUniqueTempDir()); preferences_file_ = temp_dir_.path().AppendASCII("Preferences"); extensions_dir_ = temp_dir_.path().AppendASCII("Extensions"); - EXPECT_TRUE(file_util::CreateDirectory(extensions_dir_)); + EXPECT_TRUE(base::CreateDirectory(extensions_dir_)); ResetPrefRegistry(); RecreateExtensionPrefs(); diff --git a/chrome/browser/extensions/webstore_installer.cc b/chrome/browser/extensions/webstore_installer.cc index 75e0839..a2e98d9 100644 --- a/chrome/browser/extensions/webstore_installer.cc +++ b/chrome/browser/extensions/webstore_installer.cc @@ -109,7 +109,7 @@ void GetDownloadFilePath( // Ensure the download directory exists. TODO(asargent) - make this use // common code from the downloads system. if (!base::DirectoryExists(directory)) { - if (!file_util::CreateDirectory(directory)) { + if (!base::CreateDirectory(directory)) { BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, base::Bind(callback, base::FilePath())); return; diff --git a/chrome/browser/first_run/first_run.cc b/chrome/browser/first_run/first_run.cc index 75401cb..4d59158 100644 --- a/chrome/browser/first_run/first_run.cc +++ b/chrome/browser/first_run/first_run.cc @@ -175,7 +175,7 @@ base::FilePath GetDefaultPrefFilePath(bool create_profile_dir, profiles::GetDefaultProfileDir(user_data_dir); if (create_profile_dir) { if (!base::PathExists(default_pref_dir)) { - if (!file_util::CreateDirectory(default_pref_dir)) + if (!base::CreateDirectory(default_pref_dir)) return base::FilePath(); } } diff --git a/chrome/browser/first_run/first_run_internal_win.cc b/chrome/browser/first_run/first_run_internal_win.cc index b63e30f..71e92ce 100644 --- a/chrome/browser/first_run/first_run_internal_win.cc +++ b/chrome/browser/first_run/first_run_internal_win.cc @@ -136,7 +136,7 @@ bool CreateEULASentinel() { if (!GetEULASentinelFilePath(&eula_sentinel)) return false; - return (file_util::CreateDirectory(eula_sentinel.DirName()) && + return (base::CreateDirectory(eula_sentinel.DirName()) && file_util::WriteFile(eula_sentinel, "", 0) != -1); } diff --git a/chrome/browser/history/history_backend_unittest.cc b/chrome/browser/history/history_backend_unittest.cc index 6a65542..5d01cf1 100644 --- a/chrome/browser/history/history_backend_unittest.cc +++ b/chrome/browser/history/history_backend_unittest.cc @@ -1208,7 +1208,7 @@ TEST_F(HistoryBackendTest, MigrationVisitSource) { // in Teardown. base::FilePath new_history_path(getTestDir()); base::DeleteFile(new_history_path, true); - file_util::CreateDirectory(new_history_path); + base::CreateDirectory(new_history_path); base::FilePath new_history_file = new_history_path.Append(chrome::kHistoryFilename); ASSERT_TRUE(base::CopyFile(old_history_path, new_history_file)); @@ -2556,7 +2556,7 @@ TEST_F(HistoryBackendTest, MigrationVisitDuration) { // in Teardown. base::FilePath new_history_path(getTestDir()); base::DeleteFile(new_history_path, true); - file_util::CreateDirectory(new_history_path); + base::CreateDirectory(new_history_path); base::FilePath new_history_file = new_history_path.Append(chrome::kHistoryFilename); base::FilePath new_archived_file = diff --git a/chrome/browser/history/history_querying_unittest.cc b/chrome/browser/history/history_querying_unittest.cc index ad018b5..c0ea369 100644 --- a/chrome/browser/history/history_querying_unittest.cc +++ b/chrome/browser/history/history_querying_unittest.cc @@ -159,7 +159,7 @@ class HistoryQueryTest : public testing::Test { virtual void SetUp() { ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); history_dir_ = temp_dir_.path().AppendASCII("HistoryTest"); - ASSERT_TRUE(file_util::CreateDirectory(history_dir_)); + ASSERT_TRUE(base::CreateDirectory(history_dir_)); history_.reset(new HistoryService); if (!history_->Init(history_dir_, NULL)) { diff --git a/chrome/browser/history/history_unittest.cc b/chrome/browser/history/history_unittest.cc index 67f1e50..d8b5e80 100644 --- a/chrome/browser/history/history_unittest.cc +++ b/chrome/browser/history/history_unittest.cc @@ -140,7 +140,7 @@ class HistoryBackendDBTest : public HistoryUnitTestBase { virtual void SetUp() { ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); history_dir_ = temp_dir_.path().AppendASCII("HistoryBackendDBTest"); - ASSERT_TRUE(file_util::CreateDirectory(history_dir_)); + ASSERT_TRUE(base::CreateDirectory(history_dir_)); } void DeleteBackend() { @@ -912,7 +912,7 @@ class HistoryTest : public testing::Test { virtual void SetUp() { ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); history_dir_ = temp_dir_.path().AppendASCII("HistoryTest"); - ASSERT_TRUE(file_util::CreateDirectory(history_dir_)); + ASSERT_TRUE(base::CreateDirectory(history_dir_)); history_service_.reset(new HistoryService); if (!history_service_->Init(history_dir_, NULL)) { history_service_.reset(); diff --git a/chrome/browser/importer/firefox_importer_browsertest.cc b/chrome/browser/importer/firefox_importer_browsertest.cc index e623e36..3e3adb2 100644 --- a/chrome/browser/importer/firefox_importer_browsertest.cc +++ b/chrome/browser/importer/firefox_importer_browsertest.cc @@ -216,10 +216,10 @@ class FirefoxProfileImporterBrowserTest : public InProcessBrowserTest { ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); base::FilePath test_path = temp_dir_.path().AppendASCII("ImporterTest"); base::DeleteFile(test_path, true); - file_util::CreateDirectory(test_path); + base::CreateDirectory(test_path); profile_path_ = test_path.AppendASCII("profile"); app_path_ = test_path.AppendASCII("app"); - file_util::CreateDirectory(app_path_); + base::CreateDirectory(app_path_); // This will launch the browser test and thus needs to happen last. InProcessBrowserTest::SetUp(); @@ -240,7 +240,7 @@ class FirefoxProfileImporterBrowserTest : public InProcessBrowserTest { base::FilePath search_engine_path = app_path_; search_engine_path = search_engine_path.AppendASCII("searchplugins"); - file_util::CreateDirectory(search_engine_path); + base::CreateDirectory(search_engine_path); if (import_search_plugins) { ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &data_path)); data_path = data_path.AppendASCII("firefox3_searchplugins"); diff --git a/chrome/browser/jumplist_win.cc b/chrome/browser/jumplist_win.cc index a4991ce..8d9c158 100644 --- a/chrome/browser/jumplist_win.cc +++ b/chrome/browser/jumplist_win.cc @@ -737,7 +737,7 @@ void JumpList::RunUpdate() { if (base::PathExists(icon_dir_old)) base::DeleteFile(icon_dir_old, true); base::Move(icon_dir_, icon_dir_old); - file_util::CreateDirectory(icon_dir_); + base::CreateDirectory(icon_dir_); // Create temporary icon files for shortcuts in the "Most Visited" category. CreateIconFiles(local_most_visited_pages); diff --git a/chrome/browser/lifetime/browser_close_manager_browsertest.cc b/chrome/browser/lifetime/browser_close_manager_browsertest.cc index bb4085f..c6ba1ce 100644 --- a/chrome/browser/lifetime/browser_close_manager_browsertest.cc +++ b/chrome/browser/lifetime/browser_close_manager_browsertest.cc @@ -772,7 +772,7 @@ IN_PROC_BROWSER_TEST_P(BrowserCloseManagerBrowserTest, base::FilePath path = profile_manager->user_data_dir().AppendASCII("test_profile"); if (!base::PathExists(path)) - ASSERT_TRUE(file_util::CreateDirectory(path)); + ASSERT_TRUE(base::CreateDirectory(path)); Profile* other_profile = Profile::CreateProfile(path, NULL, Profile::CREATE_MODE_SYNCHRONOUS); profile_manager->RegisterTestingProfile(other_profile, true, false); diff --git a/chrome/browser/media_galleries/fileapi/device_media_async_file_util.cc b/chrome/browser/media_galleries/fileapi/device_media_async_file_util.cc index 5087660..41b516b 100644 --- a/chrome/browser/media_galleries/fileapi/device_media_async_file_util.cc +++ b/chrome/browser/media_galleries/fileapi/device_media_async_file_util.cc @@ -45,7 +45,7 @@ void CreateSnapshotFileOnBlockingPool( DCHECK(snapshot_file_path); base::FilePath isolated_media_file_system_dir_path = profile_path.AppendASCII(kDeviceMediaAsyncFileUtilTempDir); - if (!file_util::CreateDirectory(isolated_media_file_system_dir_path) || + if (!base::CreateDirectory(isolated_media_file_system_dir_path) || !base::CreateTemporaryFileInDir(isolated_media_file_system_dir_path, snapshot_file_path)) { LOG(WARNING) << "Could not create media snapshot file " diff --git a/chrome/browser/media_galleries/fileapi/iapps_finder_impl_win_browsertest.cc b/chrome/browser/media_galleries/fileapi/iapps_finder_impl_win_browsertest.cc index 505a003..903d0f7 100644 --- a/chrome/browser/media_galleries/fileapi/iapps_finder_impl_win_browsertest.cc +++ b/chrome/browser/media_galleries/fileapi/iapps_finder_impl_win_browsertest.cc @@ -61,7 +61,7 @@ class ITunesFinderWinTest : public InProcessBrowserTest { void WritePrefFile(const std::string& data) { base::FilePath pref_dir = app_data_dir().AppendASCII("Apple Computer").AppendASCII("iTunes"); - ASSERT_TRUE(file_util::CreateDirectory(pref_dir)); + ASSERT_TRUE(base::CreateDirectory(pref_dir)); ASSERT_EQ(data.size(), file_util::WriteFile(pref_dir.AppendASCII("iTunesPrefs.xml"), data.data(), data.size())); @@ -69,7 +69,7 @@ class ITunesFinderWinTest : public InProcessBrowserTest { void TouchDefault() { base::FilePath default_dir = music_dir().AppendASCII("iTunes"); - ASSERT_TRUE(file_util::CreateDirectory(default_dir)); + ASSERT_TRUE(base::CreateDirectory(default_dir)); TouchFile(default_dir.AppendASCII("iTunes Music Library.xml")); } diff --git a/chrome/browser/media_galleries/fileapi/itunes_file_util_unittest.cc b/chrome/browser/media_galleries/fileapi/itunes_file_util_unittest.cc index d15d5f6..e0e4a9c 100644 --- a/chrome/browser/media_galleries/fileapi/itunes_file_util_unittest.cc +++ b/chrome/browser/media_galleries/fileapi/itunes_file_util_unittest.cc @@ -304,7 +304,7 @@ TEST_F(ItunesFileUtilTest, ItunesAutoAddDirEnumerateNested) { data_provider()->SetProvideAutoAddDir(true); base::FilePath nested_dir = data_provider()->auto_add_path().AppendASCII("foo").AppendASCII("bar"); - ASSERT_TRUE(file_util::CreateDirectory(nested_dir)); + ASSERT_TRUE(base::CreateDirectory(nested_dir)); ASSERT_EQ(0, file_util::WriteFile(nested_dir.AppendASCII("baz.ogg"), NULL, 0)); diff --git a/chrome/browser/media_galleries/fileapi/media_file_validator_browsertest.cc b/chrome/browser/media_galleries/fileapi/media_file_validator_browsertest.cc index bcd0c37..5369338 100644 --- a/chrome/browser/media_galleries/fileapi/media_file_validator_browsertest.cc +++ b/chrome/browser/media_galleries/fileapi/media_file_validator_browsertest.cc @@ -105,7 +105,7 @@ class MediaFileValidatorTest : public InProcessBrowserTest { ASSERT_TRUE(base_dir_.CreateUniqueTempDir()); base::FilePath base = base_dir_.path(); base::FilePath src_path = base.AppendASCII("src_fs"); - ASSERT_TRUE(file_util::CreateDirectory(src_path)); + ASSERT_TRUE(base::CreateDirectory(src_path)); ScopedVector<fileapi::FileSystemBackend> additional_providers; additional_providers.push_back(new fileapi::TestFileSystemBackend( @@ -126,7 +126,7 @@ class MediaFileValidatorTest : public InProcessBrowserTest { file_util::WriteFile(test_file, content.data(), test_file_size_)); base::FilePath dest_path = base.AppendASCII("dest_fs"); - ASSERT_TRUE(file_util::CreateDirectory(dest_path)); + ASSERT_TRUE(base::CreateDirectory(dest_path)); std::string dest_fsid = fileapi::IsolatedContext::GetInstance()->RegisterFileSystemForPath( fileapi::kFileSystemTypeNativeMedia, dest_path, NULL); diff --git a/chrome/browser/media_galleries/fileapi/native_media_file_util_unittest.cc b/chrome/browser/media_galleries/fileapi/native_media_file_util_unittest.cc index 4b5c057..dbc1b14 100644 --- a/chrome/browser/media_galleries/fileapi/native_media_file_util_unittest.cc +++ b/chrome/browser/media_galleries/fileapi/native_media_file_util_unittest.cc @@ -98,7 +98,7 @@ void PopulateDirectoryWithTestCases(const base::FilePath& dir, for (size_t i = 0; i < n; ++i) { base::FilePath path = dir.Append(test_cases[i].path); if (test_cases[i].is_directory) { - ASSERT_TRUE(file_util::CreateDirectory(path)); + ASSERT_TRUE(base::CreateDirectory(path)); } else { ASSERT_TRUE(test_cases[i].content != NULL); int len = strlen(test_cases[i].content); @@ -117,7 +117,7 @@ class NativeMediaFileUtilTest : public testing::Test { virtual void SetUp() { ASSERT_TRUE(data_dir_.CreateUniqueTempDir()); - ASSERT_TRUE(file_util::CreateDirectory(root_path())); + ASSERT_TRUE(base::CreateDirectory(root_path())); scoped_refptr<quota::SpecialStoragePolicy> storage_policy = new quota::MockSpecialStoragePolicy(); @@ -287,7 +287,7 @@ TEST_F(NativeMediaFileUtilTest, CopySourceFiltering) { // Always start with an empty destination directory. // Copying to a non-empty destination directory is an invalid operation. ASSERT_TRUE(base::DeleteFile(dest_path, true)); - ASSERT_TRUE(file_util::CreateDirectory(dest_path)); + ASSERT_TRUE(base::CreateDirectory(dest_path)); FileSystemURL root_url = CreateURL(FPL("")); FileSystemURL url = CreateURL(kFilteringTestCases[i].path); @@ -320,7 +320,7 @@ TEST_F(NativeMediaFileUtilTest, CopyDestFiltering) { // Reset the test directory between the two loops to remove old // directories and create new ones that should pre-exist. ASSERT_TRUE(base::DeleteFile(root_path(), true)); - ASSERT_TRUE(file_util::CreateDirectory(root_path())); + ASSERT_TRUE(base::CreateDirectory(root_path())); PopulateDirectoryWithTestCases(root_path(), kFilteringTestCases, arraysize(kFilteringTestCases)); @@ -392,7 +392,7 @@ TEST_F(NativeMediaFileUtilTest, MoveSourceFiltering) { // Always start with an empty destination directory. // Moving to a non-empty destination directory is an invalid operation. ASSERT_TRUE(base::DeleteFile(dest_path, true)); - ASSERT_TRUE(file_util::CreateDirectory(dest_path)); + ASSERT_TRUE(base::CreateDirectory(dest_path)); FileSystemURL root_url = CreateURL(FPL("")); FileSystemURL url = CreateURL(kFilteringTestCases[i].path); @@ -423,7 +423,7 @@ TEST_F(NativeMediaFileUtilTest, MoveDestFiltering) { // Reset the test directory between the two loops to remove old // directories and create new ones that should pre-exist. ASSERT_TRUE(base::DeleteFile(root_path(), true)); - ASSERT_TRUE(file_util::CreateDirectory(root_path())); + ASSERT_TRUE(base::CreateDirectory(root_path())); PopulateDirectoryWithTestCases(root_path(), kFilteringTestCases, arraysize(kFilteringTestCases)); diff --git a/chrome/browser/media_galleries/fileapi/picasa_data_provider_browsertest.cc b/chrome/browser/media_galleries/fileapi/picasa_data_provider_browsertest.cc index 8e78827..bced3c2 100644 --- a/chrome/browser/media_galleries/fileapi/picasa_data_provider_browsertest.cc +++ b/chrome/browser/media_galleries/fileapi/picasa_data_provider_browsertest.cc @@ -241,9 +241,9 @@ class PicasaDataProviderTest : public InProcessBrowserTest { ASSERT_TRUE(test_folder_1_.CreateUniqueTempDir()); ASSERT_TRUE(test_folder_2_.CreateUniqueTempDir()); ASSERT_TRUE(picasa_root_dir_.CreateUniqueTempDir()); - ASSERT_TRUE(file_util::CreateDirectory( + ASSERT_TRUE(base::CreateDirectory( picasa_root_dir_.path().AppendASCII(kPicasaDatabaseDirName))); - ASSERT_TRUE(file_util::CreateDirectory( + ASSERT_TRUE(base::CreateDirectory( picasa_root_dir_.path().AppendASCII(kPicasaTempDirName))); picasa_data_provider_.reset(new TestPicasaDataProvider( diff --git a/chrome/browser/media_galleries/media_file_system_registry_unittest.cc b/chrome/browser/media_galleries/media_file_system_registry_unittest.cc index 09912b0..6ede692 100644 --- a/chrome/browser/media_galleries/media_file_system_registry_unittest.cc +++ b/chrome/browser/media_galleries/media_file_system_registry_unittest.cc @@ -766,10 +766,10 @@ void MediaFileSystemRegistryTest::SetUp() { ASSERT_TRUE(galleries_dir_.CreateUniqueTempDir()); empty_dir_ = galleries_dir_.path().AppendASCII("empty"); - ASSERT_TRUE(file_util::CreateDirectory(empty_dir_)); + ASSERT_TRUE(base::CreateDirectory(empty_dir_)); dcim_dir_ = galleries_dir_.path().AppendASCII("with_dcim"); - ASSERT_TRUE(file_util::CreateDirectory(dcim_dir_)); - ASSERT_TRUE(file_util::CreateDirectory(dcim_dir_.Append(kDCIMDirectoryName))); + ASSERT_TRUE(base::CreateDirectory(dcim_dir_)); + ASSERT_TRUE(base::CreateDirectory(dcim_dir_.Append(kDCIMDirectoryName))); } void MediaFileSystemRegistryTest::TearDown() { diff --git a/chrome/browser/net/sqlite_server_bound_cert_store.cc b/chrome/browser/net/sqlite_server_bound_cert_store.cc index ead435a..88daa5d 100644 --- a/chrome/browser/net/sqlite_server_bound_cert_store.cc +++ b/chrome/browser/net/sqlite_server_bound_cert_store.cc @@ -193,7 +193,7 @@ void SQLiteServerBoundCertStore::Backend::LoadOnDBThread( // Ensure the parent directory for storing certs is created before reading // from it. const base::FilePath dir = path_.DirName(); - if (!base::PathExists(dir) && !file_util::CreateDirectory(dir)) + if (!base::PathExists(dir) && !base::CreateDirectory(dir)) return; int64 db_size = 0; diff --git a/chrome/browser/performance_monitor/database.cc b/chrome/browser/performance_monitor/database.cc index 21eca51..4d34ef2 100644 --- a/chrome/browser/performance_monitor/database.cc +++ b/chrome/browser/performance_monitor/database.cc @@ -93,7 +93,7 @@ scoped_ptr<Database> Database::Create(base::FilePath path) { path = path.AppendASCII(kDbDir); } scoped_ptr<Database> database; - if (!base::DirectoryExists(path) && !file_util::CreateDirectory(path)) + if (!base::DirectoryExists(path) && !base::CreateDirectory(path)) return database.Pass(); database.reset(new Database(path)); diff --git a/chrome/browser/performance_monitor/performance_monitor_browsertest.cc b/chrome/browser/performance_monitor/performance_monitor_browsertest.cc index 045d893..e549bfd 100644 --- a/chrome/browser/performance_monitor/performance_monitor_browsertest.cc +++ b/chrome/browser/performance_monitor/performance_monitor_browsertest.cc @@ -300,7 +300,7 @@ class PerformanceMonitorUncleanExitBrowserTest base::FilePath first_profile = user_data_directory.AppendASCII(first_profile_name_); - CHECK(file_util::CreateDirectory(first_profile)); + CHECK(base::CreateDirectory(first_profile)); base::FilePath stock_prefs_file; PathService::Get(chrome::DIR_TEST_DATA, &stock_prefs_file); @@ -319,7 +319,7 @@ class PerformanceMonitorUncleanExitBrowserTest base::FilePath second_profile = user_data_directory.AppendASCII(second_profile_name_); - CHECK(file_util::CreateDirectory(second_profile)); + CHECK(base::CreateDirectory(second_profile)); base::FilePath second_profile_prefs_file = second_profile.Append(chrome::kPreferencesFilename); diff --git a/chrome/browser/policy/cloud/resource_cache.cc b/chrome/browser/policy/cloud/resource_cache.cc index 998b728..79b5531 100644 --- a/chrome/browser/policy/cloud/resource_cache.cc +++ b/chrome/browser/policy/cloud/resource_cache.cc @@ -218,7 +218,7 @@ bool ResourceCache::VerifyKeyPath(const std::string& key, if (!Base64Encode(key, &encoded)) return false; *path = cache_dir_.AppendASCII(encoded); - return allow_create ? file_util::CreateDirectory(*path) : + return allow_create ? base::CreateDirectory(*path) : base::DirectoryExists(*path); } diff --git a/chrome/browser/policy/cloud/user_cloud_policy_store.cc b/chrome/browser/policy/cloud/user_cloud_policy_store.cc index ee40214..986e42c 100644 --- a/chrome/browser/policy/cloud/user_cloud_policy_store.cc +++ b/chrome/browser/policy/cloud/user_cloud_policy_store.cc @@ -77,7 +77,7 @@ void StorePolicyToDiskOnBackgroundThread( return; } - if (!file_util::CreateDirectory(path.DirName())) { + if (!base::CreateDirectory(path.DirName())) { DLOG(WARNING) << "Failed to create directory " << path.DirName().value(); return; } diff --git a/chrome/browser/policy/cloud/user_cloud_policy_store_unittest.cc b/chrome/browser/policy/cloud/user_cloud_policy_store_unittest.cc index a0ad278..d07e622 100644 --- a/chrome/browser/policy/cloud/user_cloud_policy_store_unittest.cc +++ b/chrome/browser/policy/cloud/user_cloud_policy_store_unittest.cc @@ -115,7 +115,7 @@ TEST_F(UserCloudPolicyStoreTest, LoadWithInvalidFile) { EXPECT_TRUE(store_->policy_map().empty()); // Create a bogus file. - ASSERT_TRUE(file_util::CreateDirectory(policy_file().DirName())); + ASSERT_TRUE(base::CreateDirectory(policy_file().DirName())); std::string bogus_data = "bogus_data"; int size = bogus_data.size(); ASSERT_EQ(size, file_util::WriteFile(policy_file(), @@ -148,7 +148,7 @@ TEST_F(UserCloudPolicyStoreTest, LoadImmediatelyWithInvalidFile) { EXPECT_TRUE(store_->policy_map().empty()); // Create a bogus file. - ASSERT_TRUE(file_util::CreateDirectory(policy_file().DirName())); + ASSERT_TRUE(base::CreateDirectory(policy_file().DirName())); std::string bogus_data = "bogus_data"; int size = bogus_data.size(); ASSERT_EQ(size, file_util::WriteFile(policy_file(), diff --git a/chrome/browser/policy/config_dir_policy_loader_unittest.cc b/chrome/browser/policy/config_dir_policy_loader_unittest.cc index 1deaeaf..03d52ab 100644 --- a/chrome/browser/policy/config_dir_policy_loader_unittest.cc +++ b/chrome/browser/policy/config_dir_policy_loader_unittest.cc @@ -142,7 +142,7 @@ void TestHarness::WriteConfigFile(const base::DictionaryValue& dict, JSONStringValueSerializer serializer(&data); serializer.Serialize(dict); const base::FilePath mandatory_dir(test_dir().Append(kMandatoryPath)); - ASSERT_TRUE(file_util::CreateDirectory(mandatory_dir)); + ASSERT_TRUE(base::CreateDirectory(mandatory_dir)); const base::FilePath file_path(mandatory_dir.AppendASCII(file_name)); ASSERT_EQ((int) data.size(), file_util::WriteFile(file_path, data.c_str(), data.size())); diff --git a/chrome/browser/prefs/pref_functional_browsertest.cc b/chrome/browser/prefs/pref_functional_browsertest.cc index 1783a89..3f41608 100644 --- a/chrome/browser/prefs/pref_functional_browsertest.cc +++ b/chrome/browser/prefs/pref_functional_browsertest.cc @@ -59,7 +59,7 @@ IN_PROC_BROWSER_TEST_F(PrefsFunctionalTest, TestDownloadDirPref) { } // Create the new downloads directory. - file_util::CreateDirectory(new_download_dir); + base::CreateDirectory(new_download_dir); // Set pref to download in new_download_dir. browser()->profile()->GetPrefs()->SetFilePath( prefs::kDownloadDefaultDirectory, diff --git a/chrome/browser/prefs/pref_service_browsertest.cc b/chrome/browser/prefs/pref_service_browsertest.cc index c5433a8..959e162 100644 --- a/chrome/browser/prefs/pref_service_browsertest.cc +++ b/chrome/browser/prefs/pref_service_browsertest.cc @@ -74,7 +74,7 @@ class PreferenceServiceTest : public InProcessBrowserTest { base::FilePath().Append(chrome::kPreferencesFilename)); tmp_pref_file_ = user_data_directory.AppendASCII(TestingProfile::kTestUserProfileDir); - CHECK(file_util::CreateDirectory(tmp_pref_file_)); + CHECK(base::CreateDirectory(tmp_pref_file_)); tmp_pref_file_ = tmp_pref_file_.Append(chrome::kPreferencesFilename); } else { reference_pref_file = ui_test_utils::GetTestFilePath( diff --git a/chrome/browser/printing/printing_layout_browsertest.cc b/chrome/browser/printing/printing_layout_browsertest.cc index cc0c449..71e5364a 100644 --- a/chrome/browser/printing/printing_layout_browsertest.cc +++ b/chrome/browser/printing/printing_layout_browsertest.cc @@ -173,7 +173,7 @@ class PrintingLayoutTest : public PrintingTest<InProcessBrowserTest>, // Makes sure the directory exists and is empty. void CleanupDumpDirectory() { EXPECT_TRUE(file_util::DieFileDie(emf_path_, true)); - EXPECT_TRUE(file_util::CreateDirectory(emf_path_)); + EXPECT_TRUE(base::CreateDirectory(emf_path_)); } // Returns if Clear Type is currently enabled. diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc index c94f365..35576ba 100644 --- a/chrome/browser/profiles/profile_impl.cc +++ b/chrome/browser/profiles/profile_impl.cc @@ -175,7 +175,7 @@ const char* const kPrefExitTypeSessionEnded = "SessionEnded"; void CreateDirectoryAndSignal(const base::FilePath& path, base::WaitableEvent* done_creating) { DVLOG(1) << "Creating directory " << path.value(); - file_util::CreateDirectory(path); + base::CreateDirectory(path); done_creating->Signal(); } @@ -278,7 +278,7 @@ Profile* Profile::CreateProfile(const base::FilePath& path, // TODO(tc): http://b/1094718 Bad things happen if we can't write to the // profile directory. We should eventually be able to run in this // situation. - if (!file_util::CreateDirectory(path)) + if (!base::CreateDirectory(path)) return NULL; } } else { diff --git a/chrome/browser/profiles/profile_info_cache.cc b/chrome/browser/profiles/profile_info_cache.cc index ae5703c..8d8e9c4 100644 --- a/chrome/browser/profiles/profile_info_cache.cc +++ b/chrome/browser/profiles/profile_info_cache.cc @@ -125,7 +125,7 @@ void SaveBitmap(ImageData* data, // Make sure the destination directory exists. base::FilePath dir = image_path.DirName(); - if (!base::DirectoryExists(dir) && !file_util::CreateDirectory(dir)) { + if (!base::DirectoryExists(dir) && !base::CreateDirectory(dir)) { LOG(ERROR) << "Failed to create parent directory."; return; } diff --git a/chrome/browser/profiles/profile_manager_unittest.cc b/chrome/browser/profiles/profile_manager_unittest.cc index 102c2f8..e672048 100644 --- a/chrome/browser/profiles/profile_manager_unittest.cc +++ b/chrome/browser/profiles/profile_manager_unittest.cc @@ -63,7 +63,7 @@ class UnittestProfileManager : public ::ProfileManagerWithoutInit { virtual Profile* CreateProfileHelper( const base::FilePath& file_path) OVERRIDE { if (!base::PathExists(file_path)) { - if (!file_util::CreateDirectory(file_path)) + if (!base::CreateDirectory(file_path)) return NULL; } return new TestingProfile(file_path, NULL); @@ -74,7 +74,7 @@ class UnittestProfileManager : public ::ProfileManagerWithoutInit { // This is safe while all file operations are done on the FILE thread. BrowserThread::PostTask( BrowserThread::FILE, FROM_HERE, - base::Bind(base::IgnoreResult(&file_util::CreateDirectory), path)); + base::Bind(base::IgnoreResult(&base::CreateDirectory), path)); return new TestingProfile(path, this); } diff --git a/chrome/browser/profiles/profile_shortcut_manager_unittest_win.cc b/chrome/browser/profiles/profile_shortcut_manager_unittest_win.cc index 6d5fd02..6115754 100644 --- a/chrome/browser/profiles/profile_shortcut_manager_unittest_win.cc +++ b/chrome/browser/profiles/profile_shortcut_manager_unittest_win.cc @@ -81,7 +81,7 @@ class ProfileShortcutManagerTest : public testing::Test { base::FilePath CreateProfileDirectory(const string16& profile_name) { const base::FilePath profile_path = profile_info_cache_->GetUserDataDir().Append(profile_name); - file_util::CreateDirectory(profile_path); + base::CreateDirectory(profile_path); return profile_path; } diff --git a/chrome/browser/sessions/session_backend.cc b/chrome/browser/sessions/session_backend.cc index 018b679..8faed00 100644 --- a/chrome/browser/sessions/session_backend.cc +++ b/chrome/browser/sessions/session_backend.cc @@ -218,7 +218,7 @@ void SessionBackend::Init() { inited_ = true; // Create the directory for session info. - file_util::CreateDirectory(path_to_dir_); + base::CreateDirectory(path_to_dir_); MoveCurrentSessionToLastSession(); } diff --git a/chrome/browser/sessions/session_backend_unittest.cc b/chrome/browser/sessions/session_backend_unittest.cc index cfe95e5..6c3292a 100644 --- a/chrome/browser/sessions/session_backend_unittest.cc +++ b/chrome/browser/sessions/session_backend_unittest.cc @@ -35,7 +35,7 @@ class SessionBackendTest : public testing::Test { virtual void SetUp() { ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); path_ = temp_dir_.path().Append(FILE_PATH_LITERAL("SessionTestDirs")); - file_util::CreateDirectory(path_); + base::CreateDirectory(path_); } void AssertCommandEqualsData(const TestData& data, SessionCommand* command) { diff --git a/chrome/browser/sessions/session_service_unittest.cc b/chrome/browser/sessions/session_service_unittest.cc index 775e522..3e3b009 100644 --- a/chrome/browser/sessions/session_service_unittest.cc +++ b/chrome/browser/sessions/session_service_unittest.cc @@ -47,7 +47,7 @@ class SessionServiceTest : public BrowserWithTestWindowTest, ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); path_ = temp_dir_.path().Append(FILE_PATH_LITERAL("SessionTestDirs")); - ASSERT_TRUE(file_util::CreateDirectory(path_)); + ASSERT_TRUE(base::CreateDirectory(path_)); path_ = path_.AppendASCII(b); SessionService* session_service = new SessionService(path_); diff --git a/chrome/browser/shell_integration_linux_unittest.cc b/chrome/browser/shell_integration_linux_unittest.cc index 9bf6ec4..309c023 100644 --- a/chrome/browser/shell_integration_linux_unittest.cc +++ b/chrome/browser/shell_integration_linux_unittest.cc @@ -182,7 +182,7 @@ TEST(ShellIntegrationTest, GetExistingShortcutLocations) { base::FilePath desktop_path = temp_dir.path(); MockEnvironment env; - ASSERT_TRUE(file_util::CreateDirectory(desktop_path)); + ASSERT_TRUE(base::CreateDirectory(desktop_path)); ASSERT_FALSE(file_util::WriteFile( desktop_path.AppendASCII(kTemplateFilename), "", 0)); @@ -203,7 +203,7 @@ TEST(ShellIntegrationTest, GetExistingShortcutLocations) { MockEnvironment env; env.Set("XDG_DATA_HOME", temp_dir.path().value()); - ASSERT_TRUE(file_util::CreateDirectory(apps_path)); + ASSERT_TRUE(base::CreateDirectory(apps_path)); ASSERT_FALSE(file_util::WriteFile( apps_path.AppendASCII(kTemplateFilename), "", 0)); @@ -224,7 +224,7 @@ TEST(ShellIntegrationTest, GetExistingShortcutLocations) { MockEnvironment env; env.Set("XDG_DATA_HOME", temp_dir.path().value()); - ASSERT_TRUE(file_util::CreateDirectory(apps_path)); + ASSERT_TRUE(base::CreateDirectory(apps_path)); ASSERT_TRUE(file_util::WriteFile( apps_path.AppendASCII(kTemplateFilename), kNoDisplayDesktopFile, strlen(kNoDisplayDesktopFile))); @@ -249,12 +249,12 @@ TEST(ShellIntegrationTest, GetExistingShortcutLocations) { base::FilePath apps_path = temp_dir2.path().AppendASCII("applications"); MockEnvironment env; - ASSERT_TRUE(file_util::CreateDirectory(desktop_path)); + ASSERT_TRUE(base::CreateDirectory(desktop_path)); ASSERT_FALSE(file_util::WriteFile( desktop_path.AppendASCII(kTemplateFilename), "", 0)); env.Set("XDG_DATA_HOME", temp_dir2.path().value()); - ASSERT_TRUE(file_util::CreateDirectory(apps_path)); + ASSERT_TRUE(base::CreateDirectory(apps_path)); ASSERT_FALSE(file_util::WriteFile( apps_path.AppendASCII(kTemplateFilename), "", 0)); @@ -288,7 +288,7 @@ TEST(ShellIntegrationTest, GetExistingShortcutContents) { ASSERT_TRUE(file_util::WriteFile( temp_dir.path().AppendASCII(kTemplateFilename), kTestData2, strlen(kTestData2))); - ASSERT_TRUE(file_util::CreateDirectory( + ASSERT_TRUE(base::CreateDirectory( temp_dir.path().AppendASCII("applications"))); ASSERT_TRUE(file_util::WriteFile( temp_dir.path().AppendASCII("applications") @@ -308,7 +308,7 @@ TEST(ShellIntegrationTest, GetExistingShortcutContents) { MockEnvironment env; env.Set("HOME", temp_dir.path().value()); - ASSERT_TRUE(file_util::CreateDirectory( + ASSERT_TRUE(base::CreateDirectory( temp_dir.path().AppendASCII(".local/share/applications"))); ASSERT_TRUE(file_util::WriteFile( temp_dir.path().AppendASCII(".local/share/applications") @@ -328,7 +328,7 @@ TEST(ShellIntegrationTest, GetExistingShortcutContents) { MockEnvironment env; env.Set("XDG_DATA_DIRS", temp_dir.path().value()); - ASSERT_TRUE(file_util::CreateDirectory( + ASSERT_TRUE(base::CreateDirectory( temp_dir.path().AppendASCII("applications"))); ASSERT_TRUE(file_util::WriteFile( temp_dir.path().AppendASCII("applications") @@ -356,7 +356,7 @@ TEST(ShellIntegrationTest, GetExistingShortcutContents) { temp_dir1.path().AppendASCII(kTemplateFilename), kTestData1, strlen(kTestData1))); // Only create a findable desktop file in the second path. - ASSERT_TRUE(file_util::CreateDirectory( + ASSERT_TRUE(base::CreateDirectory( temp_dir2.path().AppendASCII("applications"))); ASSERT_TRUE(file_util::WriteFile( temp_dir2.path().AppendASCII("applications") diff --git a/chrome/browser/storage_monitor/media_storage_util_unittest.cc b/chrome/browser/storage_monitor/media_storage_util_unittest.cc index f1d4621..b6dc6c44 100644 --- a/chrome/browser/storage_monitor/media_storage_util_unittest.cc +++ b/chrome/browser/storage_monitor/media_storage_util_unittest.cc @@ -54,7 +54,7 @@ class MediaStorageUtilTest : public testing::Test { base::FilePath path(scoped_temp_dir_.path()); if (create_dcim_dir) path = path.Append(kDCIMDirectoryName); - if (!file_util::CreateDirectory(path)) + if (!base::CreateDirectory(path)) return base::FilePath(); return scoped_temp_dir_.path(); } diff --git a/chrome/browser/storage_monitor/storage_monitor_chromeos_unittest.cc b/chrome/browser/storage_monitor/storage_monitor_chromeos_unittest.cc index 57e0f46..55ca7a6 100644 --- a/chrome/browser/storage_monitor/storage_monitor_chromeos_unittest.cc +++ b/chrome/browser/storage_monitor/storage_monitor_chromeos_unittest.cc @@ -236,7 +236,7 @@ base::FilePath StorageMonitorCrosTest::CreateMountPoint( base::FilePath path(return_path); if (with_dcim_dir) path = path.Append(kDCIMDirectoryName); - if (!file_util::CreateDirectory(path)) + if (!base::CreateDirectory(path)) return base::FilePath(); return return_path; } diff --git a/chrome/browser/storage_monitor/storage_monitor_linux_unittest.cc b/chrome/browser/storage_monitor/storage_monitor_linux_unittest.cc index a1c8e0e..86e4604 100644 --- a/chrome/browser/storage_monitor/storage_monitor_linux_unittest.cc +++ b/chrome/browser/storage_monitor/storage_monitor_linux_unittest.cc @@ -165,7 +165,7 @@ class StorageMonitorLinuxTest : public testing::Test { // Create and set up a temp dir with files for the test. ASSERT_TRUE(scoped_temp_dir_.CreateUniqueTempDir()); base::FilePath test_dir = scoped_temp_dir_.path().AppendASCII("test_etc"); - ASSERT_TRUE(file_util::CreateDirectory(test_dir)); + ASSERT_TRUE(base::CreateDirectory(test_dir)); mtab_file_ = test_dir.AppendASCII("test_mtab"); MtabTestData initial_test_data[] = { MtabTestData("dummydevice", "dummydir", kInvalidFS), @@ -266,7 +266,7 @@ class StorageMonitorLinuxTest : public testing::Test { base::FilePath path(return_path); if (with_dcim_dir) path = path.Append(kDCIMDirectoryName); - if (!file_util::CreateDirectory(path)) + if (!base::CreateDirectory(path)) return base::FilePath(); return return_path; } diff --git a/chrome/browser/storage_monitor/storage_monitor_mac_unittest.mm b/chrome/browser/storage_monitor/storage_monitor_mac_unittest.mm index bb483da..d8e658f 100644 --- a/chrome/browser/storage_monitor/storage_monitor_mac_unittest.mm +++ b/chrome/browser/storage_monitor/storage_monitor_mac_unittest.mm @@ -128,7 +128,7 @@ TEST_F(StorageMonitorMacTest, UpdateVolumeName) { TEST_F(StorageMonitorMacTest, DCIM) { base::ScopedTempDir temp_dir; ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); - ASSERT_TRUE(file_util::CreateDirectory( + ASSERT_TRUE(base::CreateDirectory( temp_dir.path().Append(kDCIMDirectoryName))); base::FilePath mount_point = temp_dir.path(); diff --git a/chrome/browser/sync/glue/sync_backend_host_core.cc b/chrome/browser/sync/glue/sync_backend_host_core.cc index 792f43b..228aaa0 100644 --- a/chrome/browser/sync/glue/sync_backend_host_core.cc +++ b/chrome/browser/sync/glue/sync_backend_host_core.cc @@ -349,7 +349,7 @@ void SyncBackendHostCore::DoInitialize( // Make sure that the directory exists before initializing the backend. // If it already exists, this will do no harm. - if (!file_util::CreateDirectory(sync_data_folder_path_)) { + if (!base::CreateDirectory(sync_data_folder_path_)) { DLOG(FATAL) << "Sync Data directory creation failed."; } diff --git a/chrome/browser/sync/glue/sync_backend_host_impl_unittest.cc b/chrome/browser/sync/glue/sync_backend_host_impl_unittest.cc index 609e20f..989fb45 100644 --- a/chrome/browser/sync/glue/sync_backend_host_impl_unittest.cc +++ b/chrome/browser/sync/glue/sync_backend_host_impl_unittest.cc @@ -691,7 +691,7 @@ TEST_F(SyncBackendHostTest, TestStartupWithOldSyncData) { base::FilePath temp_directory = profile_->GetPath().AppendASCII("Sync Data"); base::FilePath sync_file = temp_directory.AppendASCII("SyncData.sqlite3"); - ASSERT_TRUE(file_util::CreateDirectory(temp_directory)); + ASSERT_TRUE(base::CreateDirectory(temp_directory)); ASSERT_NE(-1, file_util::WriteFile(sync_file, nonsense, strlen(nonsense))); InitializeBackend(true); diff --git a/chrome/browser/sync/test/integration/sync_extension_helper.cc b/chrome/browser/sync/test/integration/sync_extension_helper.cc index 0979ef4..2a4196c 100644 --- a/chrome/browser/sync/test/integration/sync_extension_helper.cc +++ b/chrome/browser/sync/test/integration/sync_extension_helper.cc @@ -308,7 +308,7 @@ scoped_refptr<Extension> CreateExtension(const base::FilePath& base_dir, const base::FilePath sub_dir = base::FilePath().AppendASCII(name); base::FilePath extension_dir; if (!base::PathExists(base_dir) && - !file_util::CreateDirectory(base_dir)) { + !base::CreateDirectory(base_dir)) { ADD_FAILURE(); return NULL; } diff --git a/chrome/browser/sync/test/integration/sync_test.cc b/chrome/browser/sync/test/integration/sync_test.cc index d5ab8ef..e936fd1 100644 --- a/chrome/browser/sync/test/integration/sync_test.cc +++ b/chrome/browser/sync/test/integration/sync_test.cc @@ -228,7 +228,7 @@ Profile* SyncTest::MakeProfile(const base::FilePath::StringType name) { path = path.Append(name); if (!base::PathExists(path)) - CHECK(file_util::CreateDirectory(path)); + CHECK(base::CreateDirectory(path)); Profile* profile = Profile::CreateProfile(path, NULL, Profile::CREATE_MODE_SYNCHRONOUS); diff --git a/chrome/browser/sync_file_system/drive_backend_v1/api_util.cc b/chrome/browser/sync_file_system/drive_backend_v1/api_util.cc index 2666654..a65d2a2 100644 --- a/chrome/browser/sync_file_system/drive_backend_v1/api_util.cc +++ b/chrome/browser/sync_file_system/drive_backend_v1/api_util.cc @@ -144,7 +144,7 @@ std::string GetMimeTypeFromTitle(const std::string& title) { bool CreateTemporaryFile(const base::FilePath& dir_path, webkit_blob::ScopedFile* temp_file) { base::FilePath temp_file_path; - const bool success = file_util::CreateDirectory(dir_path) && + const bool success = base::CreateDirectory(dir_path) && base::CreateTemporaryFileInDir(dir_path, &temp_file_path); if (!success) return success; diff --git a/chrome/browser/sync_file_system/drive_backend_v1/fake_drive_service_helper.cc b/chrome/browser/sync_file_system/drive_backend_v1/fake_drive_service_helper.cc index 0f93d9b..4b71b3a 100644 --- a/chrome/browser/sync_file_system/drive_backend_v1/fake_drive_service_helper.cc +++ b/chrome/browser/sync_file_system/drive_backend_v1/fake_drive_service_helper.cc @@ -279,7 +279,7 @@ GDataErrorCode FakeDriveServiceHelper::CompleteListing( void FakeDriveServiceHelper::Initialize() { ASSERT_TRUE(base_dir_.CreateUniqueTempDir()); temp_dir_ = base_dir_.path().Append(FPL("tmp")); - ASSERT_TRUE(file_util::CreateDirectory(temp_dir_)); + ASSERT_TRUE(base::CreateDirectory(temp_dir_)); } base::FilePath FakeDriveServiceHelper::WriteToTempFile( diff --git a/chrome/browser/sync_file_system/local/local_file_sync_context.cc b/chrome/browser/sync_file_system/local/local_file_sync_context.cc index 840f59c..ede4bc4 100644 --- a/chrome/browser/sync_file_system/local/local_file_sync_context.cc +++ b/chrome/browser/sync_file_system/local/local_file_sync_context.cc @@ -622,7 +622,7 @@ SyncStatusCode LocalFileSyncContext::InitializeChangeTrackerOnFileThread( } // Creates snapshot directory. - file_util::CreateDirectory(local_base_path_.Append(kSnapshotDir)); + base::CreateDirectory(local_base_path_.Append(kSnapshotDir)); return status; } diff --git a/chrome/browser/ui/ash/screenshot_taker.cc b/chrome/browser/ui/ash/screenshot_taker.cc index 99dcfa5..46111f0 100644 --- a/chrome/browser/ui/ash/screenshot_taker.cc +++ b/chrome/browser/ui/ash/screenshot_taker.cc @@ -214,7 +214,7 @@ void SaveScreenshot(const ShowNotificationCallback& callback, DCHECK(content::BrowserThread::GetBlockingPool()->RunsTasksOnCurrentThread()); DCHECK(!screenshot_path.empty()); - if (!file_util::CreateDirectory(screenshot_path.DirName())) { + if (!base::CreateDirectory(screenshot_path.DirName())) { LOG(ERROR) << "Failed to ensure the existence of " << screenshot_path.DirName().value(); content::BrowserThread::PostTask( diff --git a/chrome/browser/ui/browser_browsertest.cc b/chrome/browser/ui/browser_browsertest.cc index 65b511b..36e78d8 100644 --- a/chrome/browser/ui/browser_browsertest.cc +++ b/chrome/browser/ui/browser_browsertest.cc @@ -2085,7 +2085,7 @@ class LaunchBrowserWithNonAsciiUserDatadir : public BrowserTest { base::FilePath tmp_profile = temp_dir_.path().AppendASCII("tmp_profile"); tmp_profile = tmp_profile.Append(L"Test Chrome G\u00E9raldine"); - ASSERT_TRUE(file_util::CreateDirectory(tmp_profile)); + ASSERT_TRUE(base::CreateDirectory(tmp_profile)); command_line->AppendSwitchPath(switches::kUserDataDir, tmp_profile); } diff --git a/chrome/browser/ui/metro_pin_tab_helper_win.cc b/chrome/browser/ui/metro_pin_tab_helper_win.cc index 58255d7..7ae61c3 100644 --- a/chrome/browser/ui/metro_pin_tab_helper_win.cc +++ b/chrome/browser/ui/metro_pin_tab_helper_win.cc @@ -58,7 +58,7 @@ base::FilePath GetTileImagesDir() { tile_images_dir = tile_images_dir.Append(L"TileImages"); if (!base::DirectoryExists(tile_images_dir) && - !file_util::CreateDirectory(tile_images_dir)) + !base::CreateDirectory(tile_images_dir)) return base::FilePath(); return tile_images_dir; diff --git a/chrome/browser/ui/prefs/prefs_tab_helper_browsertest.cc b/chrome/browser/ui/prefs/prefs_tab_helper_browsertest.cc index bb82f51..9468332 100644 --- a/chrome/browser/ui/prefs/prefs_tab_helper_browsertest.cc +++ b/chrome/browser/ui/prefs/prefs_tab_helper_browsertest.cc @@ -30,7 +30,7 @@ class PrefsTabHelperBrowserTest : public InProcessBrowserTest { PathService::Get(chrome::DIR_USER_DATA, &user_data_directory); base::FilePath default_profile = user_data_directory.AppendASCII(TestingProfile::kTestUserProfileDir); - if (!file_util::CreateDirectory(default_profile)) { + if (!base::CreateDirectory(default_profile)) { LOG(ERROR) << "Can't create " << default_profile.MaybeAsASCII(); return false; } diff --git a/chrome/browser/ui/views/app_list/win/app_list_service_win.cc b/chrome/browser/ui/views/app_list/win/app_list_service_win.cc index 91a8e03..9d22705 100644 --- a/chrome/browser/ui/views/app_list/win/app_list_service_win.cc +++ b/chrome/browser/ui/views/app_list/win/app_list_service_win.cc @@ -259,7 +259,7 @@ void CreateAppListShortcuts( shortcut_paths[i].Append(app_list_shortcut_name). AddExtension(installer::kLnkExt); if (!base::PathExists(shortcut_file.DirName()) && - !file_util::CreateDirectory(shortcut_file.DirName())) { + !base::CreateDirectory(shortcut_file.DirName())) { NOTREACHED(); return; } diff --git a/chrome/browser/ui/views/apps/native_app_window_views.cc b/chrome/browser/ui/views/apps/native_app_window_views.cc index 0acd29d..dce6d3f 100644 --- a/chrome/browser/ui/views/apps/native_app_window_views.cc +++ b/chrome/browser/ui/views/apps/native_app_window_views.cc @@ -127,7 +127,7 @@ void CreateIconAndSetRelaunchDetails( shortcut_info.title, hwnd); if (!base::PathExists(web_app_path) && - !file_util::CreateDirectory(web_app_path)) + !base::CreateDirectory(web_app_path)) return; ui::win::SetAppIconForWindow(icon_file.value(), hwnd); diff --git a/chrome/browser/ui/views/avatar_menu_button_browsertest.cc b/chrome/browser/ui/views/avatar_menu_button_browsertest.cc index 1c9c01e..db3f309 100644 --- a/chrome/browser/ui/views/avatar_menu_button_browsertest.cc +++ b/chrome/browser/ui/views/avatar_menu_button_browsertest.cc @@ -47,7 +47,7 @@ void AvatarMenuButtonTest::CreateTestingProfile() { PathService::Get(chrome::DIR_USER_DATA, &path); path = path.AppendASCII("test_profile"); if (!base::PathExists(path)) - ASSERT_TRUE(file_util::CreateDirectory(path)); + ASSERT_TRUE(base::CreateDirectory(path)); Profile* profile = Profile::CreateProfile(path, NULL, Profile::CREATE_MODE_SYNCHRONOUS); profile_manager->RegisterTestingProfile(profile, true, false); diff --git a/chrome/browser/ui/views/new_avatar_menu_button_browsertest.cc b/chrome/browser/ui/views/new_avatar_menu_button_browsertest.cc index d4be6e8..ed2e855 100644 --- a/chrome/browser/ui/views/new_avatar_menu_button_browsertest.cc +++ b/chrome/browser/ui/views/new_avatar_menu_button_browsertest.cc @@ -66,7 +66,7 @@ void NewAvatarMenuButtonTest::CreateTestingProfile() { PathService::Get(chrome::DIR_USER_DATA, &path); path = path.AppendASCII("test_profile"); if (!base::PathExists(path)) - ASSERT_TRUE(file_util::CreateDirectory(path)); + ASSERT_TRUE(base::CreateDirectory(path)); Profile* profile = Profile::CreateProfile(path, NULL, Profile::CREATE_MODE_SYNCHRONOUS); profile_manager->RegisterTestingProfile(profile, true, false); diff --git a/chrome/browser/ui/views/select_file_dialog_extension_browsertest.cc b/chrome/browser/ui/views/select_file_dialog_extension_browsertest.cc index b77b3665..8b5c742 100644 --- a/chrome/browser/ui/views/select_file_dialog_extension_browsertest.cc +++ b/chrome/browser/ui/views/select_file_dialog_extension_browsertest.cc @@ -96,7 +96,7 @@ class SelectFileDialogExtensionBrowserTest : public ExtensionBrowserTest { PathService::Get(base::DIR_TEMP, &tmp_path); ASSERT_TRUE(tmp_dir_.CreateUniqueTempDirUnderPath(tmp_path)); downloads_dir_ = tmp_dir_.path().Append("Downloads"); - file_util::CreateDirectory(downloads_dir_); + base::CreateDirectory(downloads_dir_); // Must run after our setup because it actually runs the test. ExtensionBrowserTest::SetUp(); diff --git a/chrome/browser/ui/web_applications/web_app_ui.cc b/chrome/browser/ui/web_applications/web_app_ui.cc index 86d641a..d0a1253 100644 --- a/chrome/browser/ui/web_applications/web_app_ui.cc +++ b/chrome/browser/ui/web_applications/web_app_ui.cc @@ -286,7 +286,7 @@ void UpdateShortcutWorker::UpdateShortcutsOnFileThread() { // Ensure web_app_path exists. web_app_path could be missing for a legacy // shortcut created by Gears. if (!base::PathExists(web_app_path) && - !file_util::CreateDirectory(web_app_path)) { + !base::CreateDirectory(web_app_path)) { NOTREACHED(); return; } diff --git a/chrome/browser/web_applications/web_app_mac.mm b/chrome/browser/web_applications/web_app_mac.mm index 0be104b..f7372ce 100644 --- a/chrome/browser/web_applications/web_app_mac.mm +++ b/chrome/browser/web_applications/web_app_mac.mm @@ -137,7 +137,7 @@ base::FilePath GetWritableApplicationsDirectory() { base::FilePath path; if (base::mac::GetUserDirectory(NSApplicationDirectory, &path)) { if (!base::DirectoryExists(path)) { - if (!file_util::CreateDirectory(path)) + if (!base::CreateDirectory(path)) return base::FilePath(); // Create a zero-byte ".localized" file to inherit localizations from OSX @@ -258,7 +258,7 @@ base::FilePath GetLocalizableAppShortcutsSubdirName() { void UpdateAppShortcutsSubdirLocalizedName( const base::FilePath& apps_directory) { base::FilePath localized = apps_directory.Append(".localized"); - if (!file_util::CreateDirectory(localized)) + if (!base::CreateDirectory(localized)) return; base::FilePath directory_name = apps_directory.BaseName().RemoveExtension(); @@ -437,7 +437,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::CreateDirectory(dst_path)) { + if (!base::CreateDirectory(dst_path)) { LOG(ERROR) << "Creating directory " << dst_path.value() << " failed."; return succeeded; } @@ -623,7 +623,7 @@ bool WebAppShortcutCreator::UpdateDisplayName( // OSX searches for the best language in the order of preferred languages. // Since we only have one localization directory, it will choose this one. base::FilePath localized_dir = GetResourcesPath(app_path).Append("en.lproj"); - if (!file_util::CreateDirectory(localized_dir)) + if (!base::CreateDirectory(localized_dir)) return false; NSString* bundle_name = base::SysUTF16ToNSString(info_.title); @@ -670,7 +670,7 @@ bool WebAppShortcutCreator::UpdateIcon(const base::FilePath& app_path) const { return false; base::FilePath resources_path = GetResourcesPath(app_path); - if (!file_util::CreateDirectory(resources_path)) + if (!base::CreateDirectory(resources_path)) return false; return icon_family.WriteDataToFile(resources_path.Append("app.icns")); diff --git a/chrome/browser/web_applications/web_app_win.cc b/chrome/browser/web_applications/web_app_win.cc index 9c43e89..1187cc3 100644 --- a/chrome/browser/web_applications/web_app_win.cc +++ b/chrome/browser/web_applications/web_app_win.cc @@ -167,7 +167,7 @@ bool CreateShortcutsInPaths( std::vector<base::FilePath>* out_filenames) { // Ensure web_app_path exists. if (!base::PathExists(web_app_path) && - !file_util::CreateDirectory(web_app_path)) { + !base::CreateDirectory(web_app_path)) { return false; } @@ -244,7 +244,7 @@ bool CreateShortcutsInPaths( shortcut_properties.set_app_id(app_id); shortcut_properties.set_dual_mode(false); if (!base::PathExists(shortcut_file.DirName()) && - !file_util::CreateDirectory(shortcut_file.DirName())) { + !base::CreateDirectory(shortcut_file.DirName())) { NOTREACHED(); return false; } diff --git a/chrome/common/auto_start_linux.cc b/chrome/common/auto_start_linux.cc index 9051149..c9c3fcc 100644 --- a/chrome/common/auto_start_linux.cc +++ b/chrome/common/auto_start_linux.cc @@ -33,7 +33,7 @@ bool AutoStart::AddApplication(const std::string& autostart_filename, scoped_ptr<base::Environment> environment(base::Environment::Create()); base::FilePath autostart_directory = GetAutostartDirectory(environment.get()); if (!base::DirectoryExists(autostart_directory) && - !file_util::CreateDirectory(autostart_directory)) { + !base::CreateDirectory(autostart_directory)) { return false; } diff --git a/chrome/common/chrome_paths.cc b/chrome/common/chrome_paths.cc index b37dadb..6e55ab9 100644 --- a/chrome/common/chrome_paths.cc +++ b/chrome/common/chrome_paths.cc @@ -518,7 +518,7 @@ bool PathProvider(int key, base::FilePath* result) { // TODO(bauerb): http://crbug.com/259796 base::ThreadRestrictions::ScopedAllowIO allow_io; if (create_dir && !base::PathExists(cur) && - !file_util::CreateDirectory(cur)) + !base::CreateDirectory(cur)) return false; *result = cur; diff --git a/chrome/common/extensions/extension_file_util.cc b/chrome/common/extensions/extension_file_util.cc index 1e41ea4..82982b0 100644 --- a/chrome/common/extensions/extension_file_util.cc +++ b/chrome/common/extensions/extension_file_util.cc @@ -71,7 +71,7 @@ base::FilePath InstallExtension(const base::FilePath& unpacked_source_dir, // Create the extension directory if it doesn't exist already. if (!base::PathExists(extension_dir)) { - if (!file_util::CreateDirectory(extension_dir)) + if (!base::CreateDirectory(extension_dir)) return base::FilePath(); } @@ -517,7 +517,7 @@ base::FilePath GetInstallTempDir(const base::FilePath& extensions_dir) { } // Directory doesn't exist, so create it. - if (!file_util::CreateDirectory(temp_path)) { + if (!base::CreateDirectory(temp_path)) { DLOG(WARNING) << "Couldn't create directory: " << temp_path.value(); return base::FilePath(); } diff --git a/chrome/common/extensions/extension_file_util_unittest.cc b/chrome/common/extensions/extension_file_util_unittest.cc index f767f24..71db8c9 100644 --- a/chrome/common/extensions/extension_file_util_unittest.cc +++ b/chrome/common/extensions/extension_file_util_unittest.cc @@ -36,11 +36,11 @@ TEST_F(ExtensionFileUtilTest, InstallUninstallGarbageCollect) { std::string extension_id("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); std::string version("1.0"); base::FilePath src = temp.path().AppendASCII(extension_id); - ASSERT_TRUE(file_util::CreateDirectory(src)); + ASSERT_TRUE(base::CreateDirectory(src)); // Create a extensions tree. base::FilePath all_extensions = temp.path().AppendASCII("extensions"); - ASSERT_TRUE(file_util::CreateDirectory(all_extensions)); + ASSERT_TRUE(base::CreateDirectory(all_extensions)); // Install in empty directory. Should create parent directories as needed. base::FilePath version_1 = extension_file_util::InstallExtension( @@ -57,7 +57,7 @@ TEST_F(ExtensionFileUtilTest, InstallUninstallGarbageCollect) { ASSERT_FALSE(base::DirectoryExists(src)); // Install again. Should create a new one with different name. - ASSERT_TRUE(file_util::CreateDirectory(src)); + ASSERT_TRUE(base::CreateDirectory(src)); base::FilePath version_2 = extension_file_util::InstallExtension( src, extension_id, @@ -72,7 +72,7 @@ TEST_F(ExtensionFileUtilTest, InstallUninstallGarbageCollect) { ASSERT_FALSE(base::DirectoryExists(src)); // Install yet again. Should create a new one with a different name. - ASSERT_TRUE(file_util::CreateDirectory(src)); + ASSERT_TRUE(base::CreateDirectory(src)); base::FilePath version_3 = extension_file_util::InstallExtension( src, extension_id, @@ -139,7 +139,7 @@ TEST_F(ExtensionFileUtilTest, CheckIllegalFilenamesNoUnderscores) { ASSERT_TRUE(temp.CreateUniqueTempDir()); base::FilePath src_path = temp.path().AppendASCII("some_dir"); - ASSERT_TRUE(file_util::CreateDirectory(src_path)); + ASSERT_TRUE(base::CreateDirectory(src_path)); std::string data = "{ \"name\": { \"message\": \"foobar\" } }"; ASSERT_TRUE(file_util::WriteFile(src_path.AppendASCII("some_file.txt"), @@ -158,7 +158,7 @@ TEST_F(ExtensionFileUtilTest, CheckIllegalFilenamesOnlyReserved) { for (size_t i = 0; i < arraysize(folders); i++) { base::FilePath src_path = temp.path().Append(folders[i]); - ASSERT_TRUE(file_util::CreateDirectory(src_path)); + ASSERT_TRUE(base::CreateDirectory(src_path)); } std::string error; @@ -171,10 +171,10 @@ TEST_F(ExtensionFileUtilTest, CheckIllegalFilenamesReservedAndIllegal) { ASSERT_TRUE(temp.CreateUniqueTempDir()); base::FilePath src_path = temp.path().Append(extensions::kLocaleFolder); - ASSERT_TRUE(file_util::CreateDirectory(src_path)); + ASSERT_TRUE(base::CreateDirectory(src_path)); src_path = temp.path().AppendASCII("_some_dir"); - ASSERT_TRUE(file_util::CreateDirectory(src_path)); + ASSERT_TRUE(base::CreateDirectory(src_path)); std::string error; EXPECT_FALSE(extension_file_util::CheckForIllegalFilenames(temp.path(), @@ -357,7 +357,7 @@ TEST_F(ExtensionFileUtilTest, FindPrivateKeyFiles) { ASSERT_TRUE(temp.CreateUniqueTempDir()); base::FilePath src_path = temp.path().AppendASCII("some_dir"); - ASSERT_TRUE(file_util::CreateDirectory(src_path)); + ASSERT_TRUE(base::CreateDirectory(src_path)); ASSERT_TRUE(file_util::WriteFile(src_path.AppendASCII("a_key.pem"), private_key, arraysize(private_key))); @@ -383,7 +383,7 @@ TEST_F(ExtensionFileUtilTest, WarnOnPrivateKey) { ASSERT_TRUE(temp.CreateUniqueTempDir()); base::FilePath ext_path = temp.path().AppendASCII("ext_root"); - ASSERT_TRUE(file_util::CreateDirectory(ext_path)); + ASSERT_TRUE(base::CreateDirectory(ext_path)); const char manifest[] = "{\n" diff --git a/chrome/common/extensions/extension_l10n_util_unittest.cc b/chrome/common/extensions/extension_l10n_util_unittest.cc index 8ba14de..9004b10 100644 --- a/chrome/common/extensions/extension_l10n_util_unittest.cc +++ b/chrome/common/extensions/extension_l10n_util_unittest.cc @@ -35,7 +35,7 @@ TEST(ExtensionL10nUtil, ValidateLocalesWithBadLocale) { base::FilePath src_path = temp.path().Append(kLocaleFolder); base::FilePath locale = src_path.AppendASCII("ms"); - ASSERT_TRUE(file_util::CreateDirectory(locale)); + ASSERT_TRUE(base::CreateDirectory(locale)); base::FilePath messages_file = locale.Append(kMessagesFilename); std::string data = "{ \"name\":"; @@ -56,7 +56,7 @@ TEST(ExtensionL10nUtil, GetValidLocalesEmptyLocaleFolder) { ASSERT_TRUE(temp.CreateUniqueTempDir()); base::FilePath src_path = temp.path().Append(kLocaleFolder); - ASSERT_TRUE(file_util::CreateDirectory(src_path)); + ASSERT_TRUE(base::CreateDirectory(src_path)); std::string error; std::set<std::string> locales; @@ -72,8 +72,8 @@ TEST(ExtensionL10nUtil, GetValidLocalesWithValidLocaleNoMessagesFile) { ASSERT_TRUE(temp.CreateUniqueTempDir()); base::FilePath src_path = temp.path().Append(kLocaleFolder); - ASSERT_TRUE(file_util::CreateDirectory(src_path)); - ASSERT_TRUE(file_util::CreateDirectory(src_path.AppendASCII("sr"))); + ASSERT_TRUE(base::CreateDirectory(src_path)); + ASSERT_TRUE(base::CreateDirectory(src_path.AppendASCII("sr"))); std::string error; std::set<std::string> locales; @@ -89,16 +89,16 @@ TEST(ExtensionL10nUtil, GetValidLocalesWithUnsupportedLocale) { ASSERT_TRUE(temp.CreateUniqueTempDir()); base::FilePath src_path = temp.path().Append(kLocaleFolder); - ASSERT_TRUE(file_util::CreateDirectory(src_path)); + ASSERT_TRUE(base::CreateDirectory(src_path)); // Supported locale. base::FilePath locale_1 = src_path.AppendASCII("sr"); - ASSERT_TRUE(file_util::CreateDirectory(locale_1)); + ASSERT_TRUE(base::CreateDirectory(locale_1)); std::string data("whatever"); ASSERT_TRUE(file_util::WriteFile( locale_1.Append(kMessagesFilename), data.c_str(), data.length())); // Unsupported locale. - ASSERT_TRUE(file_util::CreateDirectory(src_path.AppendASCII("xxx_yyy"))); + ASSERT_TRUE(base::CreateDirectory(src_path.AppendASCII("xxx_yyy"))); std::string error; std::set<std::string> locales; @@ -161,7 +161,7 @@ TEST(ExtensionL10nUtil, LoadMessageCatalogsMissingFiles) { ASSERT_TRUE(temp.CreateUniqueTempDir()); base::FilePath src_path = temp.path().Append(kLocaleFolder); - ASSERT_TRUE(file_util::CreateDirectory(src_path)); + ASSERT_TRUE(base::CreateDirectory(src_path)); std::set<std::string> valid_locales; valid_locales.insert("sr"); @@ -180,10 +180,10 @@ TEST(ExtensionL10nUtil, LoadMessageCatalogsBadJSONFormat) { ASSERT_TRUE(temp.CreateUniqueTempDir()); base::FilePath src_path = temp.path().Append(kLocaleFolder); - ASSERT_TRUE(file_util::CreateDirectory(src_path)); + ASSERT_TRUE(base::CreateDirectory(src_path)); base::FilePath locale = src_path.AppendASCII("sr"); - ASSERT_TRUE(file_util::CreateDirectory(locale)); + ASSERT_TRUE(base::CreateDirectory(locale)); std::string data = "{ \"name\":"; base::FilePath messages_file = locale.Append(kMessagesFilename); @@ -211,10 +211,10 @@ TEST(ExtensionL10nUtil, LoadMessageCatalogsDuplicateKeys) { ASSERT_TRUE(temp.CreateUniqueTempDir()); base::FilePath src_path = temp.path().Append(kLocaleFolder); - ASSERT_TRUE(file_util::CreateDirectory(src_path)); + ASSERT_TRUE(base::CreateDirectory(src_path)); base::FilePath locale_1 = src_path.AppendASCII("en"); - ASSERT_TRUE(file_util::CreateDirectory(locale_1)); + ASSERT_TRUE(base::CreateDirectory(locale_1)); std::string data = "{ \"name\": { \"message\": \"something\" }, " @@ -224,7 +224,7 @@ TEST(ExtensionL10nUtil, LoadMessageCatalogsDuplicateKeys) { data.c_str(), data.length())); base::FilePath locale_2 = src_path.AppendASCII("sr"); - ASSERT_TRUE(file_util::CreateDirectory(locale_2)); + ASSERT_TRUE(base::CreateDirectory(locale_2)); ASSERT_TRUE( file_util::WriteFile(locale_2.Append(kMessagesFilename), diff --git a/chrome/common/mac/mock_launchd.cc b/chrome/common/mac/mock_launchd.cc index 361629f..63975fe 100644 --- a/chrome/common/mac/mock_launchd.cc +++ b/chrome/common/mac/mock_launchd.cc @@ -37,7 +37,7 @@ bool MockLaunchd::MakeABundle(const base::FilePath& dst, *executable = mac_os.Append(name); base::FilePath info_plist = contents.Append("Info.plist"); - if (!file_util::CreateDirectory(mac_os)) { + if (!base::CreateDirectory(mac_os)) { return false; } const char *data = "#! testbundle\n"; diff --git a/chrome/common/net/url_fixer_upper_unittest.cc b/chrome/common/net/url_fixer_upper_unittest.cc index 6efb6bc..ea80c73 100644 --- a/chrome/common/net/url_fixer_upper_unittest.cc +++ b/chrome/common/net/url_fixer_upper_unittest.cc @@ -501,7 +501,7 @@ TEST(URLFixerUpperTest, FixupRelativeFile) { base::FilePath sub_file( FILE_PATH_LITERAL("url fixer-upper existing file.txt")); base::FilePath new_dir = dir.Append(sub_dir); - file_util::CreateDirectory(new_dir); + base::CreateDirectory(new_dir); ASSERT_TRUE(MakeTempFile(new_dir, sub_file, &full_path)); full_path = base::MakeAbsoluteFilePath(full_path); ASSERT_FALSE(full_path.empty()); diff --git a/chrome/installer/setup/install_unittest.cc b/chrome/installer/setup/install_unittest.cc index 7259256..2350a14 100644 --- a/chrome/installer/setup/install_unittest.cc +++ b/chrome/installer/setup/install_unittest.cc @@ -41,7 +41,7 @@ class CreateVisualElementsManifestTest : public testing::Test { version_ = Version("0.0.0.0"); version_dir_ = test_dir_.path().AppendASCII(version_.GetString()); - ASSERT_TRUE(file_util::CreateDirectory(version_dir_)); + ASSERT_TRUE(base::CreateDirectory(version_dir_)); manifest_path_ = test_dir_.path().Append(installer::kVisualElementsManifest); @@ -228,7 +228,7 @@ TEST_F(CreateVisualElementsManifestTest, VisualElementsManifestNotCreated) { // Test that VisualElementsManifest.xml is created with the correct content when // VisualElements are present. TEST_F(CreateVisualElementsManifestTest, VisualElementsManifestCreated) { - ASSERT_TRUE(file_util::CreateDirectory( + ASSERT_TRUE(base::CreateDirectory( version_dir_.Append(installer::kVisualElements))); ASSERT_TRUE( installer::CreateVisualElementsManifest(test_dir_.path(), version_)); @@ -330,7 +330,7 @@ TEST_F(InstallShortcutTest, ReplaceAll) { ASSERT_TRUE(base::win::CreateOrUpdateShortcutLink( user_quick_launch_shortcut_, dummy_properties, base::win::SHORTCUT_CREATE_ALWAYS)); - ASSERT_TRUE(file_util::CreateDirectory(user_start_menu_shortcut_.DirName())); + ASSERT_TRUE(base::CreateDirectory(user_start_menu_shortcut_.DirName())); ASSERT_TRUE(base::win::CreateOrUpdateShortcutLink( user_start_menu_shortcut_, dummy_properties, base::win::SHORTCUT_CREATE_ALWAYS)); @@ -357,7 +357,7 @@ TEST_F(InstallShortcutTest, ReplaceExisting) { ASSERT_TRUE(base::win::CreateOrUpdateShortcutLink( user_desktop_shortcut_, dummy_properties, base::win::SHORTCUT_CREATE_ALWAYS)); - ASSERT_TRUE(file_util::CreateDirectory(user_start_menu_shortcut_.DirName())); + ASSERT_TRUE(base::CreateDirectory(user_start_menu_shortcut_.DirName())); installer::CreateOrUpdateShortcuts( chrome_exe_, *product_, *prefs_, installer::CURRENT_USER, @@ -379,7 +379,7 @@ TEST_F(InstallShortcutTest, CreateIfNoSystemLevelAllSystemShortcutsExist) { ASSERT_TRUE(base::win::CreateOrUpdateShortcutLink( system_quick_launch_shortcut_, dummy_properties, base::win::SHORTCUT_CREATE_ALWAYS)); - ASSERT_TRUE(file_util::CreateDirectory( + ASSERT_TRUE(base::CreateDirectory( system_start_menu_shortcut_.DirName())); ASSERT_TRUE(base::win::CreateOrUpdateShortcutLink( system_start_menu_shortcut_, dummy_properties, diff --git a/chrome/installer/setup/setup_main.cc b/chrome/installer/setup/setup_main.cc index 2789f31..a7257b1 100644 --- a/chrome/installer/setup/setup_main.cc +++ b/chrome/installer/setup/setup_main.cc @@ -900,7 +900,7 @@ bool CreateEULASentinel(BrowserDistribution* dist) { return false; } - return (file_util::CreateDirectory(eula_sentinel.DirName()) && + return (base::CreateDirectory(eula_sentinel.DirName()) && file_util::WriteFile(eula_sentinel, "", 0) != -1); } diff --git a/chrome/installer/setup/setup_util_unittest.cc b/chrome/installer/setup/setup_util_unittest.cc index 3a02f28..0e06efb 100644 --- a/chrome/installer/setup/setup_util_unittest.cc +++ b/chrome/installer/setup/setup_util_unittest.cc @@ -100,7 +100,7 @@ bool CurrentProcessHasPrivilege(const wchar_t* privilege_name) { TEST_F(SetupUtilTestWithDir, GetMaxVersionFromArchiveDirTest) { // Create a version dir base::FilePath chrome_dir = test_dir_.path().AppendASCII("1.0.0.0"); - file_util::CreateDirectory(chrome_dir); + base::CreateDirectory(chrome_dir); ASSERT_TRUE(base::PathExists(chrome_dir)); scoped_ptr<Version> version( installer::GetMaxVersionFromArchiveDir(test_dir_.path())); @@ -111,22 +111,22 @@ TEST_F(SetupUtilTestWithDir, GetMaxVersionFromArchiveDirTest) { ASSERT_TRUE(installer::GetMaxVersionFromArchiveDir(test_dir_.path()) == NULL); chrome_dir = test_dir_.path().AppendASCII("ABC"); - file_util::CreateDirectory(chrome_dir); + base::CreateDirectory(chrome_dir); ASSERT_TRUE(base::PathExists(chrome_dir)); ASSERT_TRUE(installer::GetMaxVersionFromArchiveDir(test_dir_.path()) == NULL); chrome_dir = test_dir_.path().AppendASCII("2.3.4.5"); - file_util::CreateDirectory(chrome_dir); + base::CreateDirectory(chrome_dir); ASSERT_TRUE(base::PathExists(chrome_dir)); version.reset(installer::GetMaxVersionFromArchiveDir(test_dir_.path())); ASSERT_EQ(version->GetString(), "2.3.4.5"); // Create multiple version dirs, ensure that we select the greatest. chrome_dir = test_dir_.path().AppendASCII("9.9.9.9"); - file_util::CreateDirectory(chrome_dir); + base::CreateDirectory(chrome_dir); ASSERT_TRUE(base::PathExists(chrome_dir)); chrome_dir = test_dir_.path().AppendASCII("1.1.1.1"); - file_util::CreateDirectory(chrome_dir); + base::CreateDirectory(chrome_dir); ASSERT_TRUE(base::PathExists(chrome_dir)); version.reset(installer::GetMaxVersionFromArchiveDir(test_dir_.path())); @@ -306,10 +306,10 @@ class FindArchiveToPatchTest : public SetupUtilTestWithDir { // Create archives in the two version dirs. ASSERT_TRUE( - file_util::CreateDirectory(GetProductVersionArchivePath().DirName())); + base::CreateDirectory(GetProductVersionArchivePath().DirName())); ASSERT_EQ(1, file_util::WriteFile(GetProductVersionArchivePath(), "a", 1)); ASSERT_TRUE( - file_util::CreateDirectory(GetMaxVersionArchivePath().DirName())); + base::CreateDirectory(GetMaxVersionArchivePath().DirName())); ASSERT_EQ(1, file_util::WriteFile(GetMaxVersionArchivePath(), "b", 1)); } diff --git a/chrome/installer/util/copy_tree_work_item_unittest.cc b/chrome/installer/util/copy_tree_work_item_unittest.cc index 3d6fb04..72bdc56 100644 --- a/chrome/installer/util/copy_tree_work_item_unittest.cc +++ b/chrome/installer/util/copy_tree_work_item_unittest.cc @@ -84,7 +84,7 @@ TEST_F(CopyTreeWorkItemTest, CopyFile) { // Create destination path base::FilePath dir_name_to(test_dir_.path()); dir_name_to = dir_name_to.AppendASCII("Copy_To_Subdir"); - file_util::CreateDirectory(dir_name_to); + base::CreateDirectory(dir_name_to); ASSERT_TRUE(base::PathExists(dir_name_to)); base::FilePath file_name_to(dir_name_to); @@ -124,7 +124,7 @@ TEST_F(CopyTreeWorkItemTest, CopyFileOverwrite) { // Create destination file base::FilePath dir_name_to(test_dir_.path()); dir_name_to = dir_name_to.AppendASCII("Copy_To_Subdir"); - file_util::CreateDirectory(dir_name_to); + base::CreateDirectory(dir_name_to); ASSERT_TRUE(base::PathExists(dir_name_to)); base::FilePath file_name_to(dir_name_to); @@ -194,7 +194,7 @@ TEST_F(CopyTreeWorkItemTest, CopyFileSameContent) { // Create destination file base::FilePath dir_name_to(test_dir_.path()); dir_name_to = dir_name_to.AppendASCII("Copy_To_Subdir"); - file_util::CreateDirectory(dir_name_to); + base::CreateDirectory(dir_name_to); ASSERT_TRUE(base::PathExists(dir_name_to)); base::FilePath file_name_to(dir_name_to); @@ -275,7 +275,7 @@ TEST_F(CopyTreeWorkItemTest, CopyFileAndCleanup) { // Create destination file base::FilePath dir_name_to(test_dir_.path()); dir_name_to = dir_name_to.AppendASCII("Copy_To_Subdir"); - file_util::CreateDirectory(dir_name_to); + base::CreateDirectory(dir_name_to); ASSERT_TRUE(base::PathExists(dir_name_to)); base::FilePath file_name_to(dir_name_to); @@ -331,7 +331,7 @@ TEST_F(CopyTreeWorkItemTest, CopyFileInUse) { base::FilePath dir_name_to(test_dir_.path()); dir_name_to = dir_name_to.AppendASCII("Copy_To_Subdir"); - file_util::CreateDirectory(dir_name_to); + base::CreateDirectory(dir_name_to); ASSERT_TRUE(base::PathExists(dir_name_to)); base::FilePath file_name_to(dir_name_to); @@ -410,7 +410,7 @@ TEST_F(CopyTreeWorkItemTest, NewNameAndCopyTest) { base::FilePath dir_name_to(test_dir_.path()); dir_name_to = dir_name_to.AppendASCII("Copy_To_Subdir"); - file_util::CreateDirectory(dir_name_to); + base::CreateDirectory(dir_name_to); ASSERT_TRUE(base::PathExists(dir_name_to)); base::FilePath file_name_to(dir_name_to), alternate_to(dir_name_to); @@ -521,7 +521,7 @@ TEST_F(CopyTreeWorkItemTest, DISABLED_IfNotPresentTest) { base::FilePath dir_name_to(test_dir_.path()); dir_name_to = dir_name_to.AppendASCII("Copy_To_Subdir"); - file_util::CreateDirectory(dir_name_to); + base::CreateDirectory(dir_name_to); ASSERT_TRUE(base::PathExists(dir_name_to)); base::FilePath file_name_to(dir_name_to); file_name_to = file_name_to.AppendASCII("File_To"); @@ -603,7 +603,7 @@ TEST_F(CopyTreeWorkItemTest, DISABLED_CopyFileInUseAndCleanup) { base::FilePath dir_name_to(test_dir_.path()); dir_name_to = dir_name_to.AppendASCII("Copy_To_Subdir"); - file_util::CreateDirectory(dir_name_to); + base::CreateDirectory(dir_name_to); ASSERT_TRUE(base::PathExists(dir_name_to)); base::FilePath file_name_to(dir_name_to); @@ -666,17 +666,17 @@ TEST_F(CopyTreeWorkItemTest, DISABLED_CopyTree) { // Create source tree base::FilePath dir_name_from(test_dir_.path()); dir_name_from = dir_name_from.AppendASCII("from"); - file_util::CreateDirectory(dir_name_from); + base::CreateDirectory(dir_name_from); ASSERT_TRUE(base::PathExists(dir_name_from)); base::FilePath dir_name_from_1(dir_name_from); dir_name_from_1 = dir_name_from_1.AppendASCII("1"); - file_util::CreateDirectory(dir_name_from_1); + base::CreateDirectory(dir_name_from_1); ASSERT_TRUE(base::PathExists(dir_name_from_1)); base::FilePath dir_name_from_2(dir_name_from); dir_name_from_2 = dir_name_from_2.AppendASCII("2"); - file_util::CreateDirectory(dir_name_from_2); + base::CreateDirectory(dir_name_from_2); ASSERT_TRUE(base::PathExists(dir_name_from_2)); base::FilePath file_name_from_1(dir_name_from_1); diff --git a/chrome/installer/util/create_dir_work_item.cc b/chrome/installer/util/create_dir_work_item.cc index 2e1ffa3..1eff7bf 100644 --- a/chrome/installer/util/create_dir_work_item.cc +++ b/chrome/installer/util/create_dir_work_item.cc @@ -36,7 +36,7 @@ bool CreateDirWorkItem::Do() { return true; VLOG(1) << "top directory that needs to be created: " << top_path_.value(); - bool result = file_util::CreateDirectory(path_); + bool result = base::CreateDirectory(path_); VLOG(1) << "directory creation result: " << result; rollback_needed_ = true; diff --git a/chrome/installer/util/create_dir_work_item_unittest.cc b/chrome/installer/util/create_dir_work_item_unittest.cc index ba3e81b..9ac5d56 100644 --- a/chrome/installer/util/create_dir_work_item_unittest.cc +++ b/chrome/installer/util/create_dir_work_item_unittest.cc @@ -28,7 +28,7 @@ namespace { TEST_F(CreateDirWorkItemTest, CreatePath) { base::FilePath parent_dir(temp_dir_.path()); parent_dir = parent_dir.AppendASCII("a"); - file_util::CreateDirectory(parent_dir); + base::CreateDirectory(parent_dir); ASSERT_TRUE(base::PathExists(parent_dir)); base::FilePath top_dir_to_create(parent_dir); @@ -55,7 +55,7 @@ TEST_F(CreateDirWorkItemTest, CreatePath) { TEST_F(CreateDirWorkItemTest, CreateExistingPath) { base::FilePath dir_to_create(temp_dir_.path()); dir_to_create = dir_to_create.AppendASCII("aa"); - file_util::CreateDirectory(dir_to_create); + base::CreateDirectory(dir_to_create); ASSERT_TRUE(base::PathExists(dir_to_create)); scoped_ptr<CreateDirWorkItem> work_item( @@ -92,7 +92,7 @@ TEST_F(CreateDirWorkItemTest, CreateSharedPath) { // Create another directory under dir_to_create_2 base::FilePath dir_to_create_4(dir_to_create_2); dir_to_create_4 = dir_to_create_4.AppendASCII("ddd"); - file_util::CreateDirectory(dir_to_create_4); + base::CreateDirectory(dir_to_create_4); ASSERT_TRUE(base::PathExists(dir_to_create_4)); work_item->Rollback(); diff --git a/chrome/installer/util/delete_after_reboot_helper_unittest.cc b/chrome/installer/util/delete_after_reboot_helper_unittest.cc index d5a65812..f114b85 100644 --- a/chrome/installer/util/delete_after_reboot_helper_unittest.cc +++ b/chrome/installer/util/delete_after_reboot_helper_unittest.cc @@ -28,7 +28,7 @@ class DeleteAfterRebootHelperTest : public testing::Test { base::CreateTemporaryFileInDir(temp_dir_, &temp_file_); temp_subdir_ = temp_dir_.Append(L"subdir"); - file_util::CreateDirectory(temp_subdir_); + base::CreateDirectory(temp_subdir_); base::CreateTemporaryFileInDir(temp_subdir_, &temp_subdir_file_); // Copy the current pending moves and then clear it if we can: diff --git a/chrome/installer/util/delete_tree_work_item_unittest.cc b/chrome/installer/util/delete_tree_work_item_unittest.cc index 91b7c8a..069f772 100644 --- a/chrome/installer/util/delete_tree_work_item_unittest.cc +++ b/chrome/installer/util/delete_tree_work_item_unittest.cc @@ -47,17 +47,17 @@ TEST_F(DeleteTreeWorkItemTest, DeleteTreeNoKeyPath) { // Create tree to be deleted. base::FilePath dir_name_delete(temp_dir_.path()); dir_name_delete = dir_name_delete.AppendASCII("to_be_delete"); - file_util::CreateDirectory(dir_name_delete); + base::CreateDirectory(dir_name_delete); ASSERT_TRUE(base::PathExists(dir_name_delete)); base::FilePath dir_name_delete_1(dir_name_delete); dir_name_delete_1 = dir_name_delete_1.AppendASCII("1"); - file_util::CreateDirectory(dir_name_delete_1); + base::CreateDirectory(dir_name_delete_1); ASSERT_TRUE(base::PathExists(dir_name_delete_1)); base::FilePath dir_name_delete_2(dir_name_delete); dir_name_delete_2 = dir_name_delete_2.AppendASCII("2"); - file_util::CreateDirectory(dir_name_delete_2); + base::CreateDirectory(dir_name_delete_2); ASSERT_TRUE(base::PathExists(dir_name_delete_2)); base::FilePath file_name_delete_1(dir_name_delete_1); @@ -99,17 +99,17 @@ TEST_F(DeleteTreeWorkItemTest, DeleteTree) { // Create tree to be deleted base::FilePath dir_name_delete(temp_dir_.path()); dir_name_delete = dir_name_delete.AppendASCII("to_be_delete"); - file_util::CreateDirectory(dir_name_delete); + base::CreateDirectory(dir_name_delete); ASSERT_TRUE(base::PathExists(dir_name_delete)); base::FilePath dir_name_delete_1(dir_name_delete); dir_name_delete_1 = dir_name_delete_1.AppendASCII("1"); - file_util::CreateDirectory(dir_name_delete_1); + base::CreateDirectory(dir_name_delete_1); ASSERT_TRUE(base::PathExists(dir_name_delete_1)); base::FilePath dir_name_delete_2(dir_name_delete); dir_name_delete_2 = dir_name_delete_2.AppendASCII("2"); - file_util::CreateDirectory(dir_name_delete_2); + base::CreateDirectory(dir_name_delete_2); ASSERT_TRUE(base::PathExists(dir_name_delete_2)); base::FilePath file_name_delete_1(dir_name_delete_1); @@ -149,17 +149,17 @@ TEST_F(DeleteTreeWorkItemTest, DeleteTreeInUse) { // Create tree to be deleted base::FilePath dir_name_delete(temp_dir_.path()); dir_name_delete = dir_name_delete.AppendASCII("to_be_delete"); - file_util::CreateDirectory(dir_name_delete); + base::CreateDirectory(dir_name_delete); ASSERT_TRUE(base::PathExists(dir_name_delete)); base::FilePath dir_name_delete_1(dir_name_delete); dir_name_delete_1 = dir_name_delete_1.AppendASCII("1"); - file_util::CreateDirectory(dir_name_delete_1); + base::CreateDirectory(dir_name_delete_1); ASSERT_TRUE(base::PathExists(dir_name_delete_1)); base::FilePath dir_name_delete_2(dir_name_delete); dir_name_delete_2 = dir_name_delete_2.AppendASCII("2"); - file_util::CreateDirectory(dir_name_delete_2); + base::CreateDirectory(dir_name_delete_2); ASSERT_TRUE(base::PathExists(dir_name_delete_2)); base::FilePath file_name_delete_1(dir_name_delete_1); diff --git a/chrome/installer/util/duplicate_tree_detector_unittest.cc b/chrome/installer/util/duplicate_tree_detector_unittest.cc index 6a97d84..4b636ee 100644 --- a/chrome/installer/util/duplicate_tree_detector_unittest.cc +++ b/chrome/installer/util/duplicate_tree_detector_unittest.cc @@ -39,7 +39,7 @@ class DuplicateTreeDetectorTest : public testing::Test { const base::FilePath& second_root) { base::FilePath d1(first_root); d1 = d1.AppendASCII("D1"); - file_util::CreateDirectory(d1); + base::CreateDirectory(d1); ASSERT_TRUE(base::PathExists(d1)); base::FilePath f1(d1); @@ -49,7 +49,7 @@ class DuplicateTreeDetectorTest : public testing::Test { base::FilePath d2(d1); d2 = d2.AppendASCII("D2"); - file_util::CreateDirectory(d2); + base::CreateDirectory(d2); ASSERT_TRUE(base::PathExists(d2)); base::FilePath f2(d2); diff --git a/chrome/installer/util/install_util_unittest.cc b/chrome/installer/util/install_util_unittest.cc index 769c62d..9d37df5 100644 --- a/chrome/installer/util/install_util_unittest.cc +++ b/chrome/installer/util/install_util_unittest.cc @@ -416,7 +416,7 @@ TEST_F(InstallUtilTest, ProgramCompare) { // Tests where the expected file exists. static const char data[] = "data"; - ASSERT_TRUE(file_util::CreateDirectory(some_long_dir)); + ASSERT_TRUE(base::CreateDirectory(some_long_dir)); ASSERT_NE(-1, file_util::WriteFile(expect, data, arraysize(data) - 1)); // Paths don't match. EXPECT_FALSE(InstallUtil::ProgramCompare(expect).Evaluate( diff --git a/chrome/installer/util/installer_state_unittest.cc b/chrome/installer/util/installer_state_unittest.cc index a085817..cf52474 100644 --- a/chrome/installer/util/installer_state_unittest.cc +++ b/chrome/installer/util/installer_state_unittest.cc @@ -97,27 +97,27 @@ TEST_F(InstallerStateTest, Delete) { // Create a Chrome dir base::FilePath chrome_dir(test_dir_.path()); chrome_dir = chrome_dir.AppendASCII("chrome"); - file_util::CreateDirectory(chrome_dir); + base::CreateDirectory(chrome_dir); ASSERT_TRUE(base::PathExists(chrome_dir)); base::FilePath chrome_dir_1(chrome_dir); chrome_dir_1 = chrome_dir_1.AppendASCII("1.0.1.0"); - file_util::CreateDirectory(chrome_dir_1); + base::CreateDirectory(chrome_dir_1); ASSERT_TRUE(base::PathExists(chrome_dir_1)); base::FilePath chrome_dir_2(chrome_dir); chrome_dir_2 = chrome_dir_2.AppendASCII("1.0.2.0"); - file_util::CreateDirectory(chrome_dir_2); + base::CreateDirectory(chrome_dir_2); ASSERT_TRUE(base::PathExists(chrome_dir_2)); base::FilePath chrome_dir_3(chrome_dir); chrome_dir_3 = chrome_dir_3.AppendASCII("1.0.3.0"); - file_util::CreateDirectory(chrome_dir_3); + base::CreateDirectory(chrome_dir_3); ASSERT_TRUE(base::PathExists(chrome_dir_3)); base::FilePath chrome_dir_4(chrome_dir); chrome_dir_4 = chrome_dir_4.AppendASCII("1.0.4.0"); - file_util::CreateDirectory(chrome_dir_4); + base::CreateDirectory(chrome_dir_4); ASSERT_TRUE(base::PathExists(chrome_dir_4)); base::FilePath chrome_dll_1(chrome_dir_1); @@ -163,27 +163,27 @@ TEST_F(InstallerStateTest, DeleteInUsed) { // Create a Chrome dir base::FilePath chrome_dir(test_dir_.path()); chrome_dir = chrome_dir.AppendASCII("chrome"); - file_util::CreateDirectory(chrome_dir); + base::CreateDirectory(chrome_dir); ASSERT_TRUE(base::PathExists(chrome_dir)); base::FilePath chrome_dir_1(chrome_dir); chrome_dir_1 = chrome_dir_1.AppendASCII("1.0.1.0"); - file_util::CreateDirectory(chrome_dir_1); + base::CreateDirectory(chrome_dir_1); ASSERT_TRUE(base::PathExists(chrome_dir_1)); base::FilePath chrome_dir_2(chrome_dir); chrome_dir_2 = chrome_dir_2.AppendASCII("1.0.2.0"); - file_util::CreateDirectory(chrome_dir_2); + base::CreateDirectory(chrome_dir_2); ASSERT_TRUE(base::PathExists(chrome_dir_2)); base::FilePath chrome_dir_3(chrome_dir); chrome_dir_3 = chrome_dir_3.AppendASCII("1.0.3.0"); - file_util::CreateDirectory(chrome_dir_3); + base::CreateDirectory(chrome_dir_3); ASSERT_TRUE(base::PathExists(chrome_dir_3)); base::FilePath chrome_dir_4(chrome_dir); chrome_dir_4 = chrome_dir_4.AppendASCII("1.0.4.0"); - file_util::CreateDirectory(chrome_dir_4); + base::CreateDirectory(chrome_dir_4); ASSERT_TRUE(base::PathExists(chrome_dir_4)); base::FilePath chrome_dll_1(chrome_dir_1); @@ -284,10 +284,10 @@ TEST_F(InstallerStateTest, Basic) { EXPECT_FALSE(base::PathExists(old_version_dir)); EXPECT_FALSE(base::PathExists(installer_dir)); - file_util::CreateDirectory(installer_dir); + base::CreateDirectory(installer_dir); EXPECT_TRUE(base::PathExists(new_version_dir)); - file_util::CreateDirectory(old_version_dir); + base::CreateDirectory(old_version_dir); EXPECT_TRUE(base::PathExists(old_version_dir)); // Create a fake chrome.dll key file in the old version directory. This @@ -534,7 +534,7 @@ TEST_F(InstallerStateTest, RemoveOldVersionDirs) { // Create the version directories. for (int i = 0; i < arraysize(version_dirs); i++) { - file_util::CreateDirectory(version_dirs[i]); + base::CreateDirectory(version_dirs[i]); EXPECT_TRUE(base::PathExists(version_dirs[i])); } diff --git a/chrome/installer/util/lzma_util.cc b/chrome/installer/util/lzma_util.cc index 543ab4f..324acd5 100644 --- a/chrome/installer/util/lzma_util.cc +++ b/chrome/installer/util/lzma_util.cc @@ -242,7 +242,7 @@ void LzmaUtil::CloseArchive() { bool LzmaUtil::CreateDirectory(const base::FilePath& dir) { bool ret = true; if (directories_created_.find(dir.value()) == directories_created_.end()) { - ret = file_util::CreateDirectory(dir); + ret = base::CreateDirectory(dir); if (ret) directories_created_.insert(dir.value()); } diff --git a/chrome/installer/util/lzma_util_unittest.cc b/chrome/installer/util/lzma_util_unittest.cc index e90c3f9..cc0b8e6 100644 --- a/chrome/installer/util/lzma_util_unittest.cc +++ b/chrome/installer/util/lzma_util_unittest.cc @@ -55,7 +55,7 @@ TEST_F(LzmaUtilTest, UnPackTest) { base::FilePath extract_dir(temp_dir_.path()); extract_dir = extract_dir.AppendASCII("UnPackTest"); ASSERT_FALSE(base::PathExists(extract_dir)); - EXPECT_TRUE(file_util::CreateDirectory(extract_dir)); + EXPECT_TRUE(base::CreateDirectory(extract_dir)); ASSERT_TRUE(base::PathExists(extract_dir)); base::FilePath archive = data_dir_.AppendASCII("archive1.7z"); @@ -96,7 +96,7 @@ TEST_F(LzmaUtilTest, UnPackArchiveTest) { base::FilePath extract_dir(temp_dir_.path()); extract_dir = extract_dir.AppendASCII("UnPackArchiveTest"); ASSERT_FALSE(base::PathExists(extract_dir)); - EXPECT_TRUE(file_util::CreateDirectory(extract_dir)); + EXPECT_TRUE(base::CreateDirectory(extract_dir)); ASSERT_TRUE(base::PathExists(extract_dir)); base::FilePath archive = data_dir_.AppendASCII("archive1.7z"); diff --git a/chrome/installer/util/move_tree_work_item_unittest.cc b/chrome/installer/util/move_tree_work_item_unittest.cc index ef0c252..e51d88f 100644 --- a/chrome/installer/util/move_tree_work_item_unittest.cc +++ b/chrome/installer/util/move_tree_work_item_unittest.cc @@ -60,12 +60,12 @@ TEST_F(MoveTreeWorkItemTest, MoveDirectory) { // Create two level deep source dir base::FilePath from_dir1(temp_from_dir_.path()); from_dir1 = from_dir1.AppendASCII("From_Dir1"); - file_util::CreateDirectory(from_dir1); + base::CreateDirectory(from_dir1); ASSERT_TRUE(base::PathExists(from_dir1)); base::FilePath from_dir2(from_dir1); from_dir2 = from_dir2.AppendASCII("From_Dir2"); - file_util::CreateDirectory(from_dir2); + base::CreateDirectory(from_dir2); ASSERT_TRUE(base::PathExists(from_dir2)); base::FilePath from_file(from_dir2); @@ -109,12 +109,12 @@ TEST_F(MoveTreeWorkItemTest, MoveDirectoryDestExists) { // Create two level deep source dir base::FilePath from_dir1(temp_from_dir_.path()); from_dir1 = from_dir1.AppendASCII("From_Dir1"); - file_util::CreateDirectory(from_dir1); + base::CreateDirectory(from_dir1); ASSERT_TRUE(base::PathExists(from_dir1)); base::FilePath from_dir2(from_dir1); from_dir2 = from_dir2.AppendASCII("From_Dir2"); - file_util::CreateDirectory(from_dir2); + base::CreateDirectory(from_dir2); ASSERT_TRUE(base::PathExists(from_dir2)); base::FilePath from_file(from_dir2); @@ -125,7 +125,7 @@ TEST_F(MoveTreeWorkItemTest, MoveDirectoryDestExists) { // Create destination path base::FilePath to_dir(temp_from_dir_.path()); to_dir = to_dir.AppendASCII("To_Dir"); - file_util::CreateDirectory(to_dir); + base::CreateDirectory(to_dir); ASSERT_TRUE(base::PathExists(to_dir)); base::FilePath orig_to_file(to_dir); @@ -168,7 +168,7 @@ TEST_F(MoveTreeWorkItemTest, MoveAFile) { // Create a file inside source dir base::FilePath from_dir(temp_from_dir_.path()); from_dir = from_dir.AppendASCII("From_Dir"); - file_util::CreateDirectory(from_dir); + base::CreateDirectory(from_dir); ASSERT_TRUE(base::PathExists(from_dir)); base::FilePath from_file(from_dir); @@ -209,7 +209,7 @@ TEST_F(MoveTreeWorkItemTest, MoveFileDestExists) { // Create a file inside source dir base::FilePath from_dir(temp_from_dir_.path()); from_dir = from_dir.AppendASCII("From_Dir"); - file_util::CreateDirectory(from_dir); + base::CreateDirectory(from_dir); ASSERT_TRUE(base::PathExists(from_dir)); base::FilePath from_file(from_dir); @@ -220,7 +220,7 @@ TEST_F(MoveTreeWorkItemTest, MoveFileDestExists) { // Create destination path base::FilePath to_dir(temp_from_dir_.path()); to_dir = to_dir.AppendASCII("To_Dir"); - file_util::CreateDirectory(to_dir); + base::CreateDirectory(to_dir); ASSERT_TRUE(base::PathExists(to_dir)); base::FilePath to_file(to_dir); @@ -257,7 +257,7 @@ TEST_F(MoveTreeWorkItemTest, MoveFileDestInUse) { // Create a file inside source dir base::FilePath from_dir(temp_from_dir_.path()); from_dir = from_dir.AppendASCII("From_Dir"); - file_util::CreateDirectory(from_dir); + base::CreateDirectory(from_dir); ASSERT_TRUE(base::PathExists(from_dir)); base::FilePath from_file(from_dir); @@ -268,7 +268,7 @@ TEST_F(MoveTreeWorkItemTest, MoveFileDestInUse) { // Create an executable in destination path by copying ourself to it. base::FilePath to_dir(temp_from_dir_.path()); to_dir = to_dir.AppendASCII("To_Dir"); - file_util::CreateDirectory(to_dir); + base::CreateDirectory(to_dir); ASSERT_TRUE(base::PathExists(to_dir)); wchar_t exe_full_path_str[MAX_PATH]; @@ -320,7 +320,7 @@ TEST_F(MoveTreeWorkItemTest, MoveFileInUse) { // Create an executable for source by copying ourself to a new source dir. base::FilePath from_dir(temp_from_dir_.path()); from_dir = from_dir.AppendASCII("From_Dir"); - file_util::CreateDirectory(from_dir); + base::CreateDirectory(from_dir); ASSERT_TRUE(base::PathExists(from_dir)); wchar_t exe_full_path_str[MAX_PATH]; @@ -334,7 +334,7 @@ TEST_F(MoveTreeWorkItemTest, MoveFileInUse) { // Create a destination source dir and generate destination file name. base::FilePath to_dir(temp_from_dir_.path()); to_dir = to_dir.AppendASCII("To_Dir"); - file_util::CreateDirectory(to_dir); + base::CreateDirectory(to_dir); ASSERT_TRUE(base::PathExists(to_dir)); base::FilePath to_file(to_dir); @@ -391,12 +391,12 @@ TEST_F(MoveTreeWorkItemTest, MoveDirectoryDestExistsCheckForDuplicatesFull) { // Create two level deep source dir base::FilePath from_dir1(temp_from_dir_.path()); from_dir1 = from_dir1.AppendASCII("From_Dir1"); - file_util::CreateDirectory(from_dir1); + base::CreateDirectory(from_dir1); ASSERT_TRUE(base::PathExists(from_dir1)); base::FilePath from_dir2(from_dir1); from_dir2 = from_dir2.AppendASCII("From_Dir2"); - file_util::CreateDirectory(from_dir2); + base::CreateDirectory(from_dir2); ASSERT_TRUE(base::PathExists(from_dir2)); base::FilePath from_file(from_dir2); @@ -464,12 +464,12 @@ TEST_F(MoveTreeWorkItemTest, MoveDirectoryDestExistsCheckForDuplicatesPartial) { // Create two level deep source dir base::FilePath from_dir1(temp_from_dir_.path()); from_dir1 = from_dir1.AppendASCII("From_Dir1"); - file_util::CreateDirectory(from_dir1); + base::CreateDirectory(from_dir1); ASSERT_TRUE(base::PathExists(from_dir1)); base::FilePath from_dir2(from_dir1); from_dir2 = from_dir2.AppendASCII("From_Dir2"); - file_util::CreateDirectory(from_dir2); + base::CreateDirectory(from_dir2); ASSERT_TRUE(base::PathExists(from_dir2)); base::FilePath from_file(from_dir2); @@ -485,13 +485,13 @@ TEST_F(MoveTreeWorkItemTest, MoveDirectoryDestExistsCheckForDuplicatesPartial) { // Create destination path base::FilePath to_dir(temp_from_dir_.path()); to_dir = to_dir.AppendASCII("To_Dir"); - file_util::CreateDirectory(to_dir); + base::CreateDirectory(to_dir); ASSERT_TRUE(base::PathExists(to_dir)); // Create a sub-directory of the same name as in the source directory. base::FilePath to_dir2(to_dir); to_dir2 = to_dir2.AppendASCII("From_Dir2"); - file_util::CreateDirectory(to_dir2); + base::CreateDirectory(to_dir2); ASSERT_TRUE(base::PathExists(to_dir2)); // Create one of the files in the to sub-directory, but not the other. diff --git a/chrome/installer/util/self_cleaning_temp_dir.cc b/chrome/installer/util/self_cleaning_temp_dir.cc index 23d3091..8d62018 100644 --- a/chrome/installer/util/self_cleaning_temp_dir.cc +++ b/chrome/installer/util/self_cleaning_temp_dir.cc @@ -58,7 +58,7 @@ bool SelfCleaningTempDir::Initialize(const base::FilePath& parent_dir, base::FilePath base_dir; GetTopDirToCreate(parent_dir, &base_dir); - if (file_util::CreateDirectory(temp_dir)) { + if (base::CreateDirectory(temp_dir)) { base_dir_ = base_dir; temp_dir_ = temp_dir; return true; diff --git a/chrome/installer/util/shell_util.cc b/chrome/installer/util/shell_util.cc index 9530126..2b4aafd 100644 --- a/chrome/installer/util/shell_util.cc +++ b/chrome/installer/util/shell_util.cc @@ -1515,7 +1515,7 @@ bool ShellUtil::CreateOrUpdateShortcut( if (should_install_shortcut) { // Make sure the parent directories exist when creating the shortcut. if (shortcut_operation == base::win::SHORTCUT_CREATE_ALWAYS && - !file_util::CreateDirectory(chosen_path->DirName())) { + !base::CreateDirectory(chosen_path->DirName())) { NOTREACHED(); return false; } diff --git a/chrome/test/base/in_process_browser_test.cc b/chrome/test/base/in_process_browser_test.cc index 946b589..d808fee 100644 --- a/chrome/test/base/in_process_browser_test.cc +++ b/chrome/test/base/in_process_browser_test.cc @@ -178,7 +178,7 @@ void InProcessBrowserTest::SetUp() { #if defined(OS_CHROMEOS) // Make sure that the log directory exists. base::FilePath log_dir = logging::GetSessionLogFile(*command_line).DirName(); - file_util::CreateDirectory(log_dir); + base::CreateDirectory(log_dir); #endif // defined(OS_CHROMEOS) #if defined(OS_MACOSX) diff --git a/chrome/test/base/testing_profile.cc b/chrome/test/base/testing_profile.cc index 5770b64..4e21951 100644 --- a/chrome/test/base/testing_profile.cc +++ b/chrome/test/base/testing_profile.cc @@ -294,7 +294,7 @@ void TestingProfile::CreateTempProfileDir() { base::FilePath fallback_dir( system_tmp_dir.AppendASCII("TestingProfilePath")); base::DeleteFile(fallback_dir, true); - file_util::CreateDirectory(fallback_dir); + base::CreateDirectory(fallback_dir); if (!temp_dir_.Set(fallback_dir)) { // That shouldn't happen, but if it does, try to recover. LOG(ERROR) << "Failed to use a fallback temporary directory."; @@ -322,7 +322,7 @@ void TestingProfile::Init() { CreateTestingPrefService(); if (!base::PathExists(profile_path_)) - file_util::CreateDirectory(profile_path_); + base::CreateDirectory(profile_path_); // TODO(joaodasilva): remove this once this PKS isn't created in ProfileImpl // anymore, after converting the PrefService to a PKS. Until then it must diff --git a/chrome/test/chromedriver/chrome/zip_reader.cc b/chrome/test/chromedriver/chrome/zip_reader.cc index 25aee0c..218c8d7 100644 --- a/chrome/test/chromedriver/chrome/zip_reader.cc +++ b/chrome/test/chromedriver/chrome/zip_reader.cc @@ -192,7 +192,7 @@ bool ZipReader::ExtractCurrentEntryToFilePath( // If this is a directory, just create it and return. if (current_entry_info()->is_directory()) - return file_util::CreateDirectory(output_file_path); + return base::CreateDirectory(output_file_path); const int open_result = unzOpenCurrentFile(zip_file_); if (open_result != UNZ_OK) @@ -201,7 +201,7 @@ bool ZipReader::ExtractCurrentEntryToFilePath( // We can't rely on parent directory entries being specified in the // zip, so we make sure they are created. base::FilePath output_dir_path = output_file_path.DirName(); - if (!file_util::CreateDirectory(output_dir_path)) + if (!base::CreateDirectory(output_dir_path)) return false; net::FileStream stream(NULL); diff --git a/chrome/test/chromedriver/chrome_launcher.cc b/chrome/test/chromedriver/chrome_launcher.cc index a501143..239ae95 100644 --- a/chrome/test/chromedriver/chrome_launcher.cc +++ b/chrome/test/chromedriver/chrome_launcher.cc @@ -635,7 +635,7 @@ Status PrepareUserDataDir( const base::DictionaryValue* custom_prefs, const base::DictionaryValue* custom_local_state) { base::FilePath default_dir = user_data_dir.AppendASCII("Default"); - if (!file_util::CreateDirectory(default_dir)) + if (!base::CreateDirectory(default_dir)) return Status(kUnknownError, "cannot create default profile directory"); Status status = WritePrefsFile( diff --git a/chrome/test/perf/generate_profile.cc b/chrome/test/perf/generate_profile.cc index b3fcf66..70debd5 100644 --- a/chrome/test/perf/generate_profile.cc +++ b/chrome/test/perf/generate_profile.cc @@ -205,7 +205,7 @@ void InsertURLBatch(Profile* profile, bool GenerateProfile(GenerateProfileTypes types, int url_count, const base::FilePath& dst_dir) { - if (!file_util::CreateDirectory(dst_dir)) { + if (!base::CreateDirectory(dst_dir)) { PLOG(ERROR) << "Unable to create directory " << dst_dir.value().c_str(); return false; } diff --git a/chrome/tools/crash_service/main.cc b/chrome/tools/crash_service/main.cc index bb684bb..8bf3117 100644 --- a/chrome/tools/crash_service/main.cc +++ b/chrome/tools/crash_service/main.cc @@ -25,7 +25,7 @@ bool GetCrashServiceDirectory(base::FilePath* dir) { return false; temp_dir = temp_dir.Append(L"chrome_crashes"); if (!base::PathExists(temp_dir)) { - if (!file_util::CreateDirectory(temp_dir)) + if (!base::CreateDirectory(temp_dir)) return false; } *dir = temp_dir; diff --git a/chrome/utility/extensions/unpacker.cc b/chrome/utility/extensions/unpacker.cc index 371c59f..10b95b9 100644 --- a/chrome/utility/extensions/unpacker.cc +++ b/chrome/utility/extensions/unpacker.cc @@ -170,7 +170,7 @@ bool Unpacker::Run() { temp_install_dir_ = extension_path_.DirName().AppendASCII(kTempExtensionName); - if (!file_util::CreateDirectory(temp_install_dir_)) { + if (!base::CreateDirectory(temp_install_dir_)) { SetUTF16Error( l10n_util::GetStringFUTF16( IDS_EXTENSION_PACKAGE_DIRECTORY_ERROR, diff --git a/chrome_frame/test/dll_redirector_loading_test.cc b/chrome_frame/test/dll_redirector_loading_test.cc index c6df84d..efafa7c 100644 --- a/chrome_frame/test/dll_redirector_loading_test.cc +++ b/chrome_frame/test/dll_redirector_loading_test.cc @@ -55,7 +55,7 @@ class DllRedirectorLoadingTest : public testing::Test { // Make a versioned dir for the original chrome frame dll to run under. base::FilePath original_version_dir( temp_dir_.path().AppendASCII(original_version_->GetString())); - ASSERT_TRUE(file_util::CreateDirectory(original_version_dir)); + ASSERT_TRUE(base::CreateDirectory(original_version_dir)); // Now move the original DLL that we will operate on into a named-version // folder. @@ -90,7 +90,7 @@ class DllRedirectorLoadingTest : public testing::Test { // Now move the new Chrome Frame dll to its final resting place: base::FilePath new_version_dir( temp_dir_.path().AppendASCII(new_version_->GetString())); - ASSERT_TRUE(file_util::CreateDirectory(new_version_dir)); + ASSERT_TRUE(base::CreateDirectory(new_version_dir)); new_chrome_frame_dll_ = new_version_dir.Append(build_chrome_frame_dll.BaseName()); ASSERT_TRUE(base::Move(temporary_new_chrome_frame_dll, diff --git a/chromeos/dbus/cros_disks_client.cc b/chromeos/dbus/cros_disks_client.cc index 8a5f9e6..d841959 100644 --- a/chromeos/dbus/cros_disks_client.cc +++ b/chromeos/dbus/cros_disks_client.cc @@ -476,7 +476,7 @@ class CrosDisksClientStubImpl : public CrosDisksClient { } // Just create an empty directory and shows it as the mounted directory. - if (!file_util::CreateDirectory(mounted_path)) { + if (!base::CreateDirectory(mounted_path)) { DLOG(ERROR) << "Failed to create directory at " << mounted_path.value(); return MOUNT_ERROR_DIRECTORY_CREATION_FAILED; } diff --git a/chromeos/dbus/session_manager_client.cc b/chromeos/dbus/session_manager_client.cc index 441c693..7db7928 100644 --- a/chromeos/dbus/session_manager_client.cc +++ b/chromeos/dbus/session_manager_client.cc @@ -628,7 +628,7 @@ class SessionManagerClientStubImpl : public SessionManagerClient { static void StoreFileInBackground(const base::FilePath& path, const std::string& data) { const int size = static_cast<int>(data.size()); - if (!file_util::CreateDirectory(path.DirName()) || + if (!base::CreateDirectory(path.DirName()) || file_util::WriteFile(path, data.data(), size) != size) { LOG(WARNING) << "Failed to write policy key to " << path.value(); } diff --git a/cloud_print/gcp20/prototype/print_job_handler.cc b/cloud_print/gcp20/prototype/print_job_handler.cc index 2d46db9..2f968e4 100644 --- a/cloud_print/gcp20/prototype/print_job_handler.cc +++ b/cloud_print/gcp20/prototype/print_job_handler.cc @@ -216,7 +216,7 @@ bool PrintJobHandler::SavePrintJob(const std::string& content, base::FilePath directory(kJobsPath); if (!base::DirectoryExists(directory) && - !file_util::CreateDirectory(directory)) { + !base::CreateDirectory(directory)) { return false; } diff --git a/cloud_print/service/win/installer.cc b/cloud_print/service/win/installer.cc index 9a2602d..a08b1445 100644 --- a/cloud_print/service/win/installer.cc +++ b/cloud_print/service/win/installer.cc @@ -38,7 +38,7 @@ void CreateShortcut(int dir_key, bool with_subdir, base::FilePath path = GetShortcutPath(dir_key, with_subdir); if (path.empty()) return; - file_util::CreateDirectory(path.DirName()); + base::CreateDirectory(path.DirName()); base::win::ShortcutProperties properties; base::FilePath exe_path; diff --git a/cloud_print/service/win/service_listener.cc b/cloud_print/service/win/service_listener.cc index e0f9112..53622a8 100644 --- a/cloud_print/service/win/service_listener.cc +++ b/cloud_print/service/win/service_listener.cc @@ -37,7 +37,7 @@ std::string GetEnvironment(const base::FilePath& user_data_dir) { GetCurrentUserName()); environment.SetString(SetupListener::kChromePathJsonValueName, chrome_launcher_support::GetAnyChromePath().value()); - if (file_util::CreateDirectory(user_data_dir)) { + if (base::CreateDirectory(user_data_dir)) { base::FilePath temp_file; if (base::CreateTemporaryFileInDir(user_data_dir, &temp_file)) { DCHECK(base::PathExists(temp_file)); diff --git a/cloud_print/virtual_driver/win/port_monitor/port_monitor.cc b/cloud_print/virtual_driver/win/port_monitor/port_monitor.cc index cec4aac..4432404 100644 --- a/cloud_print/virtual_driver/win/port_monitor/port_monitor.cc +++ b/cloud_print/virtual_driver/win/port_monitor/port_monitor.cc @@ -428,7 +428,7 @@ BOOL WINAPI Monitor2StartDocPort(HANDLE port_handle, if (app_data_dir.empty()) return FALSE; DeleteLeakedFiles(app_data_dir); - if (!file_util::CreateDirectory(app_data_dir) || + if (!base::CreateDirectory(app_data_dir) || !base::CreateTemporaryFileInDir(app_data_dir, &file_path)) { LOG(ERROR) << "Can't create temporary file in " << app_data_dir.value(); return FALSE; diff --git a/cloud_print/virtual_driver/win/port_monitor/port_monitor_unittest.cc b/cloud_print/virtual_driver/win/port_monitor/port_monitor_unittest.cc index 0e32027..335503a 100644 --- a/cloud_print/virtual_driver/win/port_monitor/port_monitor_unittest.cc +++ b/cloud_print/virtual_driver/win/port_monitor/port_monitor_unittest.cc @@ -65,9 +65,9 @@ class PortMonitorTest : public testing::Test { base::FilePath path; PathService::Get(base::DIR_LOCAL_APP_DATA, &path); base::FilePath main_path = path.Append(kChromeExePath); - ASSERT_TRUE(file_util::CreateDirectory(main_path)); + ASSERT_TRUE(base::CreateDirectory(main_path)); base::FilePath alternate_path = path.Append(kAlternateChromeExePath); - ASSERT_TRUE(file_util::CreateDirectory(alternate_path)); + ASSERT_TRUE(base::CreateDirectory(alternate_path)); } virtual void DeleteTempChromeExeFiles() { diff --git a/components/breakpad/tools/crash_service.cc b/components/breakpad/tools/crash_service.cc index c7ceb58..425337f 100644 --- a/components/breakpad/tools/crash_service.cc +++ b/components/breakpad/tools/crash_service.cc @@ -348,7 +348,7 @@ void CrashService::OnClientDumpRequest(void* context, CrashMap::const_iterator it = map.find(L"breakpad-dump-location"); if (it != map.end()) { base::FilePath alternate_dump_location = base::FilePath(it->second); - file_util::CreateDirectoryW(alternate_dump_location); + base::CreateDirectoryW(alternate_dump_location); alternate_dump_location = alternate_dump_location.Append( dump_location.BaseName()); base::Move(dump_location, alternate_dump_location); diff --git a/components/visitedlink/test/visitedlink_unittest.cc b/components/visitedlink/test/visitedlink_unittest.cc index 0943106..3a029b9 100644 --- a/components/visitedlink/test/visitedlink_unittest.cc +++ b/components/visitedlink/test/visitedlink_unittest.cc @@ -210,7 +210,7 @@ class VisitedLinkTest : public testing::Test { ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); history_dir_ = temp_dir_.path().AppendASCII("VisitedLinkTest"); - ASSERT_TRUE(file_util::CreateDirectory(history_dir_)); + ASSERT_TRUE(base::CreateDirectory(history_dir_)); visited_file_ = history_dir_.Append(FILE_PATH_LITERAL("VisitedLinks")); } diff --git a/content/browser/dom_storage/dom_storage_context_impl.cc b/content/browser/dom_storage/dom_storage_context_impl.cc index 44c4242..2c31bd6 100644 --- a/content/browser/dom_storage/dom_storage_context_impl.cc +++ b/content/browser/dom_storage/dom_storage_context_impl.cc @@ -68,7 +68,7 @@ DOMStorageNamespace* DOMStorageContextImpl::GetStorageNamespace( if (found == namespaces_.end()) { if (namespace_id == kLocalStorageNamespaceId) { if (!localstorage_directory_.empty()) { - if (!file_util::CreateDirectory(localstorage_directory_)) { + if (!base::CreateDirectory(localstorage_directory_)) { LOG(ERROR) << "Failed to create 'Local Storage' directory," " falling back to in-memory only."; localstorage_directory_ = base::FilePath(); diff --git a/content/browser/download/base_file.cc b/content/browser/download/base_file.cc index a1ba735..1de3e84 100644 --- a/content/browser/download/base_file.cc +++ b/content/browser/download/base_file.cc @@ -165,7 +165,7 @@ DownloadInterruptReason BaseFile::Rename(const base::FilePath& new_path) { net::NetLog::TYPE_DOWNLOAD_FILE_RENAMED, base::Bind(&FileRenamedNetLogCallback, &full_path_, &new_path)); Close(); - file_util::CreateDirectory(new_path.DirName()); + base::CreateDirectory(new_path.DirName()); // A simple rename wouldn't work here since we want the file to have // permissions / security descriptors that makes sense in the new directory. diff --git a/content/browser/download/base_file_unittest.cc b/content/browser/download/base_file_unittest.cc index 8e6b4d0..4ab0c2a 100644 --- a/content/browser/download/base_file_unittest.cc +++ b/content/browser/download/base_file_unittest.cc @@ -464,7 +464,7 @@ TEST_F(BaseFileTest, RenameWithError) { // TestDir is a subdirectory in |temp_dir_| that we will make read-only so // that the rename will fail. base::FilePath test_dir(temp_dir_.path().AppendASCII("TestDir")); - ASSERT_TRUE(file_util::CreateDirectory(test_dir)); + ASSERT_TRUE(base::CreateDirectory(test_dir)); base::FilePath new_path(test_dir.AppendASCII("TestFile")); EXPECT_FALSE(base::PathExists(new_path)); diff --git a/content/browser/download/download_file_unittest.cc b/content/browser/download/download_file_unittest.cc index dcc0e42..e46babc 100644 --- a/content/browser/download/download_file_unittest.cc +++ b/content/browser/download/download_file_unittest.cc @@ -461,7 +461,7 @@ TEST_F(DownloadFileTest, RenameError) { // Create a subdirectory. base::FilePath tempdir( initial_path.DirName().Append(FILE_PATH_LITERAL("tempdir"))); - ASSERT_TRUE(file_util::CreateDirectory(tempdir)); + ASSERT_TRUE(base::CreateDirectory(tempdir)); base::FilePath target_path(tempdir.Append(initial_path.BaseName())); // Targets diff --git a/content/browser/download/save_file_manager.cc b/content/browser/download/save_file_manager.cc index 442c28e..85651b7 100644 --- a/content/browser/download/save_file_manager.cc +++ b/content/browser/download/save_file_manager.cc @@ -482,7 +482,7 @@ void SaveFileManager::RenameAllFiles( DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); if (!resource_dir.empty() && !base::PathExists(resource_dir)) - file_util::CreateDirectory(resource_dir); + base::CreateDirectory(resource_dir); for (FinalNameList::const_iterator i = final_names.begin(); i != final_names.end(); ++i) { diff --git a/content/browser/download/save_package.cc b/content/browser/download/save_package.cc index b734efe..5961e6b 100644 --- a/content/browser/download/save_package.cc +++ b/content/browser/download/save_package.cc @@ -1347,7 +1347,7 @@ void SavePackage::CreateDirectoryOnFileThread( if (!skip_dir_check && !base::DirectoryExists(website_save_dir)) { // If the default download dir doesn't exist, create it. if (!base::DirectoryExists(download_save_dir)) { - bool res = file_util::CreateDirectory(download_save_dir); + bool res = base::CreateDirectory(download_save_dir); DCHECK(res); } save_dir = download_save_dir; diff --git a/content/browser/fileapi/obfuscated_file_util_unittest.cc b/content/browser/fileapi/obfuscated_file_util_unittest.cc index 2a9710e..4f3727d 100644 --- a/content/browser/fileapi/obfuscated_file_util_unittest.cc +++ b/content/browser/fileapi/obfuscated_file_util_unittest.cc @@ -2407,7 +2407,7 @@ TEST_F(ObfuscatedFileUtilTest, MigrationBackFromIsolated) { // Populate the origin directory with some fake data. old_directory_db_path = data_dir_path().Append(path); - ASSERT_TRUE(file_util::CreateDirectory(old_directory_db_path)); + ASSERT_TRUE(base::CreateDirectory(old_directory_db_path)); EXPECT_EQ(static_cast<int>(kFakeDirectoryData.size()), file_util::WriteFile(old_directory_db_path.AppendASCII("dummy"), kFakeDirectoryData.data(), diff --git a/content/browser/indexed_db/indexed_db_backing_store.cc b/content/browser/indexed_db/indexed_db_backing_store.cc index ae40d22..766d6a4 100644 --- a/content/browser/indexed_db/indexed_db_backing_store.cc +++ b/content/browser/indexed_db/indexed_db_backing_store.cc @@ -513,7 +513,7 @@ scoped_refptr<IndexedDBBackingStore> IndexedDBBackingStore::Open( HistogramOpenStatus(INDEXED_DB_BACKING_STORE_OPEN_ATTEMPT_NON_ASCII, origin_url); } - if (!file_util::CreateDirectory(path_base)) { + if (!base::CreateDirectory(path_base)) { LOG(ERROR) << "Unable to create IndexedDB database path " << path_base.AsUTF8Unsafe(); HistogramOpenStatus(INDEXED_DB_BACKING_STORE_OPEN_FAILED_DIRECTORY, diff --git a/content/browser/indexed_db/indexed_db_browsertest.cc b/content/browser/indexed_db/indexed_db_browsertest.cc index 9fca832..687ce48 100644 --- a/content/browser/indexed_db/indexed_db_browsertest.cc +++ b/content/browser/indexed_db/indexed_db_browsertest.cc @@ -234,7 +234,7 @@ static void CopyLevelDBToProfile(Shell* shell, // If we don't create the destination directory first, the contents of the // leveldb directory are copied directly into profile/IndexedDB instead of // profile/IndexedDB/file__0.xxx/ - ASSERT_TRUE(file_util::CreateDirectory(dest)); + ASSERT_TRUE(base::CreateDirectory(dest)); const bool kRecursive = true; ASSERT_TRUE(base::CopyDirectory(test_data_dir, context->data_path(), diff --git a/content/browser/indexed_db/indexed_db_quota_client_unittest.cc b/content/browser/indexed_db/indexed_db_quota_client_unittest.cc index 25f6620..cd2f146 100644 --- a/content/browser/indexed_db/indexed_db_quota_client_unittest.cc +++ b/content/browser/indexed_db/indexed_db_quota_client_unittest.cc @@ -66,7 +66,7 @@ class IndexedDBQuotaClientTest : public testing::Test { ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); base::FilePath indexeddb_dir = temp_dir_.path().Append(IndexedDBContextImpl::kIndexedDBDirectory); - ASSERT_TRUE(file_util::CreateDirectory(indexeddb_dir)); + ASSERT_TRUE(base::CreateDirectory(indexeddb_dir)); idb_context()->set_data_path_for_testing(indexeddb_dir); } @@ -141,8 +141,8 @@ class IndexedDBQuotaClientTest : public testing::Test { void AddFakeIndexedDB(const GURL& origin, int size) { base::FilePath file_path_origin = idb_context()->GetFilePathForTesting( webkit_database::GetIdentifierFromOrigin(origin)); - if (!file_util::CreateDirectory(file_path_origin)) { - LOG(ERROR) << "failed to file_util::CreateDirectory " + if (!base::CreateDirectory(file_path_origin)) { + LOG(ERROR) << "failed to base::CreateDirectory " << file_path_origin.value(); } file_path_origin = file_path_origin.Append(FILE_PATH_LITERAL("fake_file")); diff --git a/content/browser/indexed_db/indexed_db_unittest.cc b/content/browser/indexed_db/indexed_db_unittest.cc index 43613af..b94b20d 100644 --- a/content/browser/indexed_db/indexed_db_unittest.cc +++ b/content/browser/indexed_db/indexed_db_unittest.cc @@ -69,8 +69,8 @@ TEST_F(IndexedDBTest, ClearSessionOnlyDatabases) { webkit_database::GetIdentifierFromOrigin(kNormalOrigin)); session_only_path = idb_context->GetFilePathForTesting( webkit_database::GetIdentifierFromOrigin(kSessionOnlyOrigin)); - ASSERT_TRUE(file_util::CreateDirectory(normal_path)); - ASSERT_TRUE(file_util::CreateDirectory(session_only_path)); + ASSERT_TRUE(base::CreateDirectory(normal_path)); + ASSERT_TRUE(base::CreateDirectory(session_only_path)); FlushIndexedDBTaskRunner(); message_loop_.RunUntilIdle(); } @@ -103,8 +103,8 @@ TEST_F(IndexedDBTest, SetForceKeepSessionState) { webkit_database::GetIdentifierFromOrigin(kNormalOrigin)); session_only_path = idb_context->GetFilePathForTesting( webkit_database::GetIdentifierFromOrigin(kSessionOnlyOrigin)); - ASSERT_TRUE(file_util::CreateDirectory(normal_path)); - ASSERT_TRUE(file_util::CreateDirectory(session_only_path)); + ASSERT_TRUE(base::CreateDirectory(normal_path)); + ASSERT_TRUE(base::CreateDirectory(session_only_path)); message_loop_.RunUntilIdle(); } @@ -158,7 +158,7 @@ TEST_F(IndexedDBTest, ForceCloseOpenDatabasesOnDelete) { test_path = idb_context->GetFilePathForTesting( webkit_database::GetIdentifierFromOrigin(kTestOrigin)); - ASSERT_TRUE(file_util::CreateDirectory(test_path)); + ASSERT_TRUE(base::CreateDirectory(test_path)); const bool kExpectForceClose = true; @@ -208,7 +208,7 @@ TEST_F(IndexedDBTest, DeleteFailsIfDirectoryLocked) { base::FilePath test_path = idb_context->GetFilePathForTesting( webkit_database::GetIdentifierFromOrigin(kTestOrigin)); - ASSERT_TRUE(file_util::CreateDirectory(test_path)); + ASSERT_TRUE(base::CreateDirectory(test_path)); scoped_ptr<LevelDBLock> lock = LevelDBDatabase::LockForTesting(test_path); diff --git a/content/browser/media/webrtc_identity_store_backend.cc b/content/browser/media/webrtc_identity_store_backend.cc index 5aed520..d599dcd 100644 --- a/content/browser/media/webrtc_identity_store_backend.cc +++ b/content/browser/media/webrtc_identity_store_backend.cc @@ -369,7 +369,7 @@ void WebRTCIdentityStoreBackend::SqlLiteStorage::Load(IdentityMap* out_map) { // Ensure the parent directory for storing certs is created before reading // from it. const base::FilePath dir = path_.DirName(); - if (!base::PathExists(dir) && !file_util::CreateDirectory(dir)) { + if (!base::PathExists(dir) && !base::CreateDirectory(dir)) { DLOG(ERROR) << "Unable to open DB file path."; return; } diff --git a/content/browser/net/sqlite_persistent_cookie_store.cc b/content/browser/net/sqlite_persistent_cookie_store.cc index 1c0a8e7..e03d9ba 100644 --- a/content/browser/net/sqlite_persistent_cookie_store.cc +++ b/content/browser/net/sqlite_persistent_cookie_store.cc @@ -544,7 +544,7 @@ bool SQLitePersistentCookieStore::Backend::InitializeDatabase() { base::Time start = base::Time::Now(); const base::FilePath dir = path_.DirName(); - if (!base::PathExists(dir) && !file_util::CreateDirectory(dir)) { + if (!base::PathExists(dir) && !base::CreateDirectory(dir)) { return false; } diff --git a/content/browser/renderer_host/pepper/pepper_flash_file_message_filter.cc b/content/browser/renderer_host/pepper/pepper_flash_file_message_filter.cc index f18b93b..9c02fd1 100644 --- a/content/browser/renderer_host/pepper/pepper_flash_file_message_filter.cc +++ b/content/browser/renderer_host/pepper/pepper_flash_file_message_filter.cc @@ -194,7 +194,7 @@ int32_t PepperFlashFileMessageFilter::OnCreateDir( base::PLATFORM_FILE_ERROR_ACCESS_DENIED); } - bool result = file_util::CreateDirectory(full_path); + bool result = base::CreateDirectory(full_path); return ppapi::PlatformFileErrorToPepperError(result ? base::PLATFORM_FILE_OK : base::PLATFORM_FILE_ERROR_ACCESS_DENIED); } @@ -253,7 +253,7 @@ int32_t PepperFlashFileMessageFilter::OnCreateTemporaryFile( dir_path, base::Bind(&CanCreateReadWrite)); if (validated_dir_path.empty() || (!base::DirectoryExists(validated_dir_path) && - !file_util::CreateDirectory(validated_dir_path))) { + !base::CreateDirectory(validated_dir_path))) { return ppapi::PlatformFileErrorToPepperError( base::PLATFORM_FILE_ERROR_ACCESS_DENIED); } diff --git a/content/browser/storage_partition_impl_unittest.cc b/content/browser/storage_partition_impl_unittest.cc index 911f835..008a898 100644 --- a/content/browser/storage_partition_impl_unittest.cc +++ b/content/browser/storage_partition_impl_unittest.cc @@ -202,7 +202,7 @@ class RemoveLocalStorageTester { // stores data in the host file system. base::FilePath storage_path = profile_->GetPath().AppendASCII("Local Storage"); - file_util::CreateDirectory(storage_path); + base::CreateDirectory(storage_path); // Write some files. file_util::WriteFile(storage_path.Append(kDomStorageOrigin1), NULL, 0); diff --git a/content/common/sandbox_mac_diraccess_unittest.mm b/content/common/sandbox_mac_diraccess_unittest.mm index ee109c2..6d3ddad 100644 --- a/content/common/sandbox_mac_diraccess_unittest.mm +++ b/content/common/sandbox_mac_diraccess_unittest.mm @@ -145,7 +145,7 @@ typedef scoped_ptr_malloc<base::FilePath, ScopedDirectoryDelete> ScopedDirectory; TEST_F(MacDirAccessSandboxTest, SandboxAccess) { - using file_util::CreateDirectory; + using base::CreateDirectory; base::FilePath tmp_dir; ASSERT_TRUE(base::CreateNewTempDirectory(base::FilePath::StringType(), diff --git a/content/renderer/gpu/gpu_benchmarking_extension.cc b/content/renderer/gpu/gpu_benchmarking_extension.cc index 6ba02a6..4a25072 100644 --- a/content/renderer/gpu/gpu_benchmarking_extension.cc +++ b/content/renderer/gpu/gpu_benchmarking_extension.cc @@ -447,7 +447,7 @@ class GpuBenchmarkingWrapper : public v8::Extension { base::FilePath dirpath( base::FilePath::StringType(*dirname, *dirname + dirname.length())); - if (!file_util::CreateDirectory(dirpath) || + if (!base::CreateDirectory(dirpath) || !base::PathIsWritable(dirpath)) { std::string msg("Path is not writable: "); msg.append(dirpath.MaybeAsASCII()); diff --git a/content/shell/browser/shell_browser_context.cc b/content/shell/browser/shell_browser_context.cc index 8dee89a..2283fd95 100644 --- a/content/shell/browser/shell_browser_context.cc +++ b/content/shell/browser/shell_browser_context.cc @@ -107,7 +107,7 @@ void ShellBrowserContext::InitWhileIOAllowed() { #endif if (!base::PathExists(path_)) - file_util::CreateDirectory(path_); + base::CreateDirectory(path_); } base::FilePath ShellBrowserContext::GetPath() const { diff --git a/content/shell/browser/shell_download_manager_delegate.cc b/content/shell/browser/shell_download_manager_delegate.cc index 0ce03eb..e930b93 100644 --- a/content/shell/browser/shell_download_manager_delegate.cc +++ b/content/shell/browser/shell_download_manager_delegate.cc @@ -112,7 +112,7 @@ void ShellDownloadManagerDelegate::GenerateFilename( const base::FilePath& suggested_directory) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); if (!base::PathExists(suggested_directory)) - file_util::CreateDirectory(suggested_directory); + base::CreateDirectory(suggested_directory); base::FilePath suggested_path(suggested_directory.Append(generated_name)); BrowserThread::PostTask( diff --git a/crypto/nss_util.cc b/crypto/nss_util.cc index a74c8b6..82556b4 100644 --- a/crypto/nss_util.cc +++ b/crypto/nss_util.cc @@ -85,7 +85,7 @@ base::FilePath GetDefaultConfigDirectory() { return dir; } dir = dir.AppendASCII(".pki").AppendASCII("nssdb"); - if (!file_util::CreateDirectory(dir)) { + if (!base::CreateDirectory(dir)) { LOG(ERROR) << "Failed to create " << dir.value() << " directory."; dir.clear(); } diff --git a/extensions/common/extension_resource_unittest.cc b/extensions/common/extension_resource_unittest.cc index fea3f4d..499ba92 100644 --- a/extensions/common/extension_resource_unittest.cc +++ b/extensions/common/extension_resource_unittest.cc @@ -50,9 +50,9 @@ TEST(ExtensionResourceTest, ResourcesOutsideOfPath) { ASSERT_TRUE(temp.CreateUniqueTempDir()); base::FilePath inner_dir = temp.path().AppendASCII("directory"); - ASSERT_TRUE(file_util::CreateDirectory(inner_dir)); + ASSERT_TRUE(base::CreateDirectory(inner_dir)); base::FilePath sub_dir = inner_dir.AppendASCII("subdir"); - ASSERT_TRUE(file_util::CreateDirectory(sub_dir)); + ASSERT_TRUE(base::CreateDirectory(sub_dir)); base::FilePath inner_file = inner_dir.AppendASCII("inner"); base::FilePath outer_file = temp.path().AppendASCII("outer"); ASSERT_TRUE(file_util::WriteFile(outer_file, "X", 1)); @@ -128,7 +128,7 @@ TEST(ExtensionResourceTest, CreateWithAllResourcesOnDisk) { // Create l10n resources (for current locale and its parents). base::FilePath l10n_path = temp.path().Append(kLocaleFolder); - ASSERT_TRUE(file_util::CreateDirectory(l10n_path)); + ASSERT_TRUE(base::CreateDirectory(l10n_path)); std::vector<std::string> locales; l10n_util::GetParentLocales(l10n_util::GetApplicationLocale(std::string()), @@ -137,7 +137,7 @@ TEST(ExtensionResourceTest, CreateWithAllResourcesOnDisk) { for (size_t i = 0; i < locales.size(); i++) { base::FilePath make_path; make_path = l10n_path.AppendASCII(locales[i]); - ASSERT_TRUE(file_util::CreateDirectory(make_path)); + ASSERT_TRUE(base::CreateDirectory(make_path)); ASSERT_TRUE(file_util::WriteFile(make_path.AppendASCII(filename), data.c_str(), data.length())); } diff --git a/extensions/common/file_util_unittest.cc b/extensions/common/file_util_unittest.cc index 04afe898..f8f7b622 100644 --- a/extensions/common/file_util_unittest.cc +++ b/extensions/common/file_util_unittest.cc @@ -62,7 +62,7 @@ TEST_F(FileUtilTest, ExtensionResourceURLToFilePath) { ASSERT_FALSE(root_path.empty()); base::FilePath api_path = root_path.Append(FILE_PATH_LITERAL("apiname")); - ASSERT_TRUE(file_util::CreateDirectory(api_path)); + ASSERT_TRUE(base::CreateDirectory(api_path)); const char data[] = "Test Data"; base::FilePath resource_path = api_path.Append(FILE_PATH_LITERAL("test.js")); diff --git a/ipc/ipc_channel_posix_unittest.cc b/ipc/ipc_channel_posix_unittest.cc index eca78f1..dbd854e 100644 --- a/ipc/ipc_channel_posix_unittest.cc +++ b/ipc/ipc_channel_posix_unittest.cc @@ -159,7 +159,7 @@ void IPCChannelPosixTest::SetUpSocket(IPC::ChannelHandle *handle, // Make sure the path we need exists. base::FilePath path(name); base::FilePath dir_path = path.DirName(); - ASSERT_TRUE(file_util::CreateDirectory(dir_path)); + ASSERT_TRUE(base::CreateDirectory(dir_path)); ASSERT_GE(bind(socket_fd, reinterpret_cast<struct sockaddr *>(&server_address), server_address_len), 0) << server_address.sun_path diff --git a/ipc/unix_domain_socket_util.cc b/ipc/unix_domain_socket_util.cc index 7f513a3..10df9b2 100644 --- a/ipc/unix_domain_socket_util.cc +++ b/ipc/unix_domain_socket_util.cc @@ -84,7 +84,7 @@ bool CreateServerUnixDomainSocket(const base::FilePath& socket_path, file_util::ScopedFD scoped_fd(&fd); // Make sure the path we need exists. - if (!file_util::CreateDirectory(socket_dir)) { + if (!base::CreateDirectory(socket_dir)) { LOG(ERROR) << "Couldn't create directory: " << socket_dir.value(); return false; } diff --git a/mojo/shell/storage.cc b/mojo/shell/storage.cc index 5dbaefb..0dc0417 100644 --- a/mojo/shell/storage.cc +++ b/mojo/shell/storage.cc @@ -42,7 +42,7 @@ Storage::Storage() { #endif if (!base::PathExists(profile_path_)) - file_util::CreateDirectory(profile_path_); + base::CreateDirectory(profile_path_); } Storage::~Storage() { diff --git a/net/base/directory_lister_unittest.cc b/net/base/directory_lister_unittest.cc index 0ad71af..0be09a5 100644 --- a/net/base/directory_lister_unittest.cc +++ b/net/base/directory_lister_unittest.cc @@ -122,7 +122,7 @@ class DirectoryListerTest : public PlatformTest { for (int i = 0; i < kBranchingFactor; i++) { std::string dir_name = base::StringPrintf("child_dir_%d", i); base::FilePath dir_path = dir_data.first.AppendASCII(dir_name); - ASSERT_TRUE(file_util::CreateDirectory(dir_path)); + ASSERT_TRUE(base::CreateDirectory(dir_path)); directories.push_back(std::make_pair(dir_path, dir_data.second + 1)); } } diff --git a/net/disk_cache/backend_impl.cc b/net/disk_cache/backend_impl.cc index 6a0d124..a3250ff 100644 --- a/net/disk_cache/backend_impl.cc +++ b/net/disk_cache/backend_impl.cc @@ -1247,7 +1247,7 @@ bool BackendImpl::CreateBackingStore(disk_cache::File* file) { } bool BackendImpl::InitBackingStore(bool* file_created) { - if (!file_util::CreateDirectory(path_)) + if (!base::CreateDirectory(path_)) return false; base::FilePath index_name = path_.AppendASCII(kIndexName); diff --git a/net/disk_cache/block_files_unittest.cc b/net/disk_cache/block_files_unittest.cc index fa7c5db..4a095c9 100644 --- a/net/disk_cache/block_files_unittest.cc +++ b/net/disk_cache/block_files_unittest.cc @@ -31,7 +31,7 @@ namespace disk_cache { TEST_F(DiskCacheTest, BlockFiles_Grow) { ASSERT_TRUE(CleanupCacheDir()); - ASSERT_TRUE(file_util::CreateDirectory(cache_path_)); + ASSERT_TRUE(base::CreateDirectory(cache_path_)); BlockFiles files(cache_path_); ASSERT_TRUE(files.Init(true)); @@ -57,7 +57,7 @@ TEST_F(DiskCacheTest, BlockFiles_Grow) { // We should be able to delete empty block files. TEST_F(DiskCacheTest, BlockFiles_Shrink) { ASSERT_TRUE(CleanupCacheDir()); - ASSERT_TRUE(file_util::CreateDirectory(cache_path_)); + ASSERT_TRUE(base::CreateDirectory(cache_path_)); BlockFiles files(cache_path_); ASSERT_TRUE(files.Init(true)); @@ -80,7 +80,7 @@ TEST_F(DiskCacheTest, BlockFiles_Shrink) { // Handling of block files not properly closed. TEST_F(DiskCacheTest, BlockFiles_Recover) { ASSERT_TRUE(CleanupCacheDir()); - ASSERT_TRUE(file_util::CreateDirectory(cache_path_)); + ASSERT_TRUE(base::CreateDirectory(cache_path_)); BlockFiles files(cache_path_); ASSERT_TRUE(files.Init(true)); @@ -157,7 +157,7 @@ TEST_F(DiskCacheTest, BlockFiles_Recover) { // Handling of truncated files. TEST_F(DiskCacheTest, BlockFiles_ZeroSizeFile) { ASSERT_TRUE(CleanupCacheDir()); - ASSERT_TRUE(file_util::CreateDirectory(cache_path_)); + ASSERT_TRUE(base::CreateDirectory(cache_path_)); BlockFiles files(cache_path_); ASSERT_TRUE(files.Init(true)); @@ -178,7 +178,7 @@ TEST_F(DiskCacheTest, BlockFiles_ZeroSizeFile) { // Handling of truncated files (non empty). TEST_F(DiskCacheTest, BlockFiles_TruncatedFile) { ASSERT_TRUE(CleanupCacheDir()); - ASSERT_TRUE(file_util::CreateDirectory(cache_path_)); + ASSERT_TRUE(base::CreateDirectory(cache_path_)); BlockFiles files(cache_path_); ASSERT_TRUE(files.Init(true)); @@ -201,7 +201,7 @@ TEST_F(DiskCacheTest, BlockFiles_TruncatedFile) { // Tests detection of out of sync counters. TEST_F(DiskCacheTest, BlockFiles_Counters) { ASSERT_TRUE(CleanupCacheDir()); - ASSERT_TRUE(file_util::CreateDirectory(cache_path_)); + ASSERT_TRUE(base::CreateDirectory(cache_path_)); BlockFiles files(cache_path_); ASSERT_TRUE(files.Init(true)); @@ -256,7 +256,7 @@ TEST_F(DiskCacheTest, BlockFiles_Counters) { // An invalid file can be detected after init. TEST_F(DiskCacheTest, BlockFiles_InvalidFile) { ASSERT_TRUE(CleanupCacheDir()); - ASSERT_TRUE(file_util::CreateDirectory(cache_path_)); + ASSERT_TRUE(base::CreateDirectory(cache_path_)); BlockFiles files(cache_path_); ASSERT_TRUE(files.Init(true)); @@ -302,7 +302,7 @@ TEST_F(DiskCacheTest, BlockFiles_Stats) { // Tests that we add and remove blocks correctly. TEST_F(DiskCacheTest, AllocationMap) { ASSERT_TRUE(CleanupCacheDir()); - ASSERT_TRUE(file_util::CreateDirectory(cache_path_)); + ASSERT_TRUE(base::CreateDirectory(cache_path_)); BlockFiles files(cache_path_); ASSERT_TRUE(files.Init(true)); diff --git a/net/disk_cache/cache_util_posix.cc b/net/disk_cache/cache_util_posix.cc index b33c560..59e1c50 100644 --- a/net/disk_cache/cache_util_posix.cc +++ b/net/disk_cache/cache_util_posix.cc @@ -19,7 +19,7 @@ bool MoveCache(const base::FilePath& from_path, const base::FilePath& to_path) { // to see these directories anymore in an unmounted encrypted // filesystem, so we just move each item in the cache to a new // directory. - if (!file_util::CreateDirectory(to_path)) { + if (!base::CreateDirectory(to_path)) { LOG(ERROR) << "Unable to create destination cache directory."; return false; } diff --git a/net/disk_cache/cache_util_unittest.cc b/net/disk_cache/cache_util_unittest.cc index d2e7605..b86290f 100644 --- a/net/disk_cache/cache_util_unittest.cc +++ b/net/disk_cache/cache_util_unittest.cc @@ -20,14 +20,14 @@ class CacheUtilTest : public PlatformTest { file2_ = base::FilePath(cache_dir_.Append(FILE_PATH_LITERAL(".file02"))); dir1_ = base::FilePath(cache_dir_.Append(FILE_PATH_LITERAL("dir01"))); file3_ = base::FilePath(dir1_.Append(FILE_PATH_LITERAL("file03"))); - ASSERT_TRUE(file_util::CreateDirectory(cache_dir_)); + ASSERT_TRUE(base::CreateDirectory(cache_dir_)); FILE *fp = file_util::OpenFile(file1_, "w"); ASSERT_TRUE(fp != NULL); file_util::CloseFile(fp); fp = file_util::OpenFile(file2_, "w"); ASSERT_TRUE(fp != NULL); file_util::CloseFile(fp); - ASSERT_TRUE(file_util::CreateDirectory(dir1_)); + ASSERT_TRUE(base::CreateDirectory(dir1_)); fp = file_util::OpenFile(file3_, "w"); ASSERT_TRUE(fp != NULL); file_util::CloseFile(fp); diff --git a/net/disk_cache/simple/simple_backend_impl.cc b/net/disk_cache/simple/simple_backend_impl.cc index 1165da6..7260857 100644 --- a/net/disk_cache/simple/simple_backend_impl.cc +++ b/net/disk_cache/simple/simple_backend_impl.cc @@ -44,7 +44,7 @@ using base::SequencedWorkerPool; using base::SingleThreadTaskRunner; using base::Time; using base::DirectoryExists; -using file_util::CreateDirectory; +using base::CreateDirectory; namespace disk_cache { @@ -124,7 +124,7 @@ void MaybeHistogramFdLimit(net::CacheType cache_type) { // backend type and version. If the directory contains no cache, occupies it // with the fresh structure. bool FileStructureConsistent(const base::FilePath& path) { - if (!base::PathExists(path) && !file_util::CreateDirectory(path)) { + if (!base::PathExists(path) && !base::CreateDirectory(path)) { LOG(ERROR) << "Failed to create directory: " << path.LossyDisplayName(); return false; } diff --git a/net/disk_cache/simple/simple_index_file.cc b/net/disk_cache/simple/simple_index_file.cc index 5e1e4ba..7fead5e 100644 --- a/net/disk_cache/simple/simple_index_file.cc +++ b/net/disk_cache/simple/simple_index_file.cc @@ -203,7 +203,7 @@ void SimpleIndexFile::SyncWriteToDisk(net::CacheType cache_type, } SerializeFinalData(cache_dir_mtime, pickle.get()); if (!WritePickleFile(pickle.get(), temp_index_filename)) { - if (!file_util::CreateDirectory(temp_index_filename.DirName())) { + if (!base::CreateDirectory(temp_index_filename.DirName())) { LOG(ERROR) << "Could not create a directory to hold the index file"; return; } diff --git a/net/disk_cache/simple/simple_index_file_unittest.cc b/net/disk_cache/simple/simple_index_file_unittest.cc index 6a79433..ef7c26d 100644 --- a/net/disk_cache/simple/simple_index_file_unittest.cc +++ b/net/disk_cache/simple/simple_index_file_unittest.cc @@ -86,7 +86,7 @@ class WrappedSimpleIndexFile : public SimpleIndexFile { } bool CreateIndexFileDirectory() const { - return file_util::CreateDirectory(index_file_.DirName()); + return base::CreateDirectory(index_file_.DirName()); } }; diff --git a/net/disk_cache/v3/backend_worker.cc b/net/disk_cache/v3/backend_worker.cc index cbccfdd..be12a96 100644 --- a/net/disk_cache/v3/backend_worker.cc +++ b/net/disk_cache/v3/backend_worker.cc @@ -331,7 +331,7 @@ bool BackendImpl::CreateBackingStore(disk_cache::File* file) { } bool BackendImpl::InitBackingStore(bool* file_created) { - if (!file_util::CreateDirectory(path_)) + if (!base::CreateDirectory(path_)) return false; base::FilePath index_name = path_.AppendASCII(kIndexName); diff --git a/net/proxy/proxy_config_service_linux_unittest.cc b/net/proxy/proxy_config_service_linux_unittest.cc index f3700f6..c3a1aa5 100644 --- a/net/proxy/proxy_config_service_linux_unittest.cc +++ b/net/proxy/proxy_config_service_linux_unittest.cc @@ -360,7 +360,7 @@ class ProxyConfigServiceLinuxTest : public PlatformTest { kde_home_ = user_home_.Append(FILE_PATH_LITERAL(".kde")); base::FilePath path = kde_home_.Append(FILE_PATH_LITERAL("share")); path = path.Append(FILE_PATH_LITERAL("config")); - file_util::CreateDirectory(path); + base::CreateDirectory(path); kioslaverc_ = path.Append(FILE_PATH_LITERAL("kioslaverc")); // Set up paths but do not create the directory for .kde4. kde4_home_ = user_home_.Append(FILE_PATH_LITERAL(".kde4")); @@ -1548,7 +1548,7 @@ TEST_F(ProxyConfigServiceLinuxTest, KDEHomePicker) { // Now create .kde4 and put a kioslaverc in the config directory. // Note that its timestamp will be at least as new as the .kde one. - file_util::CreateDirectory(kde4_config_); + base::CreateDirectory(kde4_config_); file_util::WriteFile(kioslaverc4_, slaverc4.c_str(), slaverc4.length()); CHECK(base::PathExists(kioslaverc4_)); diff --git a/net/tools/crash_cache/crash_cache.cc b/net/tools/crash_cache/crash_cache.cc index 72addfb..32934a6 100644 --- a/net/tools/crash_cache/crash_cache.cc +++ b/net/tools/crash_cache/crash_cache.cc @@ -123,7 +123,7 @@ bool CreateTargetFolder(const base::FilePath& path, RankCrashes action, if (base::PathExists(*full_path)) return false; - return file_util::CreateDirectory(*full_path); + return base::CreateDirectory(*full_path); } // Makes sure that any pending task is processed. diff --git a/net/tools/dump_cache/cache_dumper.cc b/net/tools/dump_cache/cache_dumper.cc index e6bac0a..ad9a79c 100644 --- a/net/tools/dump_cache/cache_dumper.cc +++ b/net/tools/dump_cache/cache_dumper.cc @@ -65,13 +65,13 @@ bool SafeCreateDirectory(const base::FilePath& path) { // Now create the full path return CreateDirectoryW(path.value().c_str(), NULL) == TRUE; #else - return file_util::CreateDirectory(path); + return base::CreateDirectory(path); #endif } DiskDumper::DiskDumper(const base::FilePath& path) : path_(path), entry_(NULL) { - file_util::CreateDirectory(path); + base::CreateDirectory(path); } int DiskDumper::CreateEntry(const std::string& key, diff --git a/net/url_request/url_fetcher_impl_unittest.cc b/net/url_request/url_fetcher_impl_unittest.cc index e5dae0b..c96993f 100644 --- a/net/url_request/url_fetcher_impl_unittest.cc +++ b/net/url_request/url_fetcher_impl_unittest.cc @@ -1458,7 +1458,7 @@ TEST_F(URLFetcherFileTest, TryToOverwriteDirectory) { // Create a directory before trying to fetch. static const char kFileToFetch[] = "simple.html"; file_path_ = temp_dir.path().AppendASCII(kFileToFetch); - ASSERT_TRUE(file_util::CreateDirectory(file_path_)); + ASSERT_TRUE(base::CreateDirectory(file_path_)); ASSERT_TRUE(base::PathExists(file_path_)); // Get a small file. diff --git a/remoting/host/pairing_registry_delegate_linux.cc b/remoting/host/pairing_registry_delegate_linux.cc index c8c09e7..9b6b3d4 100644 --- a/remoting/host/pairing_registry_delegate_linux.cc +++ b/remoting/host/pairing_registry_delegate_linux.cc @@ -109,7 +109,7 @@ bool PairingRegistryDelegateLinux::Save( const PairingRegistry::Pairing& pairing) { base::FilePath registry_path = GetRegistryPath(); base::PlatformFileError error; - if (!file_util::CreateDirectoryAndGetError(registry_path, &error)) { + if (!base::CreateDirectoryAndGetError(registry_path, &error)) { LOG(ERROR) << "Could not create pairing registry directory: " << error; return false; } diff --git a/remoting/host/setup/daemon_controller_delegate_linux.cc b/remoting/host/setup/daemon_controller_delegate_linux.cc index bed305f..d323e1c 100644 --- a/remoting/host/setup/daemon_controller_delegate_linux.cc +++ b/remoting/host/setup/daemon_controller_delegate_linux.cc @@ -187,7 +187,7 @@ void DaemonControllerDelegateLinux::SetConfigAndStart( // Ensure the configuration directory exists. base::FilePath config_dir = GetConfigPath().DirName(); if (!base::DirectoryExists(config_dir) && - !file_util::CreateDirectory(config_dir)) { + !base::CreateDirectory(config_dir)) { LOG(ERROR) << "Failed to create config directory " << config_dir.value(); done.Run(DaemonController::RESULT_FAILED); return; diff --git a/remoting/host/win/elevated_controller.cc b/remoting/host/win/elevated_controller.cc index c6bd37b..0bb6d2a 100644 --- a/remoting/host/win/elevated_controller.cc +++ b/remoting/host/win/elevated_controller.cc @@ -354,7 +354,7 @@ STDMETHODIMP ElevatedController::GetVersion(BSTR* version_out) { STDMETHODIMP ElevatedController::SetConfig(BSTR config) { // Determine the config directory path and create it if necessary. base::FilePath config_dir = remoting::GetConfigDir(); - if (!file_util::CreateDirectory(config_dir)) { + if (!base::CreateDirectory(config_dir)) { return HRESULT_FROM_WIN32(ERROR_ACCESS_DENIED); } diff --git a/skia/ext/vector_canvas_unittest.cc b/skia/ext/vector_canvas_unittest.cc index b123633..b8fbfba 100644 --- a/skia/ext/vector_canvas_unittest.cc +++ b/skia/ext/vector_canvas_unittest.cc @@ -245,7 +245,7 @@ class ImageTest : public testing::Test { if (action_ == GENERATE) { // Make sure the directory exist. - file_util::CreateDirectory(test_dir_); + base::CreateDirectory(test_dir_); } } diff --git a/third_party/leveldatabase/env_chromium.cc b/third_party/leveldatabase/env_chromium.cc index 265a42e..00f8583 100644 --- a/third_party/leveldatabase/env_chromium.cc +++ b/third_party/leveldatabase/env_chromium.cc @@ -838,7 +838,7 @@ Status ChromiumEnv::CreateDir(const std::string& name) { base::PlatformFileError error = base::PLATFORM_FILE_OK; Retrier retrier(kCreateDir, this); do { - if (::file_util::CreateDirectoryAndGetError(CreateFilePath(name), &error)) + if (base::CreateDirectoryAndGetError(CreateFilePath(name), &error)) return result; } while (retrier.ShouldKeepTrying(error)); result = MakeIOError(name, "Could not create directory.", kCreateDir, error); diff --git a/third_party/zlib/google/zip_reader.cc b/third_party/zlib/google/zip_reader.cc index 862e29a..6ea8025 100644 --- a/third_party/zlib/google/zip_reader.cc +++ b/third_party/zlib/google/zip_reader.cc @@ -192,7 +192,7 @@ bool ZipReader::ExtractCurrentEntryToFilePath( // If this is a directory, just create it and return. if (current_entry_info()->is_directory()) - return file_util::CreateDirectory(output_file_path); + return base::CreateDirectory(output_file_path); const int open_result = unzOpenCurrentFile(zip_file_); if (open_result != UNZ_OK) @@ -201,7 +201,7 @@ bool ZipReader::ExtractCurrentEntryToFilePath( // We can't rely on parent directory entries being specified in the // zip, so we make sure they are created. base::FilePath output_dir_path = output_file_path.DirName(); - if (!file_util::CreateDirectory(output_dir_path)) + if (!base::CreateDirectory(output_dir_path)) return false; net::FileStream stream(NULL); diff --git a/tools/gn/function_exec_script.cc b/tools/gn/function_exec_script.cc index cca62a3..c4d2262 100644 --- a/tools/gn/function_exec_script.cc +++ b/tools/gn/function_exec_script.cc @@ -356,7 +356,7 @@ Value RunExecScript(Scope* scope, // // If this shows up on benchmarks, we can cache whether we've done this // or not and skip creating the directory. - file_util::CreateDirectory(startup_dir); + base::CreateDirectory(startup_dir); // Execute the process. // TODO(brettw) set the environment block. diff --git a/tools/gn/function_write_file.cc b/tools/gn/function_write_file.cc index 0c0dd00..9ac1221 100644 --- a/tools/gn/function_write_file.cc +++ b/tools/gn/function_write_file.cc @@ -71,7 +71,7 @@ Value RunWriteFile(Scope* scope, base::FilePath file_path = scope->settings()->build_settings()->GetFullPath(source_file); const std::string& contents_string = contents.str(); - if (!file_util::CreateDirectory(file_path.DirName())) { + if (!base::CreateDirectory(file_path.DirName())) { *err = Err(function->function(), "Unable to create directory.", "I was using \"" + FilePathToUTF8(file_path.DirName()) + "\"."); return Value(); diff --git a/tools/gn/generate_test_gn_data.cc b/tools/gn/generate_test_gn_data.cc index 017c4c4..730ae99 100644 --- a/tools/gn/generate_test_gn_data.cc +++ b/tools/gn/generate_test_gn_data.cc @@ -82,7 +82,7 @@ void WriteLevel(const std::vector<int>& repo_path, // Don't keep the file open while recursing. { - file_util::CreateDirectory(dirname); + base::CreateDirectory(dirname); std::ofstream file; file.open(FilePathToUTF8(filename).c_str(), diff --git a/tools/gn/gyp_target_writer.cc b/tools/gn/gyp_target_writer.cc index 725dbdc..447b740 100644 --- a/tools/gn/gyp_target_writer.cc +++ b/tools/gn/gyp_target_writer.cc @@ -42,7 +42,7 @@ void GypTargetWriter::WriteFile(const SourceFile& gyp_file, const BuildSettings* debug_build_settings = debug_settings->build_settings(); base::FilePath gyp_file_path = debug_build_settings->GetFullPath(gyp_file); - file_util::CreateDirectory(gyp_file_path.DirName()); + base::CreateDirectory(gyp_file_path.DirName()); std::stringstream file; file << "# Generated by GN. Do not edit.\n\n"; diff --git a/tools/gn/ninja_build_writer.cc b/tools/gn/ninja_build_writer.cc index 79b2758..a8938b5 100644 --- a/tools/gn/ninja_build_writer.cc +++ b/tools/gn/ninja_build_writer.cc @@ -111,7 +111,7 @@ bool NinjaBuildWriter::RunAndWriteFile( base::FilePath ninja_file(build_settings->GetFullPath( SourceFile(build_settings->build_dir().value() + "build.ninja"))); - file_util::CreateDirectory(ninja_file.DirName()); + base::CreateDirectory(ninja_file.DirName()); std::ofstream file; file.open(FilePathToUTF8(ninja_file).c_str(), diff --git a/tools/gn/ninja_target_writer.cc b/tools/gn/ninja_target_writer.cc index 2b86626..4152336 100644 --- a/tools/gn/ninja_target_writer.cc +++ b/tools/gn/ninja_target_writer.cc @@ -51,7 +51,7 @@ void NinjaTargetWriter::RunAndWriteFile(const Target* target, if (g_scheduler->verbose_logging()) g_scheduler->Log("Writing", FilePathToUTF8(ninja_file)); - file_util::CreateDirectory(ninja_file.DirName()); + base::CreateDirectory(ninja_file.DirName()); // It's rediculously faster to write to a string and then write that to // disk in one operation than to use an fstream here. diff --git a/tools/gn/ninja_toolchain_writer.cc b/tools/gn/ninja_toolchain_writer.cc index 0a6b3de..c5330a0 100644 --- a/tools/gn/ninja_toolchain_writer.cc +++ b/tools/gn/ninja_toolchain_writer.cc @@ -47,7 +47,7 @@ bool NinjaToolchainWriter::RunAndWriteFile( settings->build_settings()))); ScopedTrace trace(TraceItem::TRACE_FILE_WRITE, FilePathToUTF8(ninja_file)); - file_util::CreateDirectory(ninja_file.DirName()); + base::CreateDirectory(ninja_file.DirName()); std::ofstream file; file.open(FilePathToUTF8(ninja_file).c_str(), diff --git a/ui/base/ui_base_paths.cc b/ui/base/ui_base_paths.cc index ae1f3ff..ee7566e 100644 --- a/ui/base/ui_base_paths.cc +++ b/ui/base/ui_base_paths.cc @@ -63,7 +63,7 @@ bool PathProvider(int key, base::FilePath* result) { } if (create_dir && !base::PathExists(cur) && - !file_util::CreateDirectory(cur)) + !base::CreateDirectory(cur)) return false; *result = cur; diff --git a/ui/surface/accelerated_surface_transformer_win_unittest.cc b/ui/surface/accelerated_surface_transformer_win_unittest.cc index 67460ad..968720f 100644 --- a/ui/surface/accelerated_surface_transformer_win_unittest.cc +++ b/ui/surface/accelerated_surface_transformer_win_unittest.cc @@ -75,7 +75,7 @@ bool WritePNGFile(const SkBitmap& bitmap, const base::FilePath& file_path) { if (gfx::PNGCodec::EncodeBGRASkBitmap(bitmap, discard_transparency, &png_data) && - file_util::CreateDirectory(file_path.DirName())) { + base::CreateDirectory(file_path.DirName())) { char* data = reinterpret_cast<char*>(&png_data[0]); int size = static_cast<int>(png_data.size()); return file_util::WriteFile(file_path, data, size) == size; diff --git a/webkit/browser/appcache/appcache_database.cc b/webkit/browser/appcache/appcache_database.cc index 68738d1d..a3dadd9 100644 --- a/webkit/browser/appcache/appcache_database.cc +++ b/webkit/browser/appcache/appcache_database.cc @@ -1011,7 +1011,7 @@ bool AppCacheDatabase::LazyOpen(bool create_if_needed) { bool opened = false; if (use_in_memory_db) { opened = db_->OpenInMemory(); - } else if (!file_util::CreateDirectory(db_file_path_.DirName())) { + } else if (!base::CreateDirectory(db_file_path_.DirName())) { LOG(ERROR) << "Failed to create appcache directory."; } else { opened = db_->Open(db_file_path_); @@ -1196,7 +1196,7 @@ bool AppCacheDatabase::DeleteExistingAndCreateNewDatabase() { // This also deletes the disk cache data. base::FilePath directory = db_file_path_.DirName(); if (!base::DeleteFile(directory, true) || - !file_util::CreateDirectory(directory)) { + !base::CreateDirectory(directory)) { return false; } diff --git a/webkit/browser/appcache/appcache_database_unittest.cc b/webkit/browser/appcache/appcache_database_unittest.cc index 9dc9080..71e4a08 100644 --- a/webkit/browser/appcache/appcache_database_unittest.cc +++ b/webkit/browser/appcache/appcache_database_unittest.cc @@ -55,7 +55,7 @@ TEST(AppCacheDatabaseTest, ReCreate) { const base::FilePath kDbFile = temp_dir.path().AppendASCII("appcache.db"); const base::FilePath kNestedDir = temp_dir.path().AppendASCII("nested"); const base::FilePath kOtherFile = kNestedDir.AppendASCII("other_file"); - EXPECT_TRUE(file_util::CreateDirectory(kNestedDir)); + EXPECT_TRUE(base::CreateDirectory(kNestedDir)); EXPECT_EQ(3, file_util::WriteFile(kOtherFile, "foo", 3)); AppCacheDatabase db(kDbFile); diff --git a/webkit/browser/appcache/appcache_storage_impl_unittest.cc b/webkit/browser/appcache/appcache_storage_impl_unittest.cc index 5dfc464..d2ae51d 100644 --- a/webkit/browser/appcache/appcache_storage_impl_unittest.cc +++ b/webkit/browser/appcache/appcache_storage_impl_unittest.cc @@ -1634,7 +1634,7 @@ class AppCacheStorageImplTest : public testing::Test { const std::string kCorruptData("deadbeef"); base::FilePath disk_cache_directory = temp_directory_.path().AppendASCII("Cache"); - ASSERT_TRUE(file_util::CreateDirectory(disk_cache_directory)); + ASSERT_TRUE(base::CreateDirectory(disk_cache_directory)); base::FilePath index_file = disk_cache_directory.AppendASCII("index"); EXPECT_EQ(static_cast<int>(kCorruptData.length()), file_util::WriteFile( diff --git a/webkit/browser/database/database_tracker.cc b/webkit/browser/database/database_tracker.cc index db6ab0ad..0b80811 100644 --- a/webkit/browser/database/database_tracker.cc +++ b/webkit/browser/database/database_tracker.cc @@ -480,7 +480,7 @@ bool DatabaseTracker::LazyInit() { meta_table_.reset(new sql::MetaTable()); is_initialized_ = - file_util::CreateDirectory(db_dir_) && + base::CreateDirectory(db_dir_) && (db_->is_open() || (is_incognito_ ? db_->OpenInMemory() : db_->Open(kTrackerDatabaseFullPath))) && diff --git a/webkit/browser/database/database_tracker_unittest.cc b/webkit/browser/database/database_tracker_unittest.cc index 1ba7e2d..8c3bc0d 100644 --- a/webkit/browser/database/database_tracker_unittest.cc +++ b/webkit/browser/database/database_tracker_unittest.cc @@ -229,10 +229,10 @@ class DatabaseTracker_TestHelper_Test { tracker->DatabaseOpened(kOrigin2, kDB3, kDescription, 0, &database_size); - EXPECT_TRUE(file_util::CreateDirectory( + EXPECT_TRUE(base::CreateDirectory( tracker->DatabaseDirectory().Append(base::FilePath::FromUTF16Unsafe( tracker->GetOriginDirectory(kOrigin1))))); - EXPECT_TRUE(file_util::CreateDirectory( + EXPECT_TRUE(base::CreateDirectory( tracker->DatabaseDirectory().Append(base::FilePath::FromUTF16Unsafe( tracker->GetOriginDirectory(kOrigin2))))); EXPECT_EQ(1, file_util::WriteFile( @@ -264,7 +264,7 @@ class DatabaseTracker_TestHelper_Test { // Recreate db1. tracker->DatabaseOpened(kOrigin1, kDB1, kDescription, 0, &database_size); - EXPECT_TRUE(file_util::CreateDirectory( + EXPECT_TRUE(base::CreateDirectory( tracker->DatabaseDirectory().Append(base::FilePath::FromUTF16Unsafe( tracker->GetOriginDirectory(kOrigin1))))); EXPECT_EQ(1, file_util::WriteFile( @@ -357,10 +357,10 @@ class DatabaseTracker_TestHelper_Test { // Write some data to each file and check that the listeners are // called with the appropriate values. - EXPECT_TRUE(file_util::CreateDirectory( + EXPECT_TRUE(base::CreateDirectory( tracker->DatabaseDirectory().Append(base::FilePath::FromUTF16Unsafe( tracker->GetOriginDirectory(kOrigin1))))); - EXPECT_TRUE(file_util::CreateDirectory( + EXPECT_TRUE(base::CreateDirectory( tracker->DatabaseDirectory().Append(base::FilePath::FromUTF16Unsafe( tracker->GetOriginDirectory(kOrigin2))))); EXPECT_EQ(1, file_util::WriteFile( @@ -484,7 +484,7 @@ class DatabaseTracker_TestHelper_Test { test_quota_proxy->reset(); base::FilePath db_file(tracker->GetFullDBFilePath(kOriginId, kName)); - EXPECT_TRUE(file_util::CreateDirectory(db_file.DirName())); + EXPECT_TRUE(base::CreateDirectory(db_file.DirName())); EXPECT_TRUE(EnsureFileOfSize(db_file, 10)); tracker->DatabaseModified(kOriginId, kName); EXPECT_TRUE(test_quota_proxy->WasModificationNotified(kOrigin, 10)); @@ -512,7 +512,7 @@ class DatabaseTracker_TestHelper_Test { test_quota_proxy->reset(); db_file = tracker->GetFullDBFilePath(kOriginId, kName); - EXPECT_TRUE(file_util::CreateDirectory(db_file.DirName())); + EXPECT_TRUE(base::CreateDirectory(db_file.DirName())); EXPECT_TRUE(EnsureFileOfSize(db_file, 100)); tracker->DatabaseModified(kOriginId, kName); EXPECT_TRUE(test_quota_proxy->WasModificationNotified(kOrigin, 100)); @@ -538,7 +538,7 @@ class DatabaseTracker_TestHelper_Test { EXPECT_TRUE(test_quota_proxy->WasAccessNotified(kOrigin)); test_quota_proxy->reset(); db_file = tracker->GetFullDBFilePath(kOriginId, kName); - EXPECT_TRUE(file_util::CreateDirectory(db_file.DirName())); + EXPECT_TRUE(base::CreateDirectory(db_file.DirName())); EXPECT_TRUE(EnsureFileOfSize(db_file, 100)); DatabaseConnections crashed_renderer_connections; crashed_renderer_connections.AddConnection(kOriginId, kName); @@ -589,11 +589,11 @@ class DatabaseTracker_TestHelper_Test { // Write some data to each file. base::FilePath db_file; db_file = tracker->GetFullDBFilePath(kOrigin1, kDB1); - EXPECT_TRUE(file_util::CreateDirectory(db_file.DirName())); + EXPECT_TRUE(base::CreateDirectory(db_file.DirName())); EXPECT_TRUE(EnsureFileOfSize(db_file, 1)); db_file = tracker->GetFullDBFilePath(kOrigin2, kDB2); - EXPECT_TRUE(file_util::CreateDirectory(db_file.DirName())); + EXPECT_TRUE(base::CreateDirectory(db_file.DirName())); EXPECT_TRUE(EnsureFileOfSize(db_file, 2)); // Store the origin database directories as long as they still exist. @@ -670,11 +670,11 @@ class DatabaseTracker_TestHelper_Test { // Write some data to each file. base::FilePath db_file; db_file = tracker->GetFullDBFilePath(kOrigin1, kDB1); - EXPECT_TRUE(file_util::CreateDirectory(db_file.DirName())); + EXPECT_TRUE(base::CreateDirectory(db_file.DirName())); EXPECT_TRUE(EnsureFileOfSize(db_file, 1)); db_file = tracker->GetFullDBFilePath(kOrigin2, kDB2); - EXPECT_TRUE(file_util::CreateDirectory(db_file.DirName())); + EXPECT_TRUE(base::CreateDirectory(db_file.DirName())); EXPECT_TRUE(EnsureFileOfSize(db_file, 2)); // Store the origin database directories as long as they still exist. @@ -790,7 +790,7 @@ class DatabaseTracker_TestHelper_Test { &database_size); base::FilePath spoof_db_file = tracker->GetFullDBFilePath(kOriginId, kName); EXPECT_FALSE(tracker->GetFullDBFilePath(kOriginId, kName).empty()); - EXPECT_TRUE(file_util::CreateDirectory(spoof_db_file.DirName())); + EXPECT_TRUE(base::CreateDirectory(spoof_db_file.DirName())); EXPECT_TRUE(EnsureFileOfSize(spoof_db_file, 1)); // Verify does no harm with a non-error is reported. @@ -819,7 +819,7 @@ class DatabaseTracker_TestHelper_Test { base::FilePath spoof_db_file2 = tracker->GetFullDBFilePath(kOriginId, kName); EXPECT_FALSE(tracker->GetFullDBFilePath(kOriginId, kName).empty()); EXPECT_NE(spoof_db_file, spoof_db_file2); - EXPECT_TRUE(file_util::CreateDirectory(spoof_db_file2.DirName())); + EXPECT_TRUE(base::CreateDirectory(spoof_db_file2.DirName())); EXPECT_TRUE(EnsureFileOfSize(spoof_db_file2, 1)); // Verify that with no connection open, the db is deleted immediately. diff --git a/webkit/browser/database/vfs_backend.cc b/webkit/browser/database/vfs_backend.cc index bf43192..41331d6 100644 --- a/webkit/browser/database/vfs_backend.cc +++ b/webkit/browser/database/vfs_backend.cc @@ -63,7 +63,7 @@ void VfsBackend::OpenFile(const base::FilePath& file_path, // Verify the flags for consistency and create the database // directory if it doesn't exist. if (!OpenFileFlagsAreConsistent(desired_flags) || - !file_util::CreateDirectory(file_path.DirName())) + !base::CreateDirectory(file_path.DirName())) return; int flags = 0; diff --git a/webkit/browser/fileapi/native_file_util.cc b/webkit/browser/fileapi/native_file_util.cc index 48569d5..e5ff2e7 100644 --- a/webkit/browser/fileapi/native_file_util.cc +++ b/webkit/browser/fileapi/native_file_util.cc @@ -137,7 +137,7 @@ PlatformFileError NativeFileUtil::CreateDirectory( if (path_exists && !base::DirectoryExists(path)) return base::PLATFORM_FILE_ERROR_EXISTS; - if (!file_util::CreateDirectory(path)) + if (!base::CreateDirectory(path)) return base::PLATFORM_FILE_ERROR_FAILED; if (!SetPlatformSpecificDirectoryPermissions(path)) { diff --git a/webkit/browser/fileapi/obfuscated_file_util.cc b/webkit/browser/fileapi/obfuscated_file_util.cc index 1e6b3bc..9b28d57 100644 --- a/webkit/browser/fileapi/obfuscated_file_util.cc +++ b/webkit/browser/fileapi/obfuscated_file_util.cc @@ -852,7 +852,7 @@ base::FilePath ObfuscatedFileUtil::GetDirectoryForOriginAndType( base::FilePath path = origin_dir.AppendASCII(type_string); base::PlatformFileError error = base::PLATFORM_FILE_OK; if (!base::DirectoryExists(path) && - (!create || !file_util::CreateDirectory(path))) { + (!create || !base::CreateDirectory(path))) { error = create ? base::PLATFORM_FILE_ERROR_FAILED : base::PLATFORM_FILE_ERROR_NOT_FOUND; @@ -1210,7 +1210,7 @@ base::FilePath ObfuscatedFileUtil::GetDirectoryForOrigin( } if (!exists_in_fs) { - if (!create || !file_util::CreateDirectory(path)) { + if (!create || !base::CreateDirectory(path)) { if (error_code) *error_code = create ? base::PLATFORM_FILE_ERROR_FAILED : @@ -1262,7 +1262,7 @@ bool ObfuscatedFileUtil::InitOriginDatabase(const GURL& origin_hint, if (!create && !base::DirectoryExists(file_system_directory_)) return false; - if (!file_util::CreateDirectory(file_system_directory_)) { + if (!base::CreateDirectory(file_system_directory_)) { LOG(WARNING) << "Failed to create FileSystem directory: " << file_system_directory_.value(); return false; diff --git a/webkit/browser/fileapi/sandbox_directory_database.cc b/webkit/browser/fileapi/sandbox_directory_database.cc index 083df3e..4e4dd87 100644 --- a/webkit/browser/fileapi/sandbox_directory_database.cc +++ b/webkit/browser/fileapi/sandbox_directory_database.cc @@ -753,7 +753,7 @@ bool SandboxDirectoryDatabase::Init(RecoveryOption recovery_option) { LOG(WARNING) << "Clearing SandboxDirectoryDatabase."; if (!base::DeleteFile(filesystem_data_directory_, true)) return false; - if (!file_util::CreateDirectory(filesystem_data_directory_)) + if (!base::CreateDirectory(filesystem_data_directory_)) return false; return Init(FAIL_ON_CORRUPTION); } diff --git a/webkit/browser/fileapi/sandbox_directory_database_unittest.cc b/webkit/browser/fileapi/sandbox_directory_database_unittest.cc index 033a992..b43dc23 100644 --- a/webkit/browser/fileapi/sandbox_directory_database_unittest.cc +++ b/webkit/browser/fileapi/sandbox_directory_database_unittest.cc @@ -83,7 +83,7 @@ class SandboxDirectoryDatabaseTest : public testing::Test { base::FilePath local_path = path().Append(data_path); if (!base::DirectoryExists(local_path.DirName())) - ASSERT_TRUE(file_util::CreateDirectory(local_path.DirName())); + ASSERT_TRUE(base::CreateDirectory(local_path.DirName())); bool created = false; base::PlatformFileError error = base::PLATFORM_FILE_ERROR_FAILED; @@ -102,7 +102,7 @@ class SandboxDirectoryDatabaseTest : public testing::Test { void ClearDatabaseAndDirectory() { db_.reset(); ASSERT_TRUE(base::DeleteFile(path(), true /* recursive */)); - ASSERT_TRUE(file_util::CreateDirectory(path())); + ASSERT_TRUE(base::CreateDirectory(path())); db_.reset(new SandboxDirectoryDatabase(path())); } diff --git a/webkit/browser/fileapi/sandbox_origin_database.cc b/webkit/browser/fileapi/sandbox_origin_database.cc index 4ce8301..ee01d22 100644 --- a/webkit/browser/fileapi/sandbox_origin_database.cc +++ b/webkit/browser/fileapi/sandbox_origin_database.cc @@ -111,7 +111,7 @@ bool SandboxOriginDatabase::Init(InitOption init_option, case DELETE_ON_CORRUPTION: if (!base::DeleteFile(file_system_directory_, true)) return false; - if (!file_util::CreateDirectory(file_system_directory_)) + if (!base::CreateDirectory(file_system_directory_)) return false; return Init(init_option, FAIL_ON_CORRUPTION); } diff --git a/webkit/browser/fileapi/sandbox_origin_database_unittest.cc b/webkit/browser/fileapi/sandbox_origin_database_unittest.cc index 87c5e23..340baf2 100644 --- a/webkit/browser/fileapi/sandbox_origin_database_unittest.cc +++ b/webkit/browser/fileapi/sandbox_origin_database_unittest.cc @@ -34,7 +34,7 @@ TEST(SandboxOriginDatabaseTest, BasicTest) { ASSERT_TRUE(dir.CreateUniqueTempDir()); const base::FilePath kFSDir = dir.path().Append(kFileSystemDirName); EXPECT_FALSE(base::PathExists(kFSDir)); - EXPECT_TRUE(file_util::CreateDirectory(kFSDir)); + EXPECT_TRUE(base::CreateDirectory(kFSDir)); SandboxOriginDatabase database(kFSDir); std::string origin("origin"); @@ -64,7 +64,7 @@ TEST(SandboxOriginDatabaseTest, TwoPathTest) { ASSERT_TRUE(dir.CreateUniqueTempDir()); const base::FilePath kFSDir = dir.path().Append(kFileSystemDirName); EXPECT_FALSE(base::PathExists(kFSDir)); - EXPECT_TRUE(file_util::CreateDirectory(kFSDir)); + EXPECT_TRUE(base::CreateDirectory(kFSDir)); SandboxOriginDatabase database(kFSDir); std::string origin0("origin0"); @@ -92,7 +92,7 @@ TEST(SandboxOriginDatabaseTest, DropDatabaseTest) { ASSERT_TRUE(dir.CreateUniqueTempDir()); const base::FilePath kFSDir = dir.path().Append(kFileSystemDirName); EXPECT_FALSE(base::PathExists(kFSDir)); - EXPECT_TRUE(file_util::CreateDirectory(kFSDir)); + EXPECT_TRUE(base::CreateDirectory(kFSDir)); SandboxOriginDatabase database(kFSDir); std::string origin("origin"); @@ -120,7 +120,7 @@ TEST(SandboxOriginDatabaseTest, DeleteOriginTest) { ASSERT_TRUE(dir.CreateUniqueTempDir()); const base::FilePath kFSDir = dir.path().Append(kFileSystemDirName); EXPECT_FALSE(base::PathExists(kFSDir)); - EXPECT_TRUE(file_util::CreateDirectory(kFSDir)); + EXPECT_TRUE(base::CreateDirectory(kFSDir)); SandboxOriginDatabase database(kFSDir); std::string origin("origin"); @@ -147,7 +147,7 @@ TEST(SandboxOriginDatabaseTest, ListOriginsTest) { ASSERT_TRUE(dir.CreateUniqueTempDir()); const base::FilePath kFSDir = dir.path().Append(kFileSystemDirName); EXPECT_FALSE(base::PathExists(kFSDir)); - EXPECT_TRUE(file_util::CreateDirectory(kFSDir)); + EXPECT_TRUE(base::CreateDirectory(kFSDir)); std::vector<SandboxOriginDatabase::OriginRecord> origins; @@ -197,7 +197,7 @@ TEST(SandboxOriginDatabaseTest, DatabaseRecoveryTest) { const base::FilePath kFSDir = dir.path().Append(kFileSystemDirName); const base::FilePath kDBDir = kFSDir.Append(kOriginDatabaseName); EXPECT_FALSE(base::PathExists(kFSDir)); - EXPECT_TRUE(file_util::CreateDirectory(kFSDir)); + EXPECT_TRUE(base::CreateDirectory(kFSDir)); const std::string kOrigins[] = { "foo.example.com", @@ -217,13 +217,13 @@ TEST(SandboxOriginDatabaseTest, DatabaseRecoveryTest) { EXPECT_TRUE(database->GetPathForOrigin(kOrigins[i], &path)); if (i != 1) - EXPECT_TRUE(file_util::CreateDirectory(kFSDir.Append(path))); + EXPECT_TRUE(base::CreateDirectory(kFSDir.Append(path))); } database.reset(); const base::FilePath kGarbageDir = kFSDir.AppendASCII("foo"); const base::FilePath kGarbageFile = kGarbageDir.AppendASCII("bar"); - EXPECT_TRUE(file_util::CreateDirectory(kGarbageDir)); + EXPECT_TRUE(base::CreateDirectory(kGarbageDir)); bool created = false; base::PlatformFileError error; base::PlatformFile file = base::CreatePlatformFile( @@ -277,7 +277,7 @@ TEST(SandboxOriginDatabaseTest, DatabaseRecoveryForMissingDBFileTest) { const base::FilePath kFSDir = dir.path().Append(kFileSystemDirName); const base::FilePath kDBDir = kFSDir.Append(kOriginDatabaseName); EXPECT_FALSE(base::PathExists(kFSDir)); - EXPECT_TRUE(file_util::CreateDirectory(kFSDir)); + EXPECT_TRUE(base::CreateDirectory(kFSDir)); const std::string kOrigin = "foo.example.com"; base::FilePath path; @@ -288,7 +288,7 @@ TEST(SandboxOriginDatabaseTest, DatabaseRecoveryForMissingDBFileTest) { EXPECT_TRUE(database->GetPathForOrigin(kOrigin, &path)); EXPECT_FALSE(path.empty()); EXPECT_TRUE(database->GetPathForOrigin(kOrigin, &path)); - EXPECT_TRUE(file_util::CreateDirectory(kFSDir.Append(path))); + EXPECT_TRUE(base::CreateDirectory(kFSDir.Append(path))); database.reset(); DeleteDatabaseFile(kDBDir, kLevelDBFileTypes[i]); diff --git a/webkit/browser/fileapi/sandbox_prioritized_origin_database_unittest.cc b/webkit/browser/fileapi/sandbox_prioritized_origin_database_unittest.cc index 2195f36..fc0b958 100644 --- a/webkit/browser/fileapi/sandbox_prioritized_origin_database_unittest.cc +++ b/webkit/browser/fileapi/sandbox_prioritized_origin_database_unittest.cc @@ -162,13 +162,13 @@ TEST(SandboxPrioritizedOriginDatabaseTest, MigrationTest) { // Populate the origin directory with some fake data. old_dir_db_path1 = dir.path().Append(path1); - ASSERT_TRUE(file_util::CreateDirectory(old_dir_db_path1)); + ASSERT_TRUE(base::CreateDirectory(old_dir_db_path1)); EXPECT_EQ(static_cast<int>(kFakeDirectoryData1.size()), file_util::WriteFile(old_dir_db_path1.AppendASCII("dummy"), kFakeDirectoryData1.data(), kFakeDirectoryData1.size())); old_dir_db_path2 = dir.path().Append(path2); - ASSERT_TRUE(file_util::CreateDirectory(old_dir_db_path2)); + ASSERT_TRUE(base::CreateDirectory(old_dir_db_path2)); EXPECT_EQ(static_cast<int>(kFakeDirectoryData2.size()), file_util::WriteFile(old_dir_db_path2.AppendASCII("dummy"), kFakeDirectoryData2.data(), diff --git a/webkit/browser/fileapi/test_file_set.cc b/webkit/browser/fileapi/test_file_set.cc index 7b0b0f0..109a055 100644 --- a/webkit/browser/fileapi/test_file_set.cc +++ b/webkit/browser/fileapi/test_file_set.cc @@ -43,7 +43,7 @@ void SetUpOneTestCase(const base::FilePath& root_path, const TestCaseRecord& test_case) { base::FilePath path = root_path.Append(test_case.path); if (test_case.is_directory) { - ASSERT_TRUE(file_util::CreateDirectory(path)); + ASSERT_TRUE(base::CreateDirectory(path)); return; } base::PlatformFileError error_code; diff --git a/webkit/browser/quota/quota_database.cc b/webkit/browser/quota/quota_database.cc index 759540f..1905f6f 100644 --- a/webkit/browser/quota/quota_database.cc +++ b/webkit/browser/quota/quota_database.cc @@ -452,7 +452,7 @@ bool QuotaDatabase::LazyOpen(bool create_if_needed) { bool opened = false; if (in_memory_only) { opened = db_->OpenInMemory(); - } else if (!file_util::CreateDirectory(db_file_path_.DirName())) { + } else if (!base::CreateDirectory(db_file_path_.DirName())) { LOG(ERROR) << "Failed to create quota database directory."; } else { opened = db_->Open(db_file_path_); diff --git a/webkit/browser/quota/quota_database_unittest.cc b/webkit/browser/quota/quota_database_unittest.cc index e1e78a5..e457da5 100644 --- a/webkit/browser/quota/quota_database_unittest.cc +++ b/webkit/browser/quota/quota_database_unittest.cc @@ -418,7 +418,7 @@ class QuotaDatabaseTest : public testing::Test { if (kDbFile.empty()) { return db->OpenInMemory(); } - if (!file_util::CreateDirectory(kDbFile.DirName())) + if (!base::CreateDirectory(kDbFile.DirName())) return false; if (!db->Open(kDbFile)) return false; diff --git a/webkit/browser/quota/quota_manager.cc b/webkit/browser/quota/quota_manager.cc index 123307e..0663935 100644 --- a/webkit/browser/quota/quota_manager.cc +++ b/webkit/browser/quota/quota_manager.cc @@ -199,7 +199,7 @@ bool UpdateModifiedTimeOnDBThread(const GURL& origin, int64 CallSystemGetAmountOfFreeDiskSpace(const base::FilePath& profile_path) { // Ensure the profile path exists. - if(!file_util::CreateDirectory(profile_path)) { + if(!base::CreateDirectory(profile_path)) { LOG(WARNING) << "Create directory failed for path" << profile_path.value(); return 0; } |