diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-07 00:04:53 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-07 00:04:53 +0000 |
commit | 5a6ddb19886d009376be90a25b14e5a10a26b586 (patch) | |
tree | a4b11d08ca7feee8ccbef9074fe16b0b1f78f0db /chrome/browser | |
parent | b2ed3971b1a3a1f13c95d5144652e6c519c10c47 (diff) | |
download | chromium_src-5a6ddb19886d009376be90a25b14e5a10a26b586.zip chromium_src-5a6ddb19886d009376be90a25b14e5a10a26b586.tar.gz chromium_src-5a6ddb19886d009376be90a25b14e5a10a26b586.tar.bz2 |
Move more file_util functions to base namespace.
TBR=sky
Review URL: https://codereview.chromium.org/109043002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239280 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
25 files changed, 48 insertions, 48 deletions
diff --git a/chrome/browser/chromeos/boot_times_loader.cc b/chrome/browser/chromeos/boot_times_loader.cc index f7ee861..451c6a0 100644 --- a/chrome/browser/chromeos/boot_times_loader.cc +++ b/chrome/browser/chromeos/boot_times_loader.cc @@ -129,12 +129,12 @@ BootTimesLoader* BootTimesLoader::Get() { static int AppendFile(const base::FilePath& file_path, const char* data, int size) { - FILE* file = file_util::OpenFile(file_path, "a"); + FILE* file = base::OpenFile(file_path, "a"); if (!file) { return -1; } const int num_bytes_written = fwrite(data, 1, size, file); - file_util::CloseFile(file); + base::CloseFile(file); return num_bytes_written; } diff --git a/chrome/browser/chromeos/drive/file_cache.cc b/chrome/browser/chromeos/drive/file_cache.cc index 7b96f93..876df69 100644 --- a/chrome/browser/chromeos/drive/file_cache.cc +++ b/chrome/browser/chromeos/drive/file_cache.cc @@ -429,7 +429,7 @@ bool FileCache::RecoverFilesFromCacheDirectory( // Read file contents to sniff mime type. std::vector<char> content(net::kMaxBytesToSniff); const int read_result = - file_util::ReadFile(current, &content[0], content.size()); + base::ReadFile(current, &content[0], content.size()); if (read_result < 0) { LOG(WARNING) << "Cannot read: " << current.value(); return false; diff --git a/chrome/browser/chromeos/login/parallel_authenticator_unittest.cc b/chrome/browser/chromeos/login/parallel_authenticator_unittest.cc index 831c626..1a61dc2 100644 --- a/chrome/browser/chromeos/login/parallel_authenticator_unittest.cc +++ b/chrome/browser/chromeos/login/parallel_authenticator_unittest.cc @@ -98,7 +98,7 @@ class ParallelAuthenticatorTest : public testing::Test { 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)); + EXPECT_TRUE(base::CloseFile(tmp_file)); return out; } diff --git a/chrome/browser/chromeos/login/startup_utils.cc b/chrome/browser/chromeos/login/startup_utils.cc index 70a4244..153182b 100644 --- a/chrome/browser/chromeos/login/startup_utils.cc +++ b/chrome/browser/chromeos/login/startup_utils.cc @@ -95,11 +95,11 @@ static void CreateOobeCompleteFlagFile() { // Create flag file for boot-time init scripts. base::FilePath oobe_complete_path = GetOobeCompleteFlagPath(); if (!base::PathExists(oobe_complete_path)) { - FILE* oobe_flag_file = file_util::OpenFile(oobe_complete_path, "w+b"); + FILE* oobe_flag_file = base::OpenFile(oobe_complete_path, "w+b"); if (oobe_flag_file == NULL) DLOG(WARNING) << oobe_complete_path.value() << " doesn't exist."; else - file_util::CloseFile(oobe_flag_file); + base::CloseFile(oobe_flag_file); } } diff --git a/chrome/browser/chromeos/policy/enterprise_install_attributes.cc b/chrome/browser/chromeos/policy/enterprise_install_attributes.cc index 278309d..7c96eb8 100644 --- a/chrome/browser/chromeos/policy/enterprise_install_attributes.cc +++ b/chrome/browser/chromeos/policy/enterprise_install_attributes.cc @@ -107,7 +107,7 @@ void EnterpriseInstallAttributes::ReadCacheFile( device_locked_ = true; char buf[16384]; - int len = file_util::ReadFile(cache_file, buf, sizeof(buf)); + int len = base::ReadFile(cache_file, buf, sizeof(buf)); if (len == -1 || len >= static_cast<int>(sizeof(buf))) { PLOG(ERROR) << "Failed to read " << cache_file.value(); return; diff --git a/chrome/browser/chromeos/policy/user_cloud_policy_store_chromeos.cc b/chrome/browser/chromeos/policy/user_cloud_policy_store_chromeos.cc index cf9eeb3..980bfdf 100644 --- a/chrome/browser/chromeos/policy/user_cloud_policy_store_chromeos.cc +++ b/chrome/browser/chromeos/policy/user_cloud_policy_store_chromeos.cc @@ -505,7 +505,7 @@ void UserCloudPolicyStoreChromeOS::LoadPolicyKey(const base::FilePath& path, LOG(ERROR) << "Key at " << path.value() << " has bad size " << size; } else { key->resize(size); - int read_size = file_util::ReadFile( + int read_size = base::ReadFile( path, reinterpret_cast<char*>(vector_as_array(key)), size); if (read_size != size) { LOG(ERROR) << "Failed to read key at " << path.value(); diff --git a/chrome/browser/chromeos/settings/owner_key_util.cc b/chrome/browser/chromeos/settings/owner_key_util.cc index 560a6ce..d98fe07 100644 --- a/chrome/browser/chromeos/settings/owner_key_util.cc +++ b/chrome/browser/chromeos/settings/owner_key_util.cc @@ -58,7 +58,7 @@ bool OwnerKeyUtilImpl::ImportPublicKey(std::vector<uint8>* output) { } // Get the key data off of disk - int data_read = file_util::ReadFile( + int data_read = base::ReadFile( key_file_, reinterpret_cast<char*>(vector_as_array(output)), safe_file_size); diff --git a/chrome/browser/component_updater/component_unpacker.cc b/chrome/browser/component_updater/component_unpacker.cc index 789049a..ba9f658 100644 --- a/chrome/browser/component_updater/component_unpacker.cc +++ b/chrome/browser/component_updater/component_unpacker.cc @@ -122,7 +122,7 @@ ComponentUnpacker::ComponentUnpacker(const std::vector<uint8>& pk_hash, } // First, validate the CRX header and signature. As of today // this is SHA1 with RSA 1024. - ScopedStdioHandle file(file_util::OpenFile(path, "rb")); + ScopedStdioHandle file(base::OpenFile(path, "rb")); if (!file.get()) { error_ = kInvalidFile; return; diff --git a/chrome/browser/extensions/extension_creator.cc b/chrome/browser/extensions/extension_creator.cc index be9ac61..c31a399 100644 --- a/chrome/browser/extensions/extension_creator.cc +++ b/chrome/browser/extensions/extension_creator.cc @@ -213,7 +213,7 @@ bool ExtensionCreator::SignZip(const base::FilePath& zip_path, std::vector<uint8>* signature) { scoped_ptr<crypto::SignatureCreator> signature_creator( crypto::SignatureCreator::Create(private_key)); - ScopedStdioHandle zip_handle(file_util::OpenFile(zip_path, "rb")); + ScopedStdioHandle zip_handle(base::OpenFile(zip_path, "rb")); size_t buffer_size = 1 << 16; scoped_ptr<uint8[]> buffer(new uint8[buffer_size]); int bytes_read = -1; @@ -241,7 +241,7 @@ bool ExtensionCreator::WriteCRX(const base::FilePath& zip_path, const base::FilePath& crx_path) { if (base::PathExists(crx_path)) base::DeleteFile(crx_path, false); - ScopedStdioHandle crx_handle(file_util::OpenFile(crx_path, "wb")); + ScopedStdioHandle crx_handle(base::OpenFile(crx_path, "wb")); if (!crx_handle.get()) { error_message_ = l10n_util::GetStringUTF8(IDS_EXTENSION_SHARING_VIOLATION); return false; @@ -273,7 +273,7 @@ bool ExtensionCreator::WriteCRX(const base::FilePath& zip_path, size_t buffer_size = 1 << 16; scoped_ptr<uint8[]> buffer(new uint8[buffer_size]); size_t bytes_read = 0; - ScopedStdioHandle zip_handle(file_util::OpenFile(zip_path, "rb")); + ScopedStdioHandle zip_handle(base::OpenFile(zip_path, "rb")); while ((bytes_read = fread(buffer.get(), 1, buffer_size, zip_handle.get())) > 0) { if (fwrite(buffer.get(), sizeof(char), bytes_read, crx_handle.get()) != diff --git a/chrome/browser/extensions/external_registry_loader_win.cc b/chrome/browser/extensions/external_registry_loader_win.cc index 599b0cd..2edf5fa 100644 --- a/chrome/browser/extensions/external_registry_loader_win.cc +++ b/chrome/browser/extensions/external_registry_loader_win.cc @@ -33,7 +33,7 @@ const wchar_t kRegistryExtensionPath[] = L"path"; const wchar_t kRegistryExtensionVersion[] = L"version"; bool CanOpenFileForReading(const base::FilePath& path) { - ScopedStdioHandle file_handle(file_util::OpenFile(path, "rb")); + ScopedStdioHandle file_handle(base::OpenFile(path, "rb")); return file_handle.get() != NULL; } diff --git a/chrome/browser/extensions/sandboxed_unpacker.cc b/chrome/browser/extensions/sandboxed_unpacker.cc index 48c9230..34716af 100644 --- a/chrome/browser/extensions/sandboxed_unpacker.cc +++ b/chrome/browser/extensions/sandboxed_unpacker.cc @@ -415,7 +415,7 @@ void SandboxedUnpacker::OnUnpackExtensionFailed(const string16& error) { } bool SandboxedUnpacker::ValidateSignature() { - ScopedStdioHandle file(file_util::OpenFile(crx_path_, "rb")); + ScopedStdioHandle file(base::OpenFile(crx_path_, "rb")); if (!file.get()) { // Could not open crx file for reading. diff --git a/chrome/browser/history/thumbnail_database_unittest.cc b/chrome/browser/history/thumbnail_database_unittest.cc index 5e72eb7..6e00e62 100644 --- a/chrome/browser/history/thumbnail_database_unittest.cc +++ b/chrome/browser/history/thumbnail_database_unittest.cc @@ -83,7 +83,7 @@ int GetRootPage(sql::Connection* db, const char* name) { // per SQLite usage. bool ReadPage(const base::FilePath& path, size_t page_no, char* buf, size_t page_size) { - file_util::ScopedFILE file(file_util::OpenFile(path, "rb")); + file_util::ScopedFILE file(base::OpenFile(path, "rb")); if (!file.get()) return false; if (0 != fseek(file.get(), (page_no - 1) * page_size, SEEK_SET)) @@ -97,7 +97,7 @@ bool ReadPage(const base::FilePath& path, size_t page_no, // per SQLite usage. bool WritePage(const base::FilePath& path, size_t page_no, const char* buf, size_t page_size) { - file_util::ScopedFILE file(file_util::OpenFile(path, "rb+")); + file_util::ScopedFILE file(base::OpenFile(path, "rb+")); if (!file.get()) return false; if (0 != fseek(file.get(), (page_no - 1) * page_size, SEEK_SET)) diff --git a/chrome/browser/importer/firefox_profile_lock_unittest.cc b/chrome/browser/importer/firefox_profile_lock_unittest.cc index c93d987..24a3259 100644 --- a/chrome/browser/importer/firefox_profile_lock_unittest.cc +++ b/chrome/browser/importer/firefox_profile_lock_unittest.cc @@ -70,9 +70,9 @@ TEST_F(FirefoxProfileLockTest, ProfileLockOrphaned) { test_path.Append(FirefoxProfileLock::kLockFileName); // Create the orphaned lock file. - FILE* lock_file = file_util::OpenFile(lock_file_path, "w"); + FILE* lock_file = base::OpenFile(lock_file_path, "w"); ASSERT_TRUE(lock_file); - file_util::CloseFile(lock_file); + base::CloseFile(lock_file); EXPECT_TRUE(base::PathExists(lock_file_path)); scoped_ptr<FirefoxProfileLock> lock; diff --git a/chrome/browser/net/net_log_temp_file.cc b/chrome/browser/net/net_log_temp_file.cc index f68528b..f117ae7 100644 --- a/chrome/browser/net/net_log_temp_file.cc +++ b/chrome/browser/net/net_log_temp_file.cc @@ -96,7 +96,7 @@ void NetLogTempFile::StartNetLog() { // Try to make sure we can create the file. // TODO(rtenneti): Find a better for doing the following. Surface some error // to the user if we couldn't create the file. - FILE* file = file_util::OpenFile(log_path_, "w"); + FILE* file = base::OpenFile(log_path_, "w"); if (file == NULL) return; diff --git a/chrome/browser/parsers/metadata_parser_manager.cc b/chrome/browser/parsers/metadata_parser_manager.cc index 1b10f98..b60a0dd 100644 --- a/chrome/browser/parsers/metadata_parser_manager.cc +++ b/chrome/browser/parsers/metadata_parser_manager.cc @@ -39,7 +39,7 @@ MetadataParser* MetadataParserManager::GetParserForFile( char buffer[kAmountToRead]; int amount_read = 0; DLOG(ERROR) << path.value(); - amount_read = file_util::ReadFile(path, buffer, sizeof(buffer)); + amount_read = base::ReadFile(path, buffer, sizeof(buffer)); if (amount_read <= 0) { DLOG(ERROR) << "Unable to read file"; return NULL; diff --git a/chrome/browser/safe_browsing/prefix_set.cc b/chrome/browser/safe_browsing/prefix_set.cc index e3100c7..4a1ff73 100644 --- a/chrome/browser/safe_browsing/prefix_set.cc +++ b/chrome/browser/safe_browsing/prefix_set.cc @@ -160,7 +160,7 @@ PrefixSet* PrefixSet::LoadFile(const base::FilePath& filter_name) { if (size_64 < static_cast<int64>(sizeof(FileHeader) + sizeof(MD5Digest))) return NULL; - file_util::ScopedFILE file(file_util::OpenFile(filter_name, "rb")); + file_util::ScopedFILE file(base::OpenFile(filter_name, "rb")); if (!file.get()) return NULL; @@ -243,7 +243,7 @@ bool PrefixSet::WriteFile(const base::FilePath& filter_name) const { return false; } - file_util::ScopedFILE file(file_util::OpenFile(filter_name, "wb")); + file_util::ScopedFILE file(base::OpenFile(filter_name, "wb")); if (!file.get()) return false; diff --git a/chrome/browser/safe_browsing/prefix_set_unittest.cc b/chrome/browser/safe_browsing/prefix_set_unittest.cc index 10865e9..ee3c3fb 100644 --- a/chrome/browser/safe_browsing/prefix_set_unittest.cc +++ b/chrome/browser/safe_browsing/prefix_set_unittest.cc @@ -151,7 +151,7 @@ class PrefixSetTest : public PlatformTest { int64 size_64; ASSERT_TRUE(base::GetFileSize(filename, &size_64)); - file_util::ScopedFILE file(file_util::OpenFile(filename, "r+b")); + file_util::ScopedFILE file(base::OpenFile(filename, "r+b")); IncrementIntAt(file.get(), offset, inc); CleanChecksum(file.get()); file.reset(); @@ -373,7 +373,7 @@ TEST_F(PrefixSetTest, CorruptionHelpers) { ASSERT_TRUE(GetPrefixSetFile(&filename)); // This will modify data in |index_|, which will fail the digest check. - file_util::ScopedFILE file(file_util::OpenFile(filename, "r+b")); + file_util::ScopedFILE file(base::OpenFile(filename, "r+b")); IncrementIntAt(file.get(), kPayloadOffset, 1); file.reset(); scoped_ptr<safe_browsing::PrefixSet> @@ -382,7 +382,7 @@ TEST_F(PrefixSetTest, CorruptionHelpers) { // Fix up the checksum and it will read successfully (though the // data will be wrong). - file.reset(file_util::OpenFile(filename, "r+b")); + file.reset(base::OpenFile(filename, "r+b")); CleanChecksum(file.get()); file.reset(); prefix_set.reset(safe_browsing::PrefixSet::LoadFile(filename)); @@ -443,7 +443,7 @@ TEST_F(PrefixSetTest, CorruptionPayload) { base::FilePath filename; ASSERT_TRUE(GetPrefixSetFile(&filename)); - file_util::ScopedFILE file(file_util::OpenFile(filename, "r+b")); + file_util::ScopedFILE file(base::OpenFile(filename, "r+b")); ASSERT_NO_FATAL_FAILURE(IncrementIntAt(file.get(), 666, 1)); file.reset(); scoped_ptr<safe_browsing::PrefixSet> @@ -458,7 +458,7 @@ TEST_F(PrefixSetTest, CorruptionDigest) { int64 size_64; ASSERT_TRUE(base::GetFileSize(filename, &size_64)); - file_util::ScopedFILE file(file_util::OpenFile(filename, "r+b")); + file_util::ScopedFILE file(base::OpenFile(filename, "r+b")); long digest_offset = static_cast<long>(size_64 - sizeof(base::MD5Digest)); ASSERT_NO_FATAL_FAILURE(IncrementIntAt(file.get(), digest_offset, 1)); file.reset(); @@ -473,7 +473,7 @@ TEST_F(PrefixSetTest, CorruptionExcess) { ASSERT_TRUE(GetPrefixSetFile(&filename)); // Add some junk to the trunk. - file_util::ScopedFILE file(file_util::OpenFile(filename, "ab")); + file_util::ScopedFILE file(base::OpenFile(filename, "ab")); const char buf[] = "im in ur base, killing ur d00dz."; ASSERT_EQ(strlen(buf), fwrite(buf, 1, strlen(buf), file.get())); file.reset(); diff --git a/chrome/browser/safe_browsing/safe_browsing_database_unittest.cc b/chrome/browser/safe_browsing/safe_browsing_database_unittest.cc index 9810858..daa0b11 100644 --- a/chrome/browser/safe_browsing/safe_browsing_database_unittest.cc +++ b/chrome/browser/safe_browsing/safe_browsing_database_unittest.cc @@ -1152,7 +1152,7 @@ TEST_F(SafeBrowsingDatabaseTest, DISABLED_FileCorruptionHandling) { // Corrupt the file by corrupting the checksum, which is not checked // until the entire table is read in |UpdateFinished()|. - FILE* fp = file_util::OpenFile(database_filename_, "r+"); + FILE* fp = base::OpenFile(database_filename_, "r+"); ASSERT_TRUE(fp); ASSERT_NE(-1, fseek(fp, -8, SEEK_END)); for (size_t i = 0; i < 8; ++i) { diff --git a/chrome/browser/safe_browsing/safe_browsing_store_file.cc b/chrome/browser/safe_browsing/safe_browsing_store_file.cc index 3500819..a1be058 100644 --- a/chrome/browser/safe_browsing/safe_browsing_store_file.cc +++ b/chrome/browser/safe_browsing/safe_browsing_store_file.cc @@ -292,7 +292,7 @@ bool SafeBrowsingStoreFile::WriteAddPrefix(int32 chunk_id, SBPrefix prefix) { bool SafeBrowsingStoreFile::GetAddPrefixes(SBAddPrefixes* add_prefixes) { add_prefixes->clear(); - file_util::ScopedFILE file(file_util::OpenFile(filename_, "rb")); + file_util::ScopedFILE file(base::OpenFile(filename_, "rb")); if (file.get() == NULL) return false; FileHeader header; @@ -314,7 +314,7 @@ bool SafeBrowsingStoreFile::GetAddFullHashes( std::vector<SBAddFullHash>* add_full_hashes) { add_full_hashes->clear(); - file_util::ScopedFILE file(file_util::OpenFile(filename_, "rb")); + file_util::ScopedFILE file(base::OpenFile(filename_, "rb")); if (file.get() == NULL) return false; FileHeader header; @@ -397,11 +397,11 @@ bool SafeBrowsingStoreFile::BeginUpdate() { corruption_seen_ = false; const base::FilePath new_filename = TemporaryFileForFilename(filename_); - file_util::ScopedFILE new_file(file_util::OpenFile(new_filename, "wb+")); + file_util::ScopedFILE new_file(base::OpenFile(new_filename, "wb+")); if (new_file.get() == NULL) return false; - file_util::ScopedFILE file(file_util::OpenFile(filename_, "rb")); + file_util::ScopedFILE file(base::OpenFile(filename_, "rb")); empty_ = (file.get() == NULL); if (empty_) { // If the file exists but cannot be opened, try to delete it (not @@ -644,7 +644,7 @@ bool SafeBrowsingStoreFile::DoUpdate( return false; // Trim any excess left over from the temporary chunk data. - if (!file_util::TruncateFile(new_file_.get())) + if (!base::TruncateFile(new_file_.get())) return false; // Close the file handle and swizzle the file into place. diff --git a/chrome/browser/safe_browsing/safe_browsing_store_file_unittest.cc b/chrome/browser/safe_browsing/safe_browsing_store_file_unittest.cc index ac8002f..28add4a 100644 --- a/chrome/browser/safe_browsing/safe_browsing_store_file_unittest.cc +++ b/chrome/browser/safe_browsing/safe_browsing_store_file_unittest.cc @@ -90,7 +90,7 @@ TEST_F(SafeBrowsingStoreFileTest, DetectsCorruption) { EXPECT_FALSE(corruption_detected_); // Corrupt the store. - file_util::ScopedFILE file(file_util::OpenFile(filename_, "rb+")); + file_util::ScopedFILE file(base::OpenFile(filename_, "rb+")); const long kOffset = 60; EXPECT_EQ(fseek(file.get(), kOffset, SEEK_SET), 0); const int32 kZero = 0; @@ -114,7 +114,7 @@ TEST_F(SafeBrowsingStoreFileTest, DetectsCorruption) { // Make it look like there is a lot of add-chunks-seen data. const long kAddChunkCountOffset = 2 * sizeof(int32); const int32 kLargeCount = 1000 * 1000 * 1000; - file.reset(file_util::OpenFile(filename_, "rb+")); + file.reset(base::OpenFile(filename_, "rb+")); EXPECT_EQ(fseek(file.get(), kAddChunkCountOffset, SEEK_SET), 0); EXPECT_EQ(fwrite(&kLargeCount, sizeof(kLargeCount), 1, file.get()), 1U); file.reset(); @@ -156,7 +156,7 @@ TEST_F(SafeBrowsingStoreFileTest, CheckValidityPayload) { const size_t kOffset = 37; { - file_util::ScopedFILE file(file_util::OpenFile(filename_, "rb+")); + file_util::ScopedFILE file(base::OpenFile(filename_, "rb+")); EXPECT_EQ(0, fseek(file.get(), kOffset, SEEK_SET)); EXPECT_GE(fputs("hello", file.get()), 0); } @@ -176,7 +176,7 @@ TEST_F(SafeBrowsingStoreFileTest, CheckValidityChecksum) { const int kOffset = -static_cast<int>(sizeof(base::MD5Digest)); { - file_util::ScopedFILE file(file_util::OpenFile(filename_, "rb+")); + file_util::ScopedFILE file(base::OpenFile(filename_, "rb+")); EXPECT_EQ(0, fseek(file.get(), kOffset, SEEK_END)); EXPECT_GE(fputs("hello", file.get()), 0); } diff --git a/chrome/browser/storage_monitor/image_capture_device_manager_unittest.mm b/chrome/browser/storage_monitor/image_capture_device_manager_unittest.mm index 5b2e317..42f0a42 100644 --- a/chrome/browser/storage_monitor/image_capture_device_manager_unittest.mm +++ b/chrome/browser/storage_monitor/image_capture_device_manager_unittest.mm @@ -391,8 +391,8 @@ TEST_F(ImageCaptureDeviceManagerTest, DownloadFile) { EXPECT_EQ(kTestFileName, listener_.downloads()[1]); ASSERT_EQ(base::PLATFORM_FILE_OK, listener_.last_error()); char file_contents[5]; - ASSERT_EQ(4, file_util::ReadFile(temp_file, file_contents, - strlen(kTestFileContents))); + ASSERT_EQ(4, base::ReadFile(temp_file, file_contents, + strlen(kTestFileContents))); EXPECT_EQ(kTestFileContents, std::string(file_contents, strlen(kTestFileContents))); @@ -425,8 +425,8 @@ TEST_F(ImageCaptureDeviceManagerTest, TestSubdirectories) { base::RunLoop().RunUntilIdle(); char file_contents[5]; - ASSERT_EQ(4, file_util::ReadFile(temp_file, file_contents, - strlen(kTestFileContents))); + ASSERT_EQ(4, base::ReadFile(temp_file, file_contents, + strlen(kTestFileContents))); EXPECT_EQ(kTestFileContents, std::string(file_contents, strlen(kTestFileContents))); diff --git a/chrome/browser/ui/pdf/pdf_browsertest.cc b/chrome/browser/ui/pdf/pdf_browsertest.cc index 105feac..6373095 100644 --- a/chrome/browser/ui/pdf/pdf_browsertest.cc +++ b/chrome/browser/ui/pdf/pdf_browsertest.cc @@ -133,7 +133,7 @@ class PDFBrowserTest : public InProcessBrowserTest, ASSERT_TRUE(base::GetFileInfo(reference, &info)); int size = static_cast<size_t>(info.size); scoped_ptr<char[]> data(new char[size]); - ASSERT_EQ(size, file_util::ReadFile(reference, data.get(), size)); + ASSERT_EQ(size, base::ReadFile(reference, data.get(), size)); int w, h; std::vector<unsigned char> decoded; 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 8b5c742..3df3b31 100644 --- a/chrome/browser/ui/views/select_file_dialog_extension_browsertest.cc +++ b/chrome/browser/ui/views/select_file_dialog_extension_browsertest.cc @@ -272,9 +272,9 @@ IN_PROC_BROWSER_TEST_F(SelectFileDialogExtensionBrowserTest, downloads_dir_.AppendASCII("file_manager_test.html"); // Create an empty file to give us something to select. - FILE* fp = file_util::OpenFile(test_file, "w"); + FILE* fp = base::OpenFile(test_file, "w"); ASSERT_TRUE(fp != NULL); - ASSERT_TRUE(file_util::CloseFile(fp)); + ASSERT_TRUE(base::CloseFile(fp)); gfx::NativeWindow owning_window = browser()->window()->GetNativeWindow(); 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 68345cb..5ce3876 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 @@ -342,7 +342,7 @@ void NetInternalsTest::MessageHandler::GetNetLogLoggerLog( base::FilePath temp_file; ASSERT_TRUE(base::CreateTemporaryFileInDir(temp_directory.path(), &temp_file)); - FILE* temp_file_handle = file_util::OpenFile(temp_file, "w"); + FILE* temp_file_handle = base::OpenFile(temp_file, "w"); ASSERT_TRUE(temp_file_handle); scoped_ptr<base::Value> constants(NetInternalsUI::GetConstants()); diff --git a/chrome/browser/web_applications/web_app_win.cc b/chrome/browser/web_applications/web_app_win.cc index a4d465b1..a4bf6d8 100644 --- a/chrome/browser/web_applications/web_app_win.cc +++ b/chrome/browser/web_applications/web_app_win.cc @@ -81,7 +81,7 @@ bool ShouldUpdateIcon(const base::FilePath& icon_file, return true; base::MD5Digest persisted_image_checksum; - if (sizeof(persisted_image_checksum) != file_util::ReadFile(checksum_file, + if (sizeof(persisted_image_checksum) != base::ReadFile(checksum_file, reinterpret_cast<char*>(&persisted_image_checksum), sizeof(persisted_image_checksum))) return true; |