diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-03 20:08:54 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-03 20:08:54 +0000 |
commit | 426d1c945bcb1a8479d92a7dd023c34cbbc7a261 (patch) | |
tree | 8b6d4ad435be865cc5eae1dacfc3e299436fb596 /content | |
parent | 425b55b976d5987b502d2e72e15befedbe2c9662 (diff) | |
download | chromium_src-426d1c945bcb1a8479d92a7dd023c34cbbc7a261.zip chromium_src-426d1c945bcb1a8479d92a7dd023c34cbbc7a261.tar.gz chromium_src-426d1c945bcb1a8479d92a7dd023c34cbbc7a261.tar.bz2 |
Move directory creation functions to base namespace.
BUG=
Review URL: https://codereview.chromium.org/100573002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@238446 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
19 files changed, 27 insertions, 27 deletions
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( |