diff options
Diffstat (limited to 'webkit')
16 files changed, 40 insertions, 40 deletions
diff --git a/webkit/browser/appcache/appcache_database_unittest.cc b/webkit/browser/appcache/appcache_database_unittest.cc index 5974d83..34a6f0c 100644 --- a/webkit/browser/appcache/appcache_database_unittest.cc +++ b/webkit/browser/appcache/appcache_database_unittest.cc @@ -67,13 +67,13 @@ TEST(AppCacheDatabaseTest, ReCreate) { EXPECT_TRUE(db.LazyOpen(true)); EXPECT_TRUE(base::PathExists(kDbFile)); - EXPECT_TRUE(file_util::DirectoryExists(kNestedDir)); + EXPECT_TRUE(base::DirectoryExists(kNestedDir)); EXPECT_TRUE(base::PathExists(kOtherFile)); EXPECT_TRUE(db.DeleteExistingAndCreateNewDatabase()); EXPECT_TRUE(base::PathExists(kDbFile)); - EXPECT_FALSE(file_util::DirectoryExists(kNestedDir)); + EXPECT_FALSE(base::DirectoryExists(kNestedDir)); EXPECT_FALSE(base::PathExists(kOtherFile)); } diff --git a/webkit/browser/database/database_tracker.cc b/webkit/browser/database/database_tracker.cc index ce155ca..cc14e140 100644 --- a/webkit/browser/database/database_tracker.cc +++ b/webkit/browser/database/database_tracker.cc @@ -451,7 +451,7 @@ bool DatabaseTracker::LazyInit() { // If there are left-over directories from failed deletion attempts, clean // them up. - if (file_util::DirectoryExists(db_dir_)) { + if (base::DirectoryExists(db_dir_)) { base::FileEnumerator directories( db_dir_, false, @@ -467,7 +467,7 @@ bool DatabaseTracker::LazyInit() { // have a meta table, delete the database directory. const base::FilePath kTrackerDatabaseFullPath = db_dir_.Append(base::FilePath(kTrackerDatabaseFileName)); - if (file_util::DirectoryExists(db_dir_) && + if (base::DirectoryExists(db_dir_) && base::PathExists(kTrackerDatabaseFullPath) && (!db_->Open(kTrackerDatabaseFullPath) || !sql::MetaTable::DoesTableExist(db_.get()))) { @@ -797,7 +797,7 @@ void DatabaseTracker::DeleteIncognitoDBDirectory() { base::FilePath incognito_db_dir = profile_path_.Append(kIncognitoDatabaseDirectoryName); - if (file_util::DirectoryExists(incognito_db_dir)) + if (base::DirectoryExists(incognito_db_dir)) base::Delete(incognito_db_dir, true); } diff --git a/webkit/browser/dom_storage/dom_storage_database.cc b/webkit/browser/dom_storage/dom_storage_database.cc index 12e38ed..8a94fc8 100644 --- a/webkit/browser/dom_storage/dom_storage_database.cc +++ b/webkit/browser/dom_storage/dom_storage_database.cc @@ -266,7 +266,7 @@ bool DomStorageDatabase::DeleteFileAndRecreate() { tried_to_recreate_ = true; // If it's not a directory and we can delete the file, try and open it again. - if (!file_util::DirectoryExists(file_path_) && + if (!base::DirectoryExists(file_path_) && sql::Connection::Delete(file_path_)) { return LazyOpen(true); } diff --git a/webkit/browser/fileapi/dump_file_system.cc b/webkit/browser/fileapi/dump_file_system.cc index 1c165d7..4dd60f2 100644 --- a/webkit/browser/fileapi/dump_file_system.cc +++ b/webkit/browser/fileapi/dump_file_system.cc @@ -73,7 +73,7 @@ static void DumpDirectoryTree(const std::string& origin_name, printf("=== ORIGIN %s %s ===\n", origin_name.c_str(), FilePathToString(origin_dir).c_str()); - if (!file_util::DirectoryExists(origin_dir)) + if (!base::DirectoryExists(origin_dir)) return; SandboxDirectoryDatabase directory_db(origin_dir); @@ -189,7 +189,7 @@ int main(int argc, char* argv[]) { ShowUsageAndExit(arg0); const base::FilePath file_system_dir = fileapi::StringToFilePath(argv[1]); - if (!file_util::DirectoryExists(file_system_dir)) { + if (!base::DirectoryExists(file_system_dir)) { ShowMessageAndExit(fileapi::FilePathToString(file_system_dir) + " is not a filesystem directory"); } diff --git a/webkit/browser/fileapi/local_file_util_unittest.cc b/webkit/browser/fileapi/local_file_util_unittest.cc index 46f2e9a..0866f1e 100644 --- a/webkit/browser/fileapi/local_file_util_unittest.cc +++ b/webkit/browser/fileapi/local_file_util_unittest.cc @@ -75,11 +75,11 @@ class LocalFileUtilTest : public testing::Test { bool FileExists(const char *file_name) { return base::PathExists(LocalPath(file_name)) && - !file_util::DirectoryExists(LocalPath(file_name)); + !base::DirectoryExists(LocalPath(file_name)); } bool DirectoryExists(const char *file_name) { - return file_util::DirectoryExists(LocalPath(file_name)); + return base::DirectoryExists(LocalPath(file_name)); } int64 GetSize(const char *file_name) { diff --git a/webkit/browser/fileapi/native_file_util.cc b/webkit/browser/fileapi/native_file_util.cc index 84b027b..efc6d42 100644 --- a/webkit/browser/fileapi/native_file_util.cc +++ b/webkit/browser/fileapi/native_file_util.cc @@ -79,11 +79,11 @@ bool NativeFileEnumerator::IsDirectory() { PlatformFileError NativeFileUtil::CreateOrOpen( const base::FilePath& path, int file_flags, PlatformFile* file_handle, bool* created) { - if (!file_util::DirectoryExists(path.DirName())) { + if (!base::DirectoryExists(path.DirName())) { // If its parent does not exist, should return NOT_FOUND error. return base::PLATFORM_FILE_ERROR_NOT_FOUND; } - if (file_util::DirectoryExists(path)) + if (base::DirectoryExists(path)) return base::PLATFORM_FILE_ERROR_NOT_A_FILE; PlatformFileError error_code = base::PLATFORM_FILE_OK; *file_handle = base::CreatePlatformFile(path, file_flags, @@ -100,7 +100,7 @@ PlatformFileError NativeFileUtil::Close(PlatformFile file_handle) { PlatformFileError NativeFileUtil::EnsureFileExists( const base::FilePath& path, bool* created) { - if (!file_util::DirectoryExists(path.DirName())) + if (!base::DirectoryExists(path.DirName())) // If its parent does not exist, should return NOT_FOUND error. return base::PLATFORM_FILE_ERROR_NOT_FOUND; PlatformFileError error_code = base::PLATFORM_FILE_OK; @@ -134,7 +134,7 @@ PlatformFileError NativeFileUtil::CreateDirectory( return base::PLATFORM_FILE_ERROR_EXISTS; // If file exists at the path. - if (path_exists && !file_util::DirectoryExists(path)) + if (path_exists && !base::DirectoryExists(path)) return base::PLATFORM_FILE_ERROR_EXISTS; if (!file_util::CreateDirectory(path)) @@ -199,7 +199,7 @@ bool NativeFileUtil::PathExists(const base::FilePath& path) { } bool NativeFileUtil::DirectoryExists(const base::FilePath& path) { - return file_util::DirectoryExists(path); + return base::DirectoryExists(path); } PlatformFileError NativeFileUtil::CopyOrMoveFile( @@ -240,7 +240,7 @@ PlatformFileError NativeFileUtil::CopyOrMoveFile( PlatformFileError NativeFileUtil::DeleteFile(const base::FilePath& path) { if (!base::PathExists(path)) return base::PLATFORM_FILE_ERROR_NOT_FOUND; - if (file_util::DirectoryExists(path)) + if (base::DirectoryExists(path)) return base::PLATFORM_FILE_ERROR_NOT_A_FILE; if (!base::Delete(path, false)) return base::PLATFORM_FILE_ERROR_FAILED; @@ -250,7 +250,7 @@ PlatformFileError NativeFileUtil::DeleteFile(const base::FilePath& path) { PlatformFileError NativeFileUtil::DeleteDirectory(const base::FilePath& path) { if (!base::PathExists(path)) return base::PLATFORM_FILE_ERROR_NOT_FOUND; - if (!file_util::DirectoryExists(path)) + if (!base::DirectoryExists(path)) return base::PLATFORM_FILE_ERROR_NOT_A_DIRECTORY; if (!file_util::IsDirectoryEmpty(path)) return base::PLATFORM_FILE_ERROR_NOT_EMPTY; diff --git a/webkit/browser/fileapi/native_file_util_unittest.cc b/webkit/browser/fileapi/native_file_util_unittest.cc index 3b99ab1..1ed699e 100644 --- a/webkit/browser/fileapi/native_file_util_unittest.cc +++ b/webkit/browser/fileapi/native_file_util_unittest.cc @@ -30,7 +30,7 @@ class NativeFileUtilTest : public testing::Test { bool FileExists(const base::FilePath& path) { return base::PathExists(path) && - !file_util::DirectoryExists(path); + !base::DirectoryExists(path); } int64 GetSize(const base::FilePath& path) { @@ -99,7 +99,7 @@ TEST_F(NativeFileUtilTest, CreateAndDeleteDirectory) { false /* recursive */)); EXPECT_TRUE(NativeFileUtil::DirectoryExists(dir_name)); - EXPECT_TRUE(file_util::DirectoryExists(dir_name)); + EXPECT_TRUE(base::DirectoryExists(dir_name)); ASSERT_EQ(base::PLATFORM_FILE_ERROR_EXISTS, NativeFileUtil::CreateDirectory(dir_name, @@ -108,7 +108,7 @@ TEST_F(NativeFileUtilTest, CreateAndDeleteDirectory) { ASSERT_EQ(base::PLATFORM_FILE_OK, NativeFileUtil::DeleteDirectory(dir_name)); - EXPECT_FALSE(file_util::DirectoryExists(dir_name)); + EXPECT_FALSE(base::DirectoryExists(dir_name)); EXPECT_FALSE(NativeFileUtil::DirectoryExists(dir_name)); } @@ -240,7 +240,7 @@ TEST_F(NativeFileUtilTest, CopyFile) { base::FilePath dir = Path("dir"); ASSERT_EQ(base::PLATFORM_FILE_OK, NativeFileUtil::CreateDirectory(dir, false, false)); - ASSERT_TRUE(file_util::DirectoryExists(dir)); + ASSERT_TRUE(base::DirectoryExists(dir)); base::FilePath to_dir_file = dir.AppendASCII("file"); ASSERT_EQ(base::PLATFORM_FILE_OK, NativeFileUtil::CopyOrMoveFile(from_file, to_dir_file, true)); @@ -299,7 +299,7 @@ TEST_F(NativeFileUtilTest, MoveFile) { base::FilePath dir = Path("dir"); ASSERT_EQ(base::PLATFORM_FILE_OK, NativeFileUtil::CreateDirectory(dir, false, false)); - ASSERT_TRUE(file_util::DirectoryExists(dir)); + ASSERT_TRUE(base::DirectoryExists(dir)); base::FilePath to_dir_file = dir.AppendASCII("file"); ASSERT_EQ(base::PLATFORM_FILE_OK, NativeFileUtil::CopyOrMoveFile(from_file, to_dir_file, false)); diff --git a/webkit/browser/fileapi/obfuscated_file_util.cc b/webkit/browser/fileapi/obfuscated_file_util.cc index abc3cc5..c4baa68 100644 --- a/webkit/browser/fileapi/obfuscated_file_util.cc +++ b/webkit/browser/fileapi/obfuscated_file_util.cc @@ -244,7 +244,7 @@ class ObfuscatedOriginEnumerator } base::FilePath path = base_file_path_.Append(current_.path).Append(type_string); - return file_util::DirectoryExists(path); + return base::DirectoryExists(path); } private: @@ -874,7 +874,7 @@ base::FilePath ObfuscatedFileUtil::GetDirectoryForOriginAndType( } base::FilePath path = origin_dir.Append(type_string); base::PlatformFileError error = base::PLATFORM_FILE_OK; - if (!file_util::DirectoryExists(path) && + if (!base::DirectoryExists(path) && (!create || !file_util::CreateDirectory(path))) { error = create ? base::PLATFORM_FILE_ERROR_FAILED : @@ -922,7 +922,7 @@ bool ObfuscatedFileUtil::DeleteDirectoryForOriginAndType( DCHECK(type != kFileSystemTypeSyncableForInternalSync); for (size_t i = 0; i < other_types.size(); ++i) { - if (file_util::DirectoryExists( + if (base::DirectoryExists( origin_path.Append(GetDirectoryNameForType(other_types[i])))) { // Other type's directory exists; just return true here. return true; @@ -995,7 +995,7 @@ int64 ObfuscatedFileUtil::ComputeFilePathCost(const base::FilePath& path) { void ObfuscatedFileUtil::MaybePrepopulateDatabase() { base::FilePath isolated_origin_dir = file_system_directory_.Append( SandboxIsolatedOriginDatabase::kOriginDirectory); - if (!file_util::DirectoryExists(isolated_origin_dir)) + if (!base::DirectoryExists(isolated_origin_dir)) return; const FileSystemType kPrepopulateTypes[] = { @@ -1009,7 +1009,7 @@ void ObfuscatedFileUtil::MaybePrepopulateDatabase() { base::FilePath::StringType type_string = GetDirectoryNameForType(type); DCHECK(!type_string.empty()); base::FilePath path = isolated_origin_dir.Append(type_string); - if (!file_util::DirectoryExists(path)) + if (!base::DirectoryExists(path)) continue; scoped_ptr<SandboxDirectoryDatabase> db(new SandboxDirectoryDatabase(path)); if (db->Init(SandboxDirectoryDatabase::FAIL_ON_CORRUPTION)) { @@ -1238,7 +1238,7 @@ base::FilePath ObfuscatedFileUtil::GetDirectoryForOrigin( } base::FilePath path = file_system_directory_.Append(directory_name); - bool exists_in_fs = file_util::DirectoryExists(path); + bool exists_in_fs = base::DirectoryExists(path); if (!exists_in_db && exists_in_fs) { if (!base::Delete(path, true)) { if (error_code) @@ -1298,7 +1298,7 @@ bool ObfuscatedFileUtil::InitOriginDatabase(bool create) { if (origin_database_) return true; - if (!create && !file_util::DirectoryExists(file_system_directory_)) + if (!create && !base::DirectoryExists(file_system_directory_)) return false; if (!file_util::CreateDirectory(file_system_directory_)) { LOG(WARNING) << "Failed to create FileSystem directory: " << diff --git a/webkit/browser/fileapi/obfuscated_file_util_unittest.cc b/webkit/browser/fileapi/obfuscated_file_util_unittest.cc index e865b3d..1ceef8d 100644 --- a/webkit/browser/fileapi/obfuscated_file_util_unittest.cc +++ b/webkit/browser/fileapi/obfuscated_file_util_unittest.cc @@ -37,7 +37,7 @@ namespace fileapi { namespace { bool FileExists(const base::FilePath& path) { - return base::PathExists(path) && !file_util::DirectoryExists(path); + return base::PathExists(path) && !base::DirectoryExists(path); } int64 GetSize(const base::FilePath& path) { diff --git a/webkit/browser/fileapi/sandbox_directory_database.cc b/webkit/browser/fileapi/sandbox_directory_database.cc index 41cc429..5e4ba3d 100644 --- a/webkit/browser/fileapi/sandbox_directory_database.cc +++ b/webkit/browser/fileapi/sandbox_directory_database.cc @@ -180,7 +180,7 @@ DatabaseCheckHelper::DatabaseCheckHelper( last_file_id_(-1), last_integer_(-1) { DCHECK(dir_db_); DCHECK(db_); - DCHECK(!path_.empty() && file_util::DirectoryExists(path_)); + DCHECK(!path_.empty() && base::DirectoryExists(path_)); } bool DatabaseCheckHelper::IsDatabaseEmpty() { diff --git a/webkit/browser/fileapi/sandbox_directory_database_unittest.cc b/webkit/browser/fileapi/sandbox_directory_database_unittest.cc index e163c8b..9278129 100644 --- a/webkit/browser/fileapi/sandbox_directory_database_unittest.cc +++ b/webkit/browser/fileapi/sandbox_directory_database_unittest.cc @@ -81,7 +81,7 @@ class SandboxDirectoryDatabaseTest : public testing::Test { ASSERT_TRUE(db_->AddFileInfo(info, &file_id)); base::FilePath local_path = path().Append(data_path); - if (!file_util::DirectoryExists(local_path.DirName())) + if (!base::DirectoryExists(local_path.DirName())) ASSERT_TRUE(file_util::CreateDirectory(local_path.DirName())); bool created = false; diff --git a/webkit/browser/fileapi/sandbox_file_system_backend.cc b/webkit/browser/fileapi/sandbox_file_system_backend.cc index f81af13..eb319f4 100644 --- a/webkit/browser/fileapi/sandbox_file_system_backend.cc +++ b/webkit/browser/fileapi/sandbox_file_system_backend.cc @@ -403,7 +403,7 @@ int64 SandboxFileSystemBackend::GetOriginUsageOnFileThread( base::FilePath base_path = GetBaseDirectoryForOriginAndType(origin_url, type, false); - if (base_path.empty() || !file_util::DirectoryExists(base_path)) + if (base_path.empty() || !base::DirectoryExists(base_path)) return 0; base::FilePath usage_file_path = base_path.Append(FileSystemUsageCache::kUsageFileName); diff --git a/webkit/browser/fileapi/sandbox_file_system_backend_unittest.cc b/webkit/browser/fileapi/sandbox_file_system_backend_unittest.cc index 2794df3..373e684 100644 --- a/webkit/browser/fileapi/sandbox_file_system_backend_unittest.cc +++ b/webkit/browser/fileapi/sandbox_file_system_backend_unittest.cc @@ -105,7 +105,7 @@ class SandboxFileSystemBackendTest : public testing::Test { base::FilePath target = backend_-> GetBaseDirectoryForOriginAndType(origin, type, true); ASSERT_TRUE(!target.empty()); - ASSERT_TRUE(file_util::DirectoryExists(target)); + ASSERT_TRUE(base::DirectoryExists(target)); } bool GetRootPath(const GURL& origin_url, @@ -255,7 +255,7 @@ TEST_F(SandboxFileSystemBackendTest, GetRootPathCreateAndExamine) { base::FilePath expected = file_system_path().AppendASCII( kRootPathTestCases[i].expected_path); EXPECT_EQ(expected.value(), root_path.value()); - EXPECT_TRUE(file_util::DirectoryExists(root_path)); + EXPECT_TRUE(base::DirectoryExists(root_path)); ASSERT_TRUE(returned_root_path.size() > i); returned_root_path[i] = root_path; } @@ -353,7 +353,7 @@ TEST_F(SandboxFileSystemBackendTest, GetRootPathFileURIWithAllowFlag) { base::FilePath expected = file_system_path().AppendASCII( kRootPathFileURITestCases[i].expected_path); EXPECT_EQ(expected.value(), root_path.value()); - EXPECT_TRUE(file_util::DirectoryExists(root_path)); + EXPECT_TRUE(base::DirectoryExists(root_path)); } } diff --git a/webkit/browser/fileapi/sandbox_isolated_origin_database_unittest.cc b/webkit/browser/fileapi/sandbox_isolated_origin_database_unittest.cc index f430fa0..7eeab21 100644 --- a/webkit/browser/fileapi/sandbox_isolated_origin_database_unittest.cc +++ b/webkit/browser/fileapi/sandbox_isolated_origin_database_unittest.cc @@ -50,7 +50,7 @@ TEST(SandboxIsolatedOriginDatabaseTest, MigrationTest) { EXPECT_FALSE(base::PathExists(old_db_path)); EXPECT_TRUE(database_old.GetPathForOrigin(kOrigin, &path)); EXPECT_FALSE(path.empty()); - EXPECT_TRUE(file_util::DirectoryExists(old_db_path)); + EXPECT_TRUE(base::DirectoryExists(old_db_path)); // Populate the origin directory with some fake data. base::FilePath directory_db_path = dir.path().Append(path); @@ -74,7 +74,7 @@ TEST(SandboxIsolatedOriginDatabaseTest, MigrationTest) { // so we should see the same fake data. std::string origin_db_data; base::FilePath directory_db_path = dir.path().Append(path); - EXPECT_TRUE(file_util::DirectoryExists(directory_db_path)); + EXPECT_TRUE(base::DirectoryExists(directory_db_path)); EXPECT_TRUE(base::PathExists(directory_db_path.AppendASCII("dummy"))); EXPECT_TRUE(file_util::ReadFileToString( directory_db_path.AppendASCII("dummy"), &origin_db_data)); diff --git a/webkit/browser/fileapi/transient_file_util_unittest.cc b/webkit/browser/fileapi/transient_file_util_unittest.cc index 02a2329..8cd0143 100644 --- a/webkit/browser/fileapi/transient_file_util_unittest.cc +++ b/webkit/browser/fileapi/transient_file_util_unittest.cc @@ -86,7 +86,7 @@ TEST_F(TransientFileUtilTest, TransientFile) { // Make sure the file is there. ASSERT_TRUE(temp_url.is_valid()); ASSERT_TRUE(base::PathExists(temp_path)); - ASSERT_FALSE(file_util::DirectoryExists(temp_path)); + ASSERT_FALSE(base::DirectoryExists(temp_path)); // Create a snapshot file. { diff --git a/webkit/glue/webfileutilities_impl.cc b/webkit/glue/webfileutilities_impl.cc index 1249190..3ad3b3d 100644 --- a/webkit/glue/webfileutilities_impl.cc +++ b/webkit/glue/webfileutilities_impl.cc @@ -74,7 +74,7 @@ bool WebFileUtilitiesImpl::makeAllDirectories(const WebString& path) { } bool WebFileUtilitiesImpl::isDirectory(const WebString& path) { - return file_util::DirectoryExists(base::FilePath::FromUTF16Unsafe(path)); + return base::DirectoryExists(base::FilePath::FromUTF16Unsafe(path)); } WebKit::WebURL WebFileUtilitiesImpl::filePathToURL(const WebString& path) { |