diff options
Diffstat (limited to 'chrome/browser')
50 files changed, 80 insertions, 88 deletions
diff --git a/chrome/browser/chromeos/drive/download_handler.cc b/chrome/browser/chromeos/drive/download_handler.cc index 1e84ac2..50599c3 100644 --- a/chrome/browser/chromeos/drive/download_handler.cc +++ b/chrome/browser/chromeos/drive/download_handler.cc @@ -60,8 +60,8 @@ base::FilePath GetDriveTempDownloadPath( DCHECK(created) << "Can not create temp download directory at " << drive_tmp_download_dir.value(); base::FilePath drive_tmp_download_path; - created = file_util::CreateTemporaryFileInDir(drive_tmp_download_dir, - &drive_tmp_download_path); + created = base::CreateTemporaryFileInDir(drive_tmp_download_dir, + &drive_tmp_download_path); DCHECK(created) << "Temporary download file creation failed"; return drive_tmp_download_path; } diff --git a/chrome/browser/chromeos/drive/file_cache_unittest.cc b/chrome/browser/chromeos/drive/file_cache_unittest.cc index d604f0d..dd16cf4 100644 --- a/chrome/browser/chromeos/drive/file_cache_unittest.cc +++ b/chrome/browser/chromeos/drive/file_cache_unittest.cc @@ -58,8 +58,8 @@ class FileCacheTestOnUIThread : public testing::Test { ASSERT_TRUE(file_util::CreateDirectory(metadata_dir)); ASSERT_TRUE(file_util::CreateDirectory(cache_dir)); - ASSERT_TRUE(file_util::CreateTemporaryFileInDir(temp_dir_.path(), - &dummy_file_path_)); + ASSERT_TRUE(base::CreateTemporaryFileInDir(temp_dir_.path(), + &dummy_file_path_)); fake_free_disk_space_getter_.reset(new FakeFreeDiskSpaceGetter); scoped_refptr<base::SequencedWorkerPool> pool = @@ -803,7 +803,7 @@ TEST_F(FileCacheTest, RecoverFilesFromCacheDirectory) { TEST_F(FileCacheTest, Iterator) { base::FilePath src_file; - ASSERT_TRUE(file_util::CreateTemporaryFileInDir(temp_dir_.path(), &src_file)); + ASSERT_TRUE(base::CreateTemporaryFileInDir(temp_dir_.path(), &src_file)); // Prepare entries. std::map<std::string, std::string> md5s; @@ -828,7 +828,7 @@ TEST_F(FileCacheTest, Iterator) { TEST_F(FileCacheTest, FreeDiskSpaceIfNeededFor) { base::FilePath src_file; - ASSERT_TRUE(file_util::CreateTemporaryFileInDir(temp_dir_.path(), &src_file)); + ASSERT_TRUE(base::CreateTemporaryFileInDir(temp_dir_.path(), &src_file)); // Store a file as a 'temporary' file and remember the path. const std::string id_tmp = "id_tmp", md5_tmp = "md5_tmp"; @@ -959,7 +959,7 @@ TEST_F(FileCacheTest, ClearAll) { // Store an existing file. base::FilePath src_file; - ASSERT_TRUE(file_util::CreateTemporaryFileInDir(temp_dir_.path(), &src_file)); + ASSERT_TRUE(base::CreateTemporaryFileInDir(temp_dir_.path(), &src_file)); ASSERT_EQ(FILE_ERROR_OK, cache_->Store(id, md5, src_file, FileCache::FILE_OPERATION_COPY)); diff --git a/chrome/browser/chromeos/drive/file_system/create_file_operation.cc b/chrome/browser/chromeos/drive/file_system/create_file_operation.cc index 67cc830..cb4c8dc 100644 --- a/chrome/browser/chromeos/drive/file_system/create_file_operation.cc +++ b/chrome/browser/chromeos/drive/file_system/create_file_operation.cc @@ -114,7 +114,7 @@ FileError UpdateLocalStateForCreateFile( // Here, failure is not a fatal error, so ignore the returned code. FileError cache_store_error = FILE_ERROR_FAILED; base::FilePath empty_file; - if (file_util::CreateTemporaryFile(&empty_file)) { + if (base::CreateTemporaryFile(&empty_file)) { cache_store_error = cache->Store( local_id, entry.file_specific_info().md5(), diff --git a/chrome/browser/chromeos/drive/file_system/download_operation.cc b/chrome/browser/chromeos/drive/file_system/download_operation.cc index cc00daa..2e1aa51 100644 --- a/chrome/browser/chromeos/drive/file_system/download_operation.cc +++ b/chrome/browser/chromeos/drive/file_system/download_operation.cc @@ -62,8 +62,8 @@ FileError CheckPreConditionForEnsureFileDownloaded( if (entry->file_specific_info().is_hosted_document()) { base::FilePath gdoc_file_path; base::PlatformFileInfo file_info; - if (!file_util::CreateTemporaryFileInDir(temporary_file_directory, - &gdoc_file_path) || + if (!base::CreateTemporaryFileInDir(temporary_file_directory, + &gdoc_file_path) || !util::CreateGDocFile(gdoc_file_path, GURL(entry->file_specific_info().alternate_url()), entry->resource_id()) || @@ -146,7 +146,7 @@ FileError CheckPreConditionForEnsureFileDownloadedByPath( // processes (e.g., cros_disks for mounting zip files). bool CreateTemporaryReadableFileInDir(const base::FilePath& dir, base::FilePath* temp_file) { - if (!file_util::CreateTemporaryFileInDir(dir, temp_file)) + if (!base::CreateTemporaryFileInDir(dir, temp_file)) return false; return base::SetPosixFilePermissions( *temp_file, diff --git a/chrome/browser/chromeos/drive/file_system/download_operation_unittest.cc b/chrome/browser/chromeos/drive/file_system/download_operation_unittest.cc index 0eedc78..726885c 100644 --- a/chrome/browser/chromeos/drive/file_system/download_operation_unittest.cc +++ b/chrome/browser/chromeos/drive/file_system/download_operation_unittest.cc @@ -197,7 +197,7 @@ TEST_F(DownloadOperationTest, TEST_F(DownloadOperationTest, EnsureFileDownloadedByPath_FromCache) { base::FilePath temp_file; - ASSERT_TRUE(file_util::CreateTemporaryFileInDir(temp_dir(), &temp_file)); + ASSERT_TRUE(base::CreateTemporaryFileInDir(temp_dir(), &temp_file)); base::FilePath file_in_root(FILE_PATH_LITERAL("drive/root/File 1.txt")); ResourceEntry src_entry; @@ -364,7 +364,7 @@ TEST_F(DownloadOperationTest, TEST_F(DownloadOperationTest, EnsureFileDownloadedByLocalId_FromCache) { base::FilePath temp_file; - ASSERT_TRUE(file_util::CreateTemporaryFileInDir(temp_dir(), &temp_file)); + ASSERT_TRUE(base::CreateTemporaryFileInDir(temp_dir(), &temp_file)); base::FilePath file_in_root(FILE_PATH_LITERAL("drive/root/File 1.txt")); ResourceEntry src_entry; diff --git a/chrome/browser/chromeos/drive/fileapi_worker_unittest.cc b/chrome/browser/chromeos/drive/fileapi_worker_unittest.cc index 096c7bb..dbe9b48 100644 --- a/chrome/browser/chromeos/drive/fileapi_worker_unittest.cc +++ b/chrome/browser/chromeos/drive/fileapi_worker_unittest.cc @@ -170,7 +170,7 @@ TEST_F(FileApiWorkerTest, OpenFileForCreateWrite) { const std::string kWriteData = "byebye"; base::FilePath temp_path; - file_util::CreateTemporaryFile(&temp_path); + base::CreateTemporaryFile(&temp_path); // CREATE => CREATE (fails if file existed.) TestFileSystemForOpenFile file_system(temp_path, CREATE_FILE); @@ -190,7 +190,7 @@ TEST_F(FileApiWorkerTest, OpenFileForOpenAlwaysWrite) { const std::string kInitialData = "hello"; base::FilePath temp_path; - file_util::CreateTemporaryFile(&temp_path); + base::CreateTemporaryFile(&temp_path); google_apis::test_util::WriteStringToFile(temp_path, kInitialData); // OPEN_ALWAYS => OPEN_OR_CREATE (success whether file exists or not.) @@ -212,7 +212,7 @@ TEST_F(FileApiWorkerTest, OpenFileForOpenTruncatedWrite) { const std::string kWriteData = "byebye"; base::FilePath temp_path; - file_util::CreateTemporaryFile(&temp_path); + base::CreateTemporaryFile(&temp_path); google_apis::test_util::WriteStringToFile(temp_path, kInitialData); // OPEN_TRUNCATED => OPEN (failure when the file did not exist.) @@ -234,7 +234,7 @@ TEST_F(FileApiWorkerTest, OpenFileForOpenCreateAlwaysWrite) { const std::string kWriteData = "byebye"; base::FilePath temp_path; - file_util::CreateTemporaryFile(&temp_path); + base::CreateTemporaryFile(&temp_path); google_apis::test_util::WriteStringToFile(temp_path, kInitialData); // CREATE_ALWAYS => OPEN_OR_CREATE (success whether file exists or not.) @@ -255,7 +255,7 @@ TEST_F(FileApiWorkerTest, OpenFileForOpenRead) { const std::string kInitialData = "hello"; base::FilePath temp_path; - file_util::CreateTemporaryFile(&temp_path); + base::CreateTemporaryFile(&temp_path); google_apis::test_util::WriteStringToFile(temp_path, kInitialData); // OPEN => OPEN (failure when the file did not exist.) diff --git a/chrome/browser/chromeos/drive/remove_stale_cache_files_unittest.cc b/chrome/browser/chromeos/drive/remove_stale_cache_files_unittest.cc index 5e0252b..a832f09 100644 --- a/chrome/browser/chromeos/drive/remove_stale_cache_files_unittest.cc +++ b/chrome/browser/chromeos/drive/remove_stale_cache_files_unittest.cc @@ -58,8 +58,7 @@ class RemoveStaleCacheFilesTest : public testing::Test { TEST_F(RemoveStaleCacheFilesTest, RemoveStaleCacheFiles) { base::FilePath dummy_file; - ASSERT_TRUE(file_util::CreateTemporaryFileInDir(temp_dir_.path(), - &dummy_file)); + ASSERT_TRUE(base::CreateTemporaryFileInDir(temp_dir_.path(), &dummy_file)); std::string local_id("pdf:1a2b3c"); std::string md5("abcdef0123456789"); @@ -85,8 +84,7 @@ TEST_F(RemoveStaleCacheFilesTest, RemoveStaleCacheFiles) { TEST_F(RemoveStaleCacheFilesTest, DirtyCacheFiles) { base::FilePath dummy_file; - ASSERT_TRUE(file_util::CreateTemporaryFileInDir(temp_dir_.path(), - &dummy_file)); + ASSERT_TRUE(base::CreateTemporaryFileInDir(temp_dir_.path(), &dummy_file)); // Dirty and deleted (= absent in resource_metada) cache entry. std::string local_id_1("file:1"); diff --git a/chrome/browser/chromeos/drive/resource_metadata_storage_unittest.cc b/chrome/browser/chromeos/drive/resource_metadata_storage_unittest.cc index 0094c31..be97a90 100644 --- a/chrome/browser/chromeos/drive/resource_metadata_storage_unittest.cc +++ b/chrome/browser/chromeos/drive/resource_metadata_storage_unittest.cc @@ -432,7 +432,7 @@ TEST_F(ResourceMetadataStorageTest, IncompatibleDB_Unknown) { TEST_F(ResourceMetadataStorageTest, WrongPath) { // Create a file. base::FilePath path; - ASSERT_TRUE(file_util::CreateTemporaryFileInDir(temp_dir_.path(), &path)); + ASSERT_TRUE(base::CreateTemporaryFileInDir(temp_dir_.path(), &path)); storage_.reset(new ResourceMetadataStorage( path, base::MessageLoopProxy::current().get())); diff --git a/chrome/browser/chromeos/drive/search_metadata_unittest.cc b/chrome/browser/chromeos/drive/search_metadata_unittest.cc index fb928de..f5f7502 100644 --- a/chrome/browser/chromeos/drive/search_metadata_unittest.cc +++ b/chrome/browser/chromeos/drive/search_metadata_unittest.cc @@ -63,8 +63,7 @@ class SearchMetadataTest : public testing::Test { void AddEntriesToMetadata() { base::FilePath temp_file; - EXPECT_TRUE(file_util::CreateTemporaryFileInDir(temp_dir_.path(), - &temp_file)); + EXPECT_TRUE(base::CreateTemporaryFileInDir(temp_dir_.path(), &temp_file)); const std::string temp_file_md5 = "md5"; ResourceEntry entry; diff --git a/chrome/browser/chromeos/drive/sync_client_unittest.cc b/chrome/browser/chromeos/drive/sync_client_unittest.cc index c58373f..f190d25 100644 --- a/chrome/browser/chromeos/drive/sync_client_unittest.cc +++ b/chrome/browser/chromeos/drive/sync_client_unittest.cc @@ -152,8 +152,7 @@ class SyncClientTest : public testing::Test { void SetUpTestData() { // Prepare a temp file. base::FilePath temp_file; - EXPECT_TRUE(file_util::CreateTemporaryFileInDir(temp_dir_.path(), - &temp_file)); + EXPECT_TRUE(base::CreateTemporaryFileInDir(temp_dir_.path(), &temp_file)); ASSERT_TRUE(google_apis::test_util::WriteStringToFile(temp_file, kLocalContent)); diff --git a/chrome/browser/chromeos/file_manager/file_watcher_unittest.cc b/chrome/browser/chromeos/file_manager/file_watcher_unittest.cc index 773fd21..747ef5e 100644 --- a/chrome/browser/chromeos/file_manager/file_watcher_unittest.cc +++ b/chrome/browser/chromeos/file_manager/file_watcher_unittest.cc @@ -138,8 +138,7 @@ TEST_F(FileManagerFileWatcherTest, WatchLocalFile) { // Create a temporary file in the temporary directory. The file watcher // should detect the change in the directory. base::FilePath temp_file_path; - ASSERT_TRUE(file_util::CreateTemporaryFileInDir(temp_dir.path(), - &temp_file_path)); + ASSERT_TRUE(base::CreateTemporaryFileInDir(temp_dir.path(), &temp_file_path)); // Wait until the directory change is notified. run_loop.Run(); ASSERT_FALSE(on_change_error); diff --git a/chrome/browser/chromeos/login/parallel_authenticator_unittest.cc b/chrome/browser/chromeos/login/parallel_authenticator_unittest.cc index 2bcf243..831c626 100644 --- a/chrome/browser/chromeos/login/parallel_authenticator_unittest.cc +++ b/chrome/browser/chromeos/login/parallel_authenticator_unittest.cc @@ -95,7 +95,7 @@ class ParallelAuthenticatorTest : public testing::Test { base::FilePath PopulateTempFile(const char* data, int data_len) { base::FilePath out; - FILE* tmp_file = file_util::CreateAndOpenTemporaryFile(&out); + FILE* tmp_file = base::CreateAndOpenTemporaryFile(&out); EXPECT_NE(tmp_file, static_cast<FILE*>(NULL)); EXPECT_EQ(file_util::WriteFile(out, data, data_len), data_len); EXPECT_TRUE(file_util::CloseFile(tmp_file)); diff --git a/chrome/browser/chromeos/login/resource_loader_browsertest.cc b/chrome/browser/chromeos/login/resource_loader_browsertest.cc index fe106b8..2b91a32 100644 --- a/chrome/browser/chromeos/login/resource_loader_browsertest.cc +++ b/chrome/browser/chromeos/login/resource_loader_browsertest.cc @@ -22,7 +22,7 @@ namespace { GURL CreateResource(const std::string& content) { base::FilePath path; - EXPECT_TRUE(file_util::CreateTemporaryFile(&path)); + EXPECT_TRUE(base::CreateTemporaryFile(&path)); EXPECT_TRUE(file_util::WriteFile(path, content.c_str(), content.size())); return GURL("file:///" + path.AsUTF8Unsafe()); } diff --git a/chrome/browser/chromeos/system/syslogs_provider.cc b/chrome/browser/chromeos/system/syslogs_provider.cc index 5a1c00e..5cbba5d 100644 --- a/chrome/browser/chromeos/system/syslogs_provider.cc +++ b/chrome/browser/chromeos/system/syslogs_provider.cc @@ -122,7 +122,7 @@ LogDictionaryType* GetSystemLogs(base::FilePath* zip_file_name, // Create the temp file, logs will go here base::FilePath temp_filename; - if (!file_util::CreateTemporaryFile(&temp_filename)) + if (!base::CreateTemporaryFile(&temp_filename)) return NULL; std::string cmd = std::string(kSysLogsScript) + " " + context + " >> " + @@ -305,7 +305,7 @@ void SyslogsProviderImpl::ReadSyslogs( // Create temp file. base::FilePath zip_file; - if (compress_logs && !file_util::CreateTemporaryFile(&zip_file)) { + if (compress_logs && !base::CreateTemporaryFile(&zip_file)) { LOG(ERROR) << "Cannot create temp file"; compress_logs = false; } diff --git a/chrome/browser/component_updater/component_unpacker.cc b/chrome/browser/component_updater/component_unpacker.cc index 5541a9b..789049a 100644 --- a/chrome/browser/component_updater/component_unpacker.cc +++ b/chrome/browser/component_updater/component_unpacker.cc @@ -146,8 +146,8 @@ ComponentUnpacker::ComponentUnpacker(const std::vector<uint8>& pk_hash, error_ = kInvalidId; return; } - if (!file_util::CreateNewTempDirectory(FILE_PATH_LITERAL(""), - &unpack_path_)) { + if (!base::CreateNewTempDirectory(base::FilePath::StringType(), + &unpack_path_)) { error_ = kUnzipPathError; return; } @@ -155,8 +155,8 @@ ComponentUnpacker::ComponentUnpacker(const std::vector<uint8>& pk_hash, // We want a different temp directory for the delta files; we'll put the // patch output into unpack_path_. base::FilePath unpack_diff_path; - if (!file_util::CreateNewTempDirectory(FILE_PATH_LITERAL(""), - &unpack_diff_path)) { + if (!base::CreateNewTempDirectory(base::FilePath::StringType(), + &unpack_diff_path)) { error_ = kUnzipPathError; return; } diff --git a/chrome/browser/component_updater/test/test_installer.cc b/chrome/browser/component_updater/test/test_installer.cc index 28ff22d..f379b6f 100644 --- a/chrome/browser/component_updater/test/test_installer.cc +++ b/chrome/browser/component_updater/test/test_installer.cc @@ -47,8 +47,7 @@ bool ReadOnlyTestInstaller::GetInstalledFile(const std::string& file, VersionedTestInstaller::VersionedTestInstaller() { - file_util::CreateNewTempDirectory(FILE_PATH_LITERAL("TEST_"), - &install_directory_); + base::CreateNewTempDirectory(FILE_PATH_LITERAL("TEST_"), &install_directory_); } VersionedTestInstaller::~VersionedTestInstaller() { diff --git a/chrome/browser/extensions/api/downloads/downloads_api_browsertest.cc b/chrome/browser/extensions/api/downloads/downloads_api_browsertest.cc index b821226..156d445 100644 --- a/chrome/browser/extensions/api/downloads/downloads_api_browsertest.cc +++ b/chrome/browser/extensions/api/downloads/downloads_api_browsertest.cc @@ -707,7 +707,7 @@ class HTML5FileWriter { int length) { // Create a temp file. base::FilePath temp_file; - if (!file_util::CreateTemporaryFile(&temp_file) || + if (!base::CreateTemporaryFile(&temp_file) || file_util::WriteFile(temp_file, data, length) != length) { return false; } diff --git a/chrome/browser/extensions/api/image_writer_private/operation.cc b/chrome/browser/extensions/api/image_writer_private/operation.cc index dcd147f..1f1f303 100644 --- a/chrome/browser/extensions/api/image_writer_private/operation.cc +++ b/chrome/browser/extensions/api/image_writer_private/operation.cc @@ -179,9 +179,9 @@ void Operation::UnzipStart(scoped_ptr<base::FilePath> zip_file) { SetStage(image_writer_api::STAGE_UNZIP); base::FilePath tmp_dir; - if (!file_util::CreateTemporaryDirInDir(zip_file->DirName(), - FILE_PATH_LITERAL("image_writer"), - &tmp_dir)) { + if (!base::CreateTemporaryDirInDir(zip_file->DirName(), + FILE_PATH_LITERAL("image_writer"), + &tmp_dir)) { Error(error::kTempDir); return; } diff --git a/chrome/browser/extensions/api/image_writer_private/write_from_url_operation.cc b/chrome/browser/extensions/api/image_writer_private/write_from_url_operation.cc index dec61bf..9a6b8d4 100644 --- a/chrome/browser/extensions/api/image_writer_private/write_from_url_operation.cc +++ b/chrome/browser/extensions/api/image_writer_private/write_from_url_operation.cc @@ -67,7 +67,7 @@ void WriteFromUrlOperation::CreateTempFile() { tmp_file_.reset(new base::FilePath()); - if (file_util::CreateTemporaryFile(tmp_file_.get())) { + if (base::CreateTemporaryFile(tmp_file_.get())) { BrowserThread::PostTask( BrowserThread::UI, FROM_HERE, diff --git a/chrome/browser/extensions/api/messaging/native_message_process_host_unittest.cc b/chrome/browser/extensions/api/messaging/native_message_process_host_unittest.cc index 749a790..b3b09f5 100644 --- a/chrome/browser/extensions/api/messaging/native_message_process_host_unittest.cc +++ b/chrome/browser/extensions/api/messaging/native_message_process_host_unittest.cc @@ -156,7 +156,7 @@ class NativeMessagingTest : public ::testing::Test, base::FilePath CreateTempFileWithMessage(const std::string& message) { base::FilePath filename = temp_dir_.path().AppendASCII("input"); - file_util::CreateTemporaryFile(&filename); + base::CreateTemporaryFile(&filename); std::string message_with_header = FormatMessage(message); EXPECT_TRUE(file_util::WriteFile( filename, message_with_header.data(), message_with_header.size())); diff --git a/chrome/browser/extensions/api/page_capture/page_capture_api.cc b/chrome/browser/extensions/api/page_capture/page_capture_api.cc index d520c4f..1dd31b7 100644 --- a/chrome/browser/extensions/api/page_capture/page_capture_api.cc +++ b/chrome/browser/extensions/api/page_capture/page_capture_api.cc @@ -90,7 +90,7 @@ bool PageCaptureSaveAsMHTMLFunction::OnMessageReceivedFromRenderView( void PageCaptureSaveAsMHTMLFunction::CreateTemporaryFile() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); - bool success = file_util::CreateTemporaryFile(&mhtml_path_); + bool success = base::CreateTemporaryFile(&mhtml_path_); BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, base::Bind(&PageCaptureSaveAsMHTMLFunction::TemporaryFileCreated, this, diff --git a/chrome/browser/extensions/extension_creator_filter_unittest.cc b/chrome/browser/extensions/extension_creator_filter_unittest.cc index 61a1f66..bcb8117 100644 --- a/chrome/browser/extensions/extension_creator_filter_unittest.cc +++ b/chrome/browser/extensions/extension_creator_filter_unittest.cc @@ -25,7 +25,7 @@ class ExtensionCreatorFilterTest : public PlatformTest { base::FilePath CreateEmptyTestFile(const base::FilePath& file_path) { base::FilePath test_file(test_dir_.Append(file_path)); base::FilePath temp_file; - EXPECT_TRUE(file_util::CreateTemporaryFileInDir(test_dir_, &temp_file)); + EXPECT_TRUE(base::CreateTemporaryFileInDir(test_dir_, &temp_file)); EXPECT_TRUE(base::Move(temp_file, test_file)); return test_file; } @@ -37,7 +37,7 @@ class ExtensionCreatorFilterTest : public PlatformTest { base::FilePath test_file(temp_sub_dir.Append(file_name)); EXPECT_TRUE(file_util::CreateDirectory(temp_sub_dir)); base::FilePath temp_file; - EXPECT_TRUE(file_util::CreateTemporaryFileInDir(temp_sub_dir, &temp_file)); + EXPECT_TRUE(base::CreateTemporaryFileInDir(temp_sub_dir, &temp_file)); EXPECT_TRUE(base::Move(temp_file, test_file)); return test_file; } diff --git a/chrome/browser/extensions/extension_service_unittest.cc b/chrome/browser/extensions/extension_service_unittest.cc index ab3404b..73252df 100644 --- a/chrome/browser/extensions/extension_service_unittest.cc +++ b/chrome/browser/extensions/extension_service_unittest.cc @@ -218,7 +218,7 @@ static void AddPattern(URLPatternSet* extent, const std::string& pattern) { #if !(defined(OS_LINUX) && defined(USE_AURA) && !defined(OS_CHROMEOS)) base::FilePath GetTemporaryFile() { base::FilePath temp_file; - CHECK(file_util::CreateTemporaryFile(&temp_file)); + CHECK(base::CreateTemporaryFile(&temp_file)); return temp_file; } diff --git a/chrome/browser/extensions/sandboxed_unpacker.cc b/chrome/browser/extensions/sandboxed_unpacker.cc index 6dd89c9..8fd15ef 100644 --- a/chrome/browser/extensions/sandboxed_unpacker.cc +++ b/chrome/browser/extensions/sandboxed_unpacker.cc @@ -124,7 +124,7 @@ bool VerifyJunctionFreeLocation(base::FilePath* temp_dir) { return false; base::FilePath temp_file; - if (!file_util::CreateTemporaryFileInDir(*temp_dir, &temp_file)) { + if (!base::CreateTemporaryFileInDir(*temp_dir, &temp_file)) { LOG(ERROR) << temp_dir->value() << " is not writable"; return false; } diff --git a/chrome/browser/feedback/feedback_util.cc b/chrome/browser/feedback/feedback_util.cc index ace8c39..f738e32 100644 --- a/chrome/browser/feedback/feedback_util.cc +++ b/chrome/browser/feedback/feedback_util.cc @@ -378,12 +378,12 @@ bool ZipString(const base::FilePath& filename, // Create a temporary directory, put the logs into a file in it. Create // another temporary file to receive the zip file in. - if (!file_util::CreateNewTempDirectory(FILE_PATH_LITERAL(""), &temp_path)) + if (!base::CreateNewTempDirectory(base::FilePath::StringType(), &temp_path)) return false; if (file_util::WriteFile(temp_path.Append(filename), data.c_str(), data.size()) == -1) return false; - if (!file_util::CreateTemporaryFile(&zip_file)) + if (!base::CreateTemporaryFile(&zip_file)) return false; if (!zip::Zip(temp_path, zip_file, false)) diff --git a/chrome/browser/first_run/first_run_browsertest.cc b/chrome/browser/first_run/first_run_browsertest.cc index a642bf2..89481c2 100644 --- a/chrome/browser/first_run/first_run_browsertest.cc +++ b/chrome/browser/first_run/first_run_browsertest.cc @@ -83,7 +83,7 @@ class FirstRunMasterPrefsBrowserTestBase : public InProcessBrowserTest { // before this class' SetUp() is invoked. ASSERT_TRUE(text_.get()); - ASSERT_TRUE(file_util::CreateTemporaryFile(&prefs_file_)); + ASSERT_TRUE(base::CreateTemporaryFile(&prefs_file_)); EXPECT_TRUE(file_util::WriteFile(prefs_file_, text_->c_str(), text_->size())); first_run::SetMasterPrefsPathForTesting(prefs_file_); diff --git a/chrome/browser/first_run/first_run_internal_win.cc b/chrome/browser/first_run/first_run_internal_win.cc index e87ba72..b63e30f 100644 --- a/chrome/browser/first_run/first_run_internal_win.cc +++ b/chrome/browser/first_run/first_run_internal_win.cc @@ -125,7 +125,7 @@ bool IsEULANotAccepted(installer::MasterPreferences* install_prefs) { bool WriteEULAtoTempFile(base::FilePath* eula_path) { std::string terms = l10n_util::GetStringUTF8(IDS_TERMS_HTML); return (!terms.empty() && - file_util::CreateTemporaryFile(eula_path) && + base::CreateTemporaryFile(eula_path) && file_util::WriteFile(*eula_path, terms.data(), terms.size()) != -1); } diff --git a/chrome/browser/history/history_backend_unittest.cc b/chrome/browser/history/history_backend_unittest.cc index 8beca3e..6a65542 100644 --- a/chrome/browser/history/history_backend_unittest.cc +++ b/chrome/browser/history/history_backend_unittest.cc @@ -362,8 +362,8 @@ class HistoryBackendTest : public testing::Test { protected: // testing::Test virtual void SetUp() { - if (!file_util::CreateNewTempDirectory(FILE_PATH_LITERAL("BackendTest"), - &test_dir_)) + if (!base::CreateNewTempDirectory(FILE_PATH_LITERAL("BackendTest"), + &test_dir_)) return; backend_ = new HistoryBackend(test_dir_, 0, diff --git a/chrome/browser/history/redirect_browsertest.cc b/chrome/browser/history/redirect_browsertest.cc index a4c2dab..885f999 100644 --- a/chrome/browser/history/redirect_browsertest.cc +++ b/chrome/browser/history/redirect_browsertest.cc @@ -134,8 +134,8 @@ IN_PROC_BROWSER_TEST_F(RedirectTest, ClientEmptyReferer) { base::ScopedTempDir temp_directory; ASSERT_TRUE(temp_directory.CreateUniqueTempDir()); base::FilePath temp_file; - ASSERT_TRUE(file_util::CreateTemporaryFileInDir(temp_directory.path(), - &temp_file)); + ASSERT_TRUE(base::CreateTemporaryFileInDir(temp_directory.path(), + &temp_file)); ASSERT_EQ(static_cast<int>(file_redirect_contents.size()), file_util::WriteFile(temp_file, file_redirect_contents.data(), diff --git a/chrome/browser/jumplist_win.cc b/chrome/browser/jumplist_win.cc index 9dad7a6..a4991ce 100644 --- a/chrome/browser/jumplist_win.cc +++ b/chrome/browser/jumplist_win.cc @@ -233,7 +233,7 @@ bool CreateIconFile(const SkBitmap& bitmap, // We don't have to care about the extension of this temporary file because // JumpList does not care about it. base::FilePath path; - if (!file_util::CreateTemporaryFileInDir(icon_dir, &path)) + if (!base::CreateTemporaryFileInDir(icon_dir, &path)) return false; // Create an icon file from the favicon attached to the given |page|, and diff --git a/chrome/browser/media/chrome_webrtc_audio_quality_browsertest.cc b/chrome/browser/media/chrome_webrtc_audio_quality_browsertest.cc index 25ee2fa..93af7fb 100644 --- a/chrome/browser/media/chrome_webrtc_audio_quality_browsertest.cc +++ b/chrome/browser/media/chrome_webrtc_audio_quality_browsertest.cc @@ -156,7 +156,7 @@ class WebrtcAudioQualityBrowserTest : public WebRtcTestBase { base::FilePath CreateTemporaryWaveFile() { base::FilePath filename; - EXPECT_TRUE(file_util::CreateTemporaryFile(&filename)); + EXPECT_TRUE(base::CreateTemporaryFile(&filename)); base::FilePath wav_filename = filename.AddExtension(FILE_PATH_LITERAL(".wav")); EXPECT_TRUE(base::Move(filename, wav_filename)); diff --git a/chrome/browser/media/chrome_webrtc_browsertest.cc b/chrome/browser/media/chrome_webrtc_browsertest.cc index 294fa09..8c5a2ba 100644 --- a/chrome/browser/media/chrome_webrtc_browsertest.cc +++ b/chrome/browser/media/chrome_webrtc_browsertest.cc @@ -227,7 +227,7 @@ IN_PROC_BROWSER_TEST_F(MAYBE_WebrtcBrowserTest, MANUAL_CpuUsage15Seconds) { ASSERT_TRUE(peerconnection_server_.Start()); base::FilePath results_file; - ASSERT_TRUE(file_util::CreateTemporaryFile(&results_file)); + ASSERT_TRUE(base::CreateTemporaryFile(&results_file)); content::WebContents* left_tab = OpenTestPageAndGetUserMediaInNewTab(); diff --git a/chrome/browser/media/webrtc_log_uploader_unittest.cc b/chrome/browser/media/webrtc_log_uploader_unittest.cc index e2fb25a..3e13f45 100644 --- a/chrome/browser/media/webrtc_log_uploader_unittest.cc +++ b/chrome/browser/media/webrtc_log_uploader_unittest.cc @@ -88,7 +88,7 @@ class WebRtcLogUploaderTest : public testing::Test { TEST_F(WebRtcLogUploaderTest, AddUploadedLogInfoToUploadListFile) { // Get a temporary filename. We don't want the file to exist to begin with // since that's the normal use case, hence the delete. - ASSERT_TRUE(file_util::CreateTemporaryFile(&test_list_path_)); + ASSERT_TRUE(base::CreateTemporaryFile(&test_list_path_)); EXPECT_TRUE(base::DeleteFile(test_list_path_, false)); scoped_ptr<WebRtcLogUploader> webrtc_log_uploader_( new WebRtcLogUploader()); 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 63a553c..5087660 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 @@ -46,8 +46,8 @@ void CreateSnapshotFileOnBlockingPool( base::FilePath isolated_media_file_system_dir_path = profile_path.AppendASCII(kDeviceMediaAsyncFileUtilTempDir); if (!file_util::CreateDirectory(isolated_media_file_system_dir_path) || - !file_util::CreateTemporaryFileInDir(isolated_media_file_system_dir_path, - snapshot_file_path)) { + !base::CreateTemporaryFileInDir(isolated_media_file_system_dir_path, + snapshot_file_path)) { LOG(WARNING) << "Could not create media snapshot file " << isolated_media_file_system_dir_path.value(); *snapshot_file_path = base::FilePath(); diff --git a/chrome/browser/nacl_host/test/nacl_gdb_browsertest.cc b/chrome/browser/nacl_host/test/nacl_gdb_browsertest.cc index 01cbb83..a134e06 100644 --- a/chrome/browser/nacl_host/test/nacl_gdb_browsertest.cc +++ b/chrome/browser/nacl_host/test/nacl_gdb_browsertest.cc @@ -30,7 +30,7 @@ class NaClGdbTest : public PPAPINaClNewlibTest { EXPECT_TRUE(PathService::Get(base::DIR_EXE, &mock_nacl_gdb)); mock_nacl_gdb = mock_nacl_gdb.Append(kMockNaClGdb); command_line->AppendSwitchPath(switches::kNaClGdb, mock_nacl_gdb); - EXPECT_TRUE(file_util::CreateTemporaryFile(&script_)); + EXPECT_TRUE(base::CreateTemporaryFile(&script_)); command_line->AppendSwitchPath(switches::kNaClGdbScript, script_); } @@ -50,7 +50,7 @@ class NaClGdbTest : public PPAPINaClNewlibTest { return; } #endif - EXPECT_TRUE(file_util::CreateTemporaryFile(&mock_nacl_gdb_file)); + EXPECT_TRUE(base::CreateTemporaryFile(&mock_nacl_gdb_file)); env->SetVar("MOCK_NACL_GDB", mock_nacl_gdb_file.AsUTF8Unsafe()); RunTestViaHTTP(test_name); env->UnSetVar("MOCK_NACL_GDB"); diff --git a/chrome/browser/net/net_log_temp_file_unittest.cc b/chrome/browser/net/net_log_temp_file_unittest.cc index f30254f..6c414e82 100644 --- a/chrome/browser/net/net_log_temp_file_unittest.cc +++ b/chrome/browser/net/net_log_temp_file_unittest.cc @@ -65,8 +65,7 @@ class NetLogTempFileTest : public ::testing::Test { // Get a temporary file name for unit tests. base::FilePath net_log_dir; ASSERT_TRUE(net_log_temp_file_->GetNetExportLogDirectory(&net_log_dir)); - ASSERT_TRUE(file_util::CreateTemporaryFileInDir(net_log_dir, - &net_export_log_)); + ASSERT_TRUE(base::CreateTemporaryFileInDir(net_log_dir, &net_export_log_)); net_log_temp_file_->log_filename_ = net_export_log_.BaseName().value(); diff --git a/chrome/browser/printing/print_dialog_gtk.cc b/chrome/browser/printing/print_dialog_gtk.cc index 7c13b1a..54a69cc 100644 --- a/chrome/browser/printing/print_dialog_gtk.cc +++ b/chrome/browser/printing/print_dialog_gtk.cc @@ -274,7 +274,7 @@ void PrintDialogGtk::PrintDocument(const printing::Metafile* metafile, AddRef(); bool error = false; - if (!file_util::CreateTemporaryFile(&path_to_pdf_)) { + if (!base::CreateTemporaryFile(&path_to_pdf_)) { LOG(ERROR) << "Creating temporary file failed"; error = true; } diff --git a/chrome/browser/printing/printing_message_filter.cc b/chrome/browser/printing/printing_message_filter.cc index 262ed79..70107eb 100644 --- a/chrome/browser/printing/printing_message_filter.cc +++ b/chrome/browser/printing/printing_message_filter.cc @@ -168,7 +168,7 @@ void PrintingMessageFilter::OnAllocateTempFileForPrinting( *sequence_number = g_printing_file_descriptor_map.Get().sequence++; base::FilePath path; - if (file_util::CreateTemporaryFile(&path)) { + if (base::CreateTemporaryFile(&path)) { int fd = open(path.value().c_str(), O_WRONLY); if (fd >= 0) { SequenceToPathMap::iterator it = map->find(*sequence_number); diff --git a/chrome/browser/shell_integration_win_unittest.cc b/chrome/browser/shell_integration_win_unittest.cc index fa91c1c..2f0081d 100644 --- a/chrome/browser/shell_integration_win_unittest.cc +++ b/chrome/browser/shell_integration_win_unittest.cc @@ -36,10 +36,10 @@ class ShellIntegrationWinMigrateShortcutTest : public testing::Test { ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); // A path to a random target. - file_util::CreateTemporaryFileInDir(temp_dir_.path(), &other_target_); + base::CreateTemporaryFileInDir(temp_dir_.path(), &other_target_); // This doesn't need to actually have a base name of "chrome.exe". - file_util::CreateTemporaryFileInDir(temp_dir_.path(), &chrome_exe_); + base::CreateTemporaryFileInDir(temp_dir_.path(), &chrome_exe_); chrome_app_id_ = ShellUtil::GetBrowserModelId(BrowserDistribution::GetDistribution(), diff --git a/chrome/browser/sync/test/integration/sync_extension_helper.cc b/chrome/browser/sync/test/integration/sync_extension_helper.cc index e7ff318..0979ef4 100644 --- a/chrome/browser/sync/test/integration/sync_extension_helper.cc +++ b/chrome/browser/sync/test/integration/sync_extension_helper.cc @@ -312,8 +312,8 @@ scoped_refptr<Extension> CreateExtension(const base::FilePath& base_dir, ADD_FAILURE(); return NULL; } - if (!file_util::CreateTemporaryDirInDir( - base_dir, sub_dir.value(), &extension_dir)) { + if (!base::CreateTemporaryDirInDir(base_dir, sub_dir.value(), + &extension_dir)) { ADD_FAILURE(); return NULL; } diff --git a/chrome/browser/sync_file_system/drive_backend/drive_backend_util.cc b/chrome/browser/sync_file_system/drive_backend/drive_backend_util.cc index fdcd188..4904ca1 100644 --- a/chrome/browser/sync_file_system/drive_backend/drive_backend_util.cc +++ b/chrome/browser/sync_file_system/drive_backend/drive_backend_util.cc @@ -127,7 +127,7 @@ scoped_ptr<FileMetadata> CreateDeletedFileMetadata( webkit_blob::ScopedFile CreateTemporaryFile( base::TaskRunner* file_task_runner) { base::FilePath temp_file_path; - if (!file_util::CreateTemporaryFile(&temp_file_path)) + if (!base::CreateTemporaryFile(&temp_file_path)) return webkit_blob::ScopedFile(); return webkit_blob::ScopedFile( 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 6c26105..2666654 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 @@ -145,7 +145,7 @@ 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) && - file_util::CreateTemporaryFileInDir(dir_path, &temp_file_path); + base::CreateTemporaryFileInDir(dir_path, &temp_file_path); if (!success) return success; *temp_file = 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 430f94e..0f93d9b 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 @@ -226,7 +226,7 @@ GDataErrorCode FakeDriveServiceHelper::ReadFile( error = google_apis::GDATA_OTHER_ERROR; base::FilePath temp_file; - EXPECT_TRUE(file_util::CreateTemporaryFileInDir(temp_dir_, &temp_file)); + EXPECT_TRUE(base::CreateTemporaryFileInDir(temp_dir_, &temp_file)); fake_drive_service_->DownloadFile( temp_file, file->resource_id(), base::Bind(&DownloadResultCallback, &error), @@ -285,7 +285,7 @@ void FakeDriveServiceHelper::Initialize() { base::FilePath FakeDriveServiceHelper::WriteToTempFile( const std::string& content) { base::FilePath temp_file; - EXPECT_TRUE(file_util::CreateTemporaryFileInDir(temp_dir_, &temp_file)); + EXPECT_TRUE(base::CreateTemporaryFileInDir(temp_dir_, &temp_file)); EXPECT_EQ(static_cast<int>(content.size()), file_util::WriteFile(temp_file, content.data(), content.size())); return temp_file; 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 59eede4..840f59c 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 @@ -793,8 +793,8 @@ void LocalFileSyncContext::DidGetWritingStatusForSync( webkit_blob::ScopedFile snapshot; if (file_error == base::PLATFORM_FILE_OK && sync_mode == SYNC_SNAPSHOT) { base::FilePath snapshot_path; - file_util::CreateTemporaryFileInDir(local_base_path_.Append(kSnapshotDir), - &snapshot_path); + base::CreateTemporaryFileInDir(local_base_path_.Append(kSnapshotDir), + &snapshot_path); if (base::CopyFile(platform_path, snapshot_path)) { platform_path = snapshot_path; snapshot = webkit_blob::ScopedFile( diff --git a/chrome/browser/sync_file_system/local/local_file_sync_service_unittest.cc b/chrome/browser/sync_file_system/local/local_file_sync_service_unittest.cc index 286c53e..6ad32ff 100644 --- a/chrome/browser/sync_file_system/local/local_file_sync_service_unittest.cc +++ b/chrome/browser/sync_file_system/local/local_file_sync_service_unittest.cc @@ -211,8 +211,7 @@ TEST_F(LocalFileSyncServiceTest, RemoteSyncStepsSimple) { const int kTestFileDataSize = static_cast<int>(arraysize(kTestFileData) - 1); base::FilePath local_path; - ASSERT_TRUE(file_util::CreateTemporaryFileInDir(temp_dir_.path(), - &local_path)); + ASSERT_TRUE(base::CreateTemporaryFileInDir(temp_dir_.path(), &local_path)); ASSERT_EQ(kTestFileDataSize, file_util::WriteFile(local_path, kTestFileData, kTestFileDataSize)); diff --git a/chrome/browser/sync_file_system/local/syncable_file_operation_runner_unittest.cc b/chrome/browser/sync_file_system/local/syncable_file_operation_runner_unittest.cc index 7e7693f..a49b916 100644 --- a/chrome/browser/sync_file_system/local/syncable_file_operation_runner_unittest.cc +++ b/chrome/browser/sync_file_system/local/syncable_file_operation_runner_unittest.cc @@ -126,7 +126,7 @@ class SyncableFileOperationRunnerTest : public testing::Test { } bool CreateTempFile(base::FilePath* path) { - return file_util::CreateTemporaryFileInDir(dir_.path(), path); + return base::CreateTemporaryFileInDir(dir_.path(), path); } ScopedEnableSyncFSDirectoryOperation enable_directory_operation_; diff --git a/chrome/browser/ui/libgtk2ui/app_indicator_icon.cc b/chrome/browser/ui/libgtk2ui/app_indicator_icon.cc index 6b75c4a..dc2fffd 100644 --- a/chrome/browser/ui/libgtk2ui/app_indicator_icon.cc +++ b/chrome/browser/ui/libgtk2ui/app_indicator_icon.cc @@ -139,7 +139,7 @@ base::FilePath CreateTempImageFile(gfx::ImageSkia* image_ptr, // Create a new temporary directory for each image since using a single // temporary directory seems to have issues when changing icons in quick // succession. - if (!file_util::CreateNewTempDirectory("", &temp_dir)) + if (!base::CreateNewTempDirectory(base::FilePath::StringType(), &temp_dir)) return base::FilePath(); new_file_path = temp_dir.Append(id + base::StringPrintf("_%d.png", icon_change_count)); diff --git a/chrome/browser/ui/network_profile_bubble.cc b/chrome/browser/ui/network_profile_bubble.cc index 6de46c3..491a9e7 100644 --- a/chrome/browser/ui/network_profile_bubble.cc +++ b/chrome/browser/ui/network_profile_bubble.cc @@ -127,7 +127,7 @@ void NetworkProfileBubble::CheckNetworkProfile( base::FilePath temp_file; // Try to create some non-empty temp file in the profile dir and use // it to check if there is a reparse-point free path to it. - if (file_util::CreateTemporaryFileInDir(profile_folder, &temp_file) && + if (base::CreateTemporaryFileInDir(profile_folder, &temp_file) && (file_util::WriteFile(temp_file, ".", 1) == 1)) { base::FilePath normalized_temp_file; if (!file_util::NormalizeFilePath(temp_file, &normalized_temp_file)) diff --git a/chrome/browser/ui/pdf/pdf_browsertest.cc b/chrome/browser/ui/pdf/pdf_browsertest.cc index 07809fe..1a51904 100644 --- a/chrome/browser/ui/pdf/pdf_browsertest.cc +++ b/chrome/browser/ui/pdf/pdf_browsertest.cc @@ -181,7 +181,7 @@ class PDFBrowserTest : public InProcessBrowserTest, if (snapshot_different_) { std::vector<unsigned char> png_data; gfx::PNGCodec::EncodeBGRASkBitmap(bitmap, false, &png_data); - if (file_util::CreateTemporaryFile(&snapshot_filename_)) { + if (base::CreateTemporaryFile(&snapshot_filename_)) { file_util::WriteFile(snapshot_filename_, reinterpret_cast<char*>(&png_data[0]), png_data.size()); } diff --git a/chrome/browser/ui/webui/net_internals/net_internals_ui_browsertest.cc b/chrome/browser/ui/webui/net_internals/net_internals_ui_browsertest.cc index 8bb3373..68345cb 100644 --- a/chrome/browser/ui/webui/net_internals/net_internals_ui_browsertest.cc +++ b/chrome/browser/ui/webui/net_internals/net_internals_ui_browsertest.cc @@ -340,8 +340,8 @@ void NetInternalsTest::MessageHandler::GetNetLogLoggerLog( base::ScopedTempDir temp_directory; ASSERT_TRUE(temp_directory.CreateUniqueTempDir()); base::FilePath temp_file; - ASSERT_TRUE(file_util::CreateTemporaryFileInDir(temp_directory.path(), - &temp_file)); + ASSERT_TRUE(base::CreateTemporaryFileInDir(temp_directory.path(), + &temp_file)); FILE* temp_file_handle = file_util::OpenFile(temp_file, "w"); ASSERT_TRUE(temp_file_handle); |