summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--base/file_util.cc16
-rw-r--r--base/file_util.h17
-rw-r--r--base/file_util_posix.cc33
-rw-r--r--base/file_util_unittest.cc37
-rw-r--r--base/file_util_win.cc24
-rw-r--r--base/files/file_unittest.cc6
-rw-r--r--base/platform_file_unittest.cc218
-rw-r--r--base/test/test_file_util_mac.cc2
-rw-r--r--chrome/browser/chromeos/drive/file_cache.cc2
-rw-r--r--chrome/browser/chromeos/drive/file_system/copy_operation.cc2
-rw-r--r--chrome/browser/chromeos/drive/file_system/download_operation_unittest.cc2
-rw-r--r--chrome/browser/chromeos/drive/file_system/get_file_for_saving_operation_unittest.cc2
-rw-r--r--chrome/browser/chromeos/drive/file_system/open_file_operation_unittest.cc12
-rw-r--r--chrome/browser/chromeos/drive/file_system/truncate_operation_unittest.cc2
-rw-r--r--chrome/browser/chromeos/drive/file_system_util.cc2
-rw-r--r--chrome/browser/chromeos/extensions/install_limiter.cc2
-rw-r--r--chrome/browser/chromeos/policy/user_cloud_policy_store_chromeos.cc2
-rw-r--r--chrome/browser/chromeos/settings/owner_key_util.cc2
-rw-r--r--chrome/browser/diagnostics/recon_diagnostics.cc4
-rw-r--r--chrome/browser/download/download_browsertest.cc6
-rw-r--r--chrome/browser/download/save_page_browsertest.cc2
-rw-r--r--chrome/browser/drive/drive_uploader.cc2
-rw-r--r--chrome/browser/extensions/api/image_writer_private/operation_linux.cc2
-rw-r--r--chrome/browser/extensions/api/media_galleries/media_galleries_apitest.cc4
-rw-r--r--chrome/browser/extensions/sandboxed_unpacker.cc7
-rw-r--r--chrome/browser/history/history_database.cc2
-rw-r--r--chrome/browser/history/thumbnail_database.cc8
-rw-r--r--chrome/browser/net/net_log_temp_file_unittest.cc18
-rw-r--r--chrome/browser/net/sqlite_server_bound_cert_store.cc2
-rw-r--r--chrome/browser/parsers/metadata_parser_filebase.cc2
-rw-r--r--chrome/browser/parsers/metadata_parser_filebase_unittest.cc2
-rw-r--r--chrome/browser/performance_monitor/performance_monitor_browsertest.cc8
-rw-r--r--chrome/browser/predictors/predictor_database.cc2
-rw-r--r--chrome/browser/printing/print_dialog_cloud.cc2
-rw-r--r--chrome/browser/profiles/file_path_verifier_win.cc2
-rw-r--r--chrome/browser/safe_browsing/prefix_set.cc2
-rw-r--r--chrome/browser/safe_browsing/prefix_set_unittest.cc6
-rw-r--r--chrome/browser/safe_browsing/safe_browsing_database.cc2
-rw-r--r--chrome/browser/safe_browsing/safe_browsing_store_file.cc8
-rw-r--r--chrome/browser/sessions/session_backend.cc2
-rw-r--r--chrome/browser/ui/network_profile_bubble.cc5
-rw-r--r--chrome/common/extensions/extension_file_util.cc2
-rw-r--r--chrome/installer/tools/validate_installation_main.cc2
-rw-r--r--chrome/installer/util/logging_installer.cc2
-rw-r--r--chrome/installer/util/logging_installer_unittest.cc14
-rw-r--r--chrome_frame/test/perf/chrome_frame_perftest.cc2
-rw-r--r--cloud_print/virtual_driver/win/port_monitor/port_monitor.cc2
-rw-r--r--components/breakpad/browser/crash_dump_manager_android.cc2
-rw-r--r--content/browser/download/download_file_unittest.cc2
-rw-r--r--content/browser/download/mhtml_generation_browsertest.cc2
-rw-r--r--content/browser/fileapi/obfuscated_file_util_unittest.cc2
-rw-r--r--content/browser/indexed_db/indexed_db_browsertest.cc2
-rw-r--r--content/browser/net/sqlite_persistent_cookie_store.cc2
-rw-r--r--content/browser/tracing/tracing_controller_browsertest.cc4
-rw-r--r--content/common/mac/font_loader.mm2
-rw-r--r--content/common/plugin_list_posix.cc2
-rw-r--r--content/renderer/media/media_stream_audio_processor_unittest.cc2
-rw-r--r--content/renderer/media/webrtc_audio_device_unittest.cc2
-rw-r--r--content/test/image_decoder_test.cc2
-rw-r--r--content/test/weburl_loader_mock_factory.cc2
-rw-r--r--courgette/courgette_tool.cc2
-rw-r--r--media/base/container_names_unittest.cc2
-rw-r--r--media/base/test_data_util.cc2
-rw-r--r--media/base/yuv_convert_unittest.cc2
-rw-r--r--net/base/file_stream_unittest.cc56
-rw-r--r--net/base/upload_file_element_reader.cc2
-rw-r--r--net/dns/dns_hosts.cc2
-rw-r--r--net/url_request/url_request_unittest.cc30
-rw-r--r--printing/emf_win_unittest.cc2
-rw-r--r--sql/connection.cc2
-rw-r--r--sql/test/test_helpers.cc2
-rw-r--r--third_party/leveldatabase/env_chromium.cc2
-rw-r--r--webkit/browser/database/database_tracker.cc2
-rw-r--r--webkit/browser/database/vfs_backend.cc2
-rw-r--r--webkit/browser/fileapi/dump_file_system.cc2
-rw-r--r--webkit/browser/fileapi/quota/open_file_handle_context.cc4
-rw-r--r--webkit/browser/fileapi/quota/quota_reservation_manager_unittest.cc2
77 files changed, 323 insertions, 330 deletions
diff --git a/base/file_util.cc b/base/file_util.cc
index 1639cce..1198636 100644
--- a/base/file_util.cc
+++ b/base/file_util.cc
@@ -165,6 +165,14 @@ bool CreateDirectory(const FilePath& full_path) {
return CreateDirectoryAndGetError(full_path, NULL);
}
+bool GetFileSize(const FilePath& file_path, int64* file_size) {
+ PlatformFileInfo info;
+ if (!file_util::GetFileInfo(file_path, &info))
+ return false;
+ *file_size = info.size;
+ return true;
+}
+
} // namespace base
// -----------------------------------------------------------------------------
@@ -175,14 +183,6 @@ using base::FileEnumerator;
using base::FilePath;
using base::kMaxUniqueFiles;
-bool GetFileSize(const FilePath& file_path, int64* file_size) {
- base::PlatformFileInfo info;
- if (!GetFileInfo(file_path, &info))
- return false;
- *file_size = info.size;
- return true;
-}
-
bool TouchFile(const FilePath& path,
const base::Time& last_accessed,
const base::Time& last_modified) {
diff --git a/base/file_util.h b/base/file_util.h
index 30d9d09..8407f5a 100644
--- a/base/file_util.h
+++ b/base/file_util.h
@@ -261,14 +261,8 @@ BASE_EXPORT bool CreateDirectoryAndGetError(const FilePath& full_path,
// Backward-compatible convenience method for the above.
BASE_EXPORT bool CreateDirectory(const FilePath& full_path);
-} // namespace base
-
-// -----------------------------------------------------------------------------
-
-namespace file_util {
-
// Returns the file size. Returns true on success.
-BASE_EXPORT bool GetFileSize(const base::FilePath& file_path, int64* file_size);
+BASE_EXPORT bool GetFileSize(const FilePath& file_path, int64* file_size);
// Sets |real_path| to |path| with symbolic links and junctions expanded.
// On windows, make sure the path starts with a lettered drive.
@@ -276,8 +270,13 @@ BASE_EXPORT bool GetFileSize(const base::FilePath& file_path, int64* file_size);
// a directory or to a nonexistent path. On windows, this function will
// fail if |path| is a junction or symlink that points to an empty file,
// or if |real_path| would be longer than MAX_PATH characters.
-BASE_EXPORT bool NormalizeFilePath(const base::FilePath& path,
- base::FilePath* real_path);
+BASE_EXPORT bool NormalizeFilePath(const FilePath& path, FilePath* real_path);
+
+} // namespace base
+
+// -----------------------------------------------------------------------------
+
+namespace file_util {
#if defined(OS_WIN)
diff --git a/base/file_util_posix.cc b/base/file_util_posix.cc
index f566efb..f3a7553 100644
--- a/base/file_util_posix.cc
+++ b/base/file_util_posix.cc
@@ -623,6 +623,22 @@ bool CreateDirectoryAndGetError(const FilePath& full_path,
return true;
}
+bool NormalizeFilePath(const FilePath& path, FilePath* normalized_path) {
+ FilePath real_path_result;
+ if (!RealPath(path, &real_path_result))
+ return false;
+
+ // To be consistant with windows, fail if |real_path_result| is a
+ // directory.
+ stat_wrapper_t file_info;
+ if (CallStat(real_path_result.value().c_str(), &file_info) != 0 ||
+ S_ISDIR(file_info.st_mode))
+ return false;
+
+ *normalized_path = real_path_result;
+ return true;
+}
+
} // namespace base
// -----------------------------------------------------------------------------
@@ -637,7 +653,6 @@ using base::DirectoryExists;
using base::FileEnumerator;
using base::FilePath;
using base::MakeAbsoluteFilePath;
-using base::RealPath;
using base::VerifySpecificPathControlledByUser;
base::FilePath MakeUniqueDirectory(const base::FilePath& path) {
@@ -804,22 +819,6 @@ bool SetCurrentDirectory(const FilePath& path) {
return !ret;
}
-bool NormalizeFilePath(const FilePath& path, FilePath* normalized_path) {
- FilePath real_path_result;
- if (!RealPath(path, &real_path_result))
- return false;
-
- // To be consistant with windows, fail if |real_path_result| is a
- // directory.
- stat_wrapper_t file_info;
- if (CallStat(real_path_result.value().c_str(), &file_info) != 0 ||
- S_ISDIR(file_info.st_mode))
- return false;
-
- *normalized_path = real_path_result;
- return true;
-}
-
bool VerifyPathControlledByUser(const FilePath& base,
const FilePath& path,
uid_t owner_uid,
diff --git a/base/file_util_unittest.cc b/base/file_util_unittest.cc
index 9289438..0460c6e 100644
--- a/base/file_util_unittest.cc
+++ b/base/file_util_unittest.cc
@@ -250,7 +250,7 @@ TEST_F(FileUtilTest, FileAndDirectorySize) {
FilePath file_01 = temp_dir_.path().Append(FPL("The file 01.txt"));
CreateTextFile(file_01, L"12345678901234567890");
int64 size_f1 = 0;
- ASSERT_TRUE(file_util::GetFileSize(file_01, &size_f1));
+ ASSERT_TRUE(GetFileSize(file_01, &size_f1));
EXPECT_EQ(20ll, size_f1);
FilePath subdir_path = temp_dir_.path().Append(FPL("Level2"));
@@ -259,7 +259,7 @@ TEST_F(FileUtilTest, FileAndDirectorySize) {
FilePath file_02 = subdir_path.Append(FPL("The file 02.txt"));
CreateTextFile(file_02, L"123456789012345678901234567890");
int64 size_f2 = 0;
- ASSERT_TRUE(file_util::GetFileSize(file_02, &size_f2));
+ ASSERT_TRUE(GetFileSize(file_02, &size_f2));
EXPECT_EQ(30ll, size_f2);
FilePath subsubdir_path = subdir_path.Append(FPL("Level3"));
@@ -282,19 +282,16 @@ TEST_F(FileUtilTest, NormalizeFilePathBasic) {
FilePath normalized_file_a_path, normalized_file_b_path;
ASSERT_FALSE(PathExists(file_a_path));
- ASSERT_FALSE(file_util::NormalizeFilePath(file_a_path,
- &normalized_file_a_path))
+ ASSERT_FALSE(NormalizeFilePath(file_a_path, &normalized_file_a_path))
<< "NormalizeFilePath() should fail on nonexistent paths.";
CreateTextFile(file_a_path, bogus_content);
ASSERT_TRUE(PathExists(file_a_path));
- ASSERT_TRUE(file_util::NormalizeFilePath(file_a_path,
- &normalized_file_a_path));
+ ASSERT_TRUE(NormalizeFilePath(file_a_path, &normalized_file_a_path));
CreateTextFile(file_b_path, bogus_content);
ASSERT_TRUE(PathExists(file_b_path));
- ASSERT_TRUE(file_util::NormalizeFilePath(file_b_path,
- &normalized_file_b_path));
+ ASSERT_TRUE(NormalizeFilePath(file_b_path, &normalized_file_b_path));
// Beacuse this test created |dir_path|, we know it is not a link
// or junction. So, the real path of the directory holding file a
@@ -376,18 +373,18 @@ TEST_F(FileUtilTest, NormalizeFilePathReparsePoints) {
ASSERT_TRUE(reparse_to_sub_long.IsValid());
// Normalize a junction free path: base_a\sub_a\file.txt .
- ASSERT_TRUE(file_util::NormalizeFilePath(file_txt, &normalized_path));
+ ASSERT_TRUE(NormalizeFilePath(file_txt, &normalized_path));
ASSERT_STREQ(file_txt.value().c_str(), normalized_path.value().c_str());
// Check that the path base_b\to_sub_a\file.txt can be normalized to exclude
// the junction to_sub_a.
- ASSERT_TRUE(file_util::NormalizeFilePath(to_sub_a.Append(FPL("file.txt")),
+ ASSERT_TRUE(NormalizeFilePath(to_sub_a.Append(FPL("file.txt")),
&normalized_path));
ASSERT_STREQ(file_txt.value().c_str(), normalized_path.value().c_str());
// Check that the path base_b\to_base_b\to_base_b\to_sub_a\file.txt can be
// normalized to exclude junctions to_base_b and to_sub_a .
- ASSERT_TRUE(file_util::NormalizeFilePath(base_b.Append(FPL("to_base_b"))
+ ASSERT_TRUE(NormalizeFilePath(base_b.Append(FPL("to_base_b"))
.Append(FPL("to_base_b"))
.Append(FPL("to_sub_a"))
.Append(FPL("file.txt")),
@@ -405,18 +402,18 @@ TEST_F(FileUtilTest, NormalizeFilePathReparsePoints) {
long_path = long_path.Append(FPL("to_sub_a"))
.Append(FPL("file.txt"));
- ASSERT_FALSE(file_util::NormalizeFilePath(long_path, &normalized_path));
+ ASSERT_FALSE(NormalizeFilePath(long_path, &normalized_path));
// Normalizing the junction to deep.txt should fail, because the expanded
// path to deep.txt is longer than MAX_PATH.
- ASSERT_FALSE(file_util::NormalizeFilePath(to_sub_long.Append(deep_txt),
+ ASSERT_FALSE(NormalizeFilePath(to_sub_long.Append(deep_txt),
&normalized_path));
// Delete the reparse points, and see that NormalizeFilePath() fails
// to traverse them.
}
- ASSERT_FALSE(file_util::NormalizeFilePath(to_sub_a.Append(FPL("file.txt")),
+ ASSERT_FALSE(NormalizeFilePath(to_sub_a.Append(FPL("file.txt")),
&normalized_path));
}
@@ -610,7 +607,7 @@ TEST_F(FileUtilTest, NormalizeFilePathSymlinks) {
// Check that NormalizeFilePath sees the link.
FilePath normalized_path;
- ASSERT_TRUE(file_util::NormalizeFilePath(link_from, &normalized_path));
+ ASSERT_TRUE(NormalizeFilePath(link_from, &normalized_path));
EXPECT_NE(link_from, link_to);
EXPECT_EQ(link_to.BaseName().value(), normalized_path.BaseName().value());
EXPECT_EQ(link_to.BaseName().value(), normalized_path.BaseName().value());
@@ -622,7 +619,7 @@ TEST_F(FileUtilTest, NormalizeFilePathSymlinks) {
ASSERT_TRUE(CreateSymbolicLink(link_to, link_from))
<< "Failed to create directory symlink.";
- EXPECT_FALSE(file_util::NormalizeFilePath(link_from, &normalized_path))
+ EXPECT_FALSE(NormalizeFilePath(link_from, &normalized_path))
<< "Links to directories should return false.";
// Test that a loop in the links causes NormalizeFilePath() to return false.
@@ -634,7 +631,7 @@ TEST_F(FileUtilTest, NormalizeFilePathSymlinks) {
<< "Failed to create loop symlink b.";
// Infinite loop!
- EXPECT_FALSE(file_util::NormalizeFilePath(link_from, &normalized_path));
+ EXPECT_FALSE(NormalizeFilePath(link_from, &normalized_path));
}
#endif // defined(OS_POSIX)
@@ -2318,7 +2315,7 @@ TEST_F(FileUtilTest, ValidContentUriTest) {
ASSERT_TRUE(PathExists(data_dir));
FilePath image_file = data_dir.Append(FILE_PATH_LITERAL("red.png"));
int64 image_size;
- file_util::GetFileSize(image_file, &image_size);
+ GetFileSize(image_file, &image_size);
EXPECT_LT(0, image_size);
// Insert the image into MediaStore. MediaStore will do some conversions, and
@@ -2329,7 +2326,7 @@ TEST_F(FileUtilTest, ValidContentUriTest) {
// The file size may not equal to the input image as MediaStore may convert
// the image.
int64 content_uri_size;
- file_util::GetFileSize(path, &content_uri_size);
+ GetFileSize(path, &content_uri_size);
EXPECT_EQ(image_size, content_uri_size);
// We should be able to read the file.
@@ -2346,7 +2343,7 @@ TEST_F(FileUtilTest, NonExistentContentUriTest) {
EXPECT_FALSE(PathExists(path));
// Size should be smaller than 0.
int64 size;
- EXPECT_FALSE(file_util::GetFileSize(path, &size));
+ EXPECT_FALSE(GetFileSize(path, &size));
// We should not be able to read the file.
int fd = OpenContentUriForRead(path);
diff --git a/base/file_util_win.cc b/base/file_util_win.cc
index be58630..e655204 100644
--- a/base/file_util_win.cc
+++ b/base/file_util_win.cc
@@ -390,6 +390,18 @@ bool CreateDirectoryAndGetError(const FilePath& full_path,
}
}
+bool NormalizeFilePath(const FilePath& path, FilePath* real_path) {
+ ThreadRestrictions::AssertIOAllowed();
+ FilePath mapped_file;
+ if (!file_util::NormalizeToNativeFilePath(path, &mapped_file))
+ return false;
+ // NormalizeToNativeFilePath() will return a path that starts with
+ // "\Device\Harddisk...". Helper DevicePathToDriveLetterPath()
+ // will find a drive letter which maps to the path's device, so
+ // that we return a path starting with a drive letter.
+ return file_util::DevicePathToDriveLetterPath(mapped_file, real_path);
+}
+
} // namespace base
// -----------------------------------------------------------------------------
@@ -547,18 +559,6 @@ bool SetCurrentDirectory(const FilePath& directory) {
return ret != 0;
}
-bool NormalizeFilePath(const FilePath& path, FilePath* real_path) {
- base::ThreadRestrictions::AssertIOAllowed();
- FilePath mapped_file;
- if (!NormalizeToNativeFilePath(path, &mapped_file))
- return false;
- // NormalizeToNativeFilePath() will return a path that starts with
- // "\Device\Harddisk...". Helper DevicePathToDriveLetterPath()
- // will find a drive letter which maps to the path's device, so
- // that we return a path starting with a drive letter.
- return DevicePathToDriveLetterPath(mapped_file, real_path);
-}
-
bool DevicePathToDriveLetterPath(const FilePath& nt_device_path,
FilePath* out_drive_letter_path) {
base::ThreadRestrictions::AssertIOAllowed();
diff --git a/base/files/file_unittest.cc b/base/files/file_unittest.cc
index 178f867..b2e855d 100644
--- a/base/files/file_unittest.cc
+++ b/base/files/file_unittest.cc
@@ -158,7 +158,7 @@ TEST(File, ReadWrite) {
// Make sure the file was extended.
int64 file_size = 0;
- EXPECT_TRUE(file_util::GetFileSize(file_path, &file_size));
+ EXPECT_TRUE(GetFileSize(file_path, &file_size));
EXPECT_EQ(kOffsetBeyondEndOfFile + kPartialWriteLength, file_size);
// Make sure the file was zero-padded.
@@ -240,7 +240,7 @@ TEST(File, Truncate) {
const int kExtendedFileLength = 10;
int64 file_size = 0;
EXPECT_TRUE(file.Truncate(kExtendedFileLength));
- EXPECT_TRUE(file_util::GetFileSize(file_path, &file_size));
+ EXPECT_TRUE(GetFileSize(file_path, &file_size));
EXPECT_EQ(kExtendedFileLength, file_size);
// Make sure the file was zero-padded.
@@ -255,7 +255,7 @@ TEST(File, Truncate) {
// Truncate the file.
const int kTruncatedFileLength = 2;
EXPECT_TRUE(file.Truncate(kTruncatedFileLength));
- EXPECT_TRUE(file_util::GetFileSize(file_path, &file_size));
+ EXPECT_TRUE(GetFileSize(file_path, &file_size));
EXPECT_EQ(kTruncatedFileLength, file_size);
// Make sure the file was truncated.
diff --git a/base/platform_file_unittest.cc b/base/platform_file_unittest.cc
index 0da3cf0..9cf66a9 100644
--- a/base/platform_file_unittest.cc
+++ b/base/platform_file_unittest.cc
@@ -8,151 +8,151 @@
#include "base/time/time.h"
#include "testing/gtest/include/gtest/gtest.h"
-using base::FilePath;
+namespace base {
namespace {
// Reads from a file the given number of bytes, or until EOF is reached.
// Returns the number of bytes read.
-int ReadFully(base::PlatformFile file, int64 offset, char* data, int size) {
- return base::ReadPlatformFile(file, offset, data, size);
+int ReadFully(PlatformFile file, int64 offset, char* data, int size) {
+ return ReadPlatformFile(file, offset, data, size);
}
// Writes the given number of bytes to a file.
// Returns the number of bytes written.
-int WriteFully(base::PlatformFile file, int64 offset,
+int WriteFully(PlatformFile file, int64 offset,
const char* data, int size) {
- return base::WritePlatformFile(file, offset, data, size);
+ return WritePlatformFile(file, offset, data, size);
}
} // namespace
TEST(PlatformFile, CreatePlatformFile) {
- base::ScopedTempDir temp_dir;
+ ScopedTempDir temp_dir;
ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
FilePath file_path = temp_dir.path().AppendASCII("create_file_1");
// Open a file that doesn't exist.
- base::PlatformFileError error_code = base::PLATFORM_FILE_OK;
- base::PlatformFile file = base::CreatePlatformFile(
+ PlatformFileError error_code = PLATFORM_FILE_OK;
+ PlatformFile file = CreatePlatformFile(
file_path,
- base::PLATFORM_FILE_OPEN | base::PLATFORM_FILE_READ,
+ PLATFORM_FILE_OPEN | PLATFORM_FILE_READ,
NULL,
&error_code);
- EXPECT_EQ(base::kInvalidPlatformFileValue, file);
- EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_FOUND, error_code);
+ EXPECT_EQ(kInvalidPlatformFileValue, file);
+ EXPECT_EQ(PLATFORM_FILE_ERROR_NOT_FOUND, error_code);
// Open or create a file.
bool created = false;
- error_code = base::PLATFORM_FILE_OK;
- file = base::CreatePlatformFile(
+ error_code = PLATFORM_FILE_OK;
+ file = CreatePlatformFile(
file_path,
- base::PLATFORM_FILE_OPEN_ALWAYS | base::PLATFORM_FILE_READ,
+ PLATFORM_FILE_OPEN_ALWAYS | PLATFORM_FILE_READ,
&created,
&error_code);
- EXPECT_NE(base::kInvalidPlatformFileValue, file);
+ EXPECT_NE(kInvalidPlatformFileValue, file);
EXPECT_TRUE(created);
- EXPECT_EQ(base::PLATFORM_FILE_OK, error_code);
- base::ClosePlatformFile(file);
+ EXPECT_EQ(PLATFORM_FILE_OK, error_code);
+ ClosePlatformFile(file);
// Open an existing file.
created = false;
- file = base::CreatePlatformFile(
+ file = CreatePlatformFile(
file_path,
- base::PLATFORM_FILE_OPEN | base::PLATFORM_FILE_READ,
+ PLATFORM_FILE_OPEN | PLATFORM_FILE_READ,
&created,
&error_code);
- EXPECT_NE(base::kInvalidPlatformFileValue, file);
+ EXPECT_NE(kInvalidPlatformFileValue, file);
EXPECT_FALSE(created);
- EXPECT_EQ(base::PLATFORM_FILE_OK, error_code);
- base::ClosePlatformFile(file);
+ EXPECT_EQ(PLATFORM_FILE_OK, error_code);
+ ClosePlatformFile(file);
// Create a file that exists.
- file = base::CreatePlatformFile(
+ file = CreatePlatformFile(
file_path,
- base::PLATFORM_FILE_CREATE | base::PLATFORM_FILE_READ,
+ PLATFORM_FILE_CREATE | PLATFORM_FILE_READ,
&created,
&error_code);
- EXPECT_EQ(base::kInvalidPlatformFileValue, file);
+ EXPECT_EQ(kInvalidPlatformFileValue, file);
EXPECT_FALSE(created);
- EXPECT_EQ(base::PLATFORM_FILE_ERROR_EXISTS, error_code);
+ EXPECT_EQ(PLATFORM_FILE_ERROR_EXISTS, error_code);
// Create or overwrite a file.
- error_code = base::PLATFORM_FILE_OK;
- file = base::CreatePlatformFile(
+ error_code = PLATFORM_FILE_OK;
+ file = CreatePlatformFile(
file_path,
- base::PLATFORM_FILE_CREATE_ALWAYS | base::PLATFORM_FILE_READ,
+ PLATFORM_FILE_CREATE_ALWAYS | PLATFORM_FILE_READ,
&created,
&error_code);
- EXPECT_NE(base::kInvalidPlatformFileValue, file);
+ EXPECT_NE(kInvalidPlatformFileValue, file);
EXPECT_TRUE(created);
- EXPECT_EQ(base::PLATFORM_FILE_OK, error_code);
- base::ClosePlatformFile(file);
+ EXPECT_EQ(PLATFORM_FILE_OK, error_code);
+ ClosePlatformFile(file);
// Create a delete-on-close file.
created = false;
file_path = temp_dir.path().AppendASCII("create_file_2");
- file = base::CreatePlatformFile(
+ file = CreatePlatformFile(
file_path,
- base::PLATFORM_FILE_OPEN_ALWAYS | base::PLATFORM_FILE_DELETE_ON_CLOSE |
- base::PLATFORM_FILE_READ,
+ PLATFORM_FILE_OPEN_ALWAYS | PLATFORM_FILE_DELETE_ON_CLOSE |
+ PLATFORM_FILE_READ,
&created,
&error_code);
- EXPECT_NE(base::kInvalidPlatformFileValue, file);
+ EXPECT_NE(kInvalidPlatformFileValue, file);
EXPECT_TRUE(created);
- EXPECT_EQ(base::PLATFORM_FILE_OK, error_code);
+ EXPECT_EQ(PLATFORM_FILE_OK, error_code);
- EXPECT_TRUE(base::ClosePlatformFile(file));
- EXPECT_FALSE(base::PathExists(file_path));
+ EXPECT_TRUE(ClosePlatformFile(file));
+ EXPECT_FALSE(PathExists(file_path));
}
TEST(PlatformFile, DeleteOpenFile) {
- base::ScopedTempDir temp_dir;
+ ScopedTempDir temp_dir;
ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
FilePath file_path = temp_dir.path().AppendASCII("create_file_1");
// Create a file.
bool created = false;
- base::PlatformFileError error_code = base::PLATFORM_FILE_OK;
- base::PlatformFile file = base::CreatePlatformFile(
+ PlatformFileError error_code = PLATFORM_FILE_OK;
+ PlatformFile file = CreatePlatformFile(
file_path,
- base::PLATFORM_FILE_OPEN_ALWAYS | base::PLATFORM_FILE_READ |
- base::PLATFORM_FILE_SHARE_DELETE,
+ PLATFORM_FILE_OPEN_ALWAYS | PLATFORM_FILE_READ |
+ PLATFORM_FILE_SHARE_DELETE,
&created,
&error_code);
- EXPECT_NE(base::kInvalidPlatformFileValue, file);
+ EXPECT_NE(kInvalidPlatformFileValue, file);
EXPECT_TRUE(created);
- EXPECT_EQ(base::PLATFORM_FILE_OK, error_code);
+ EXPECT_EQ(PLATFORM_FILE_OK, error_code);
// Open an existing file and mark it as delete on close.
created = false;
- base::PlatformFile same_file = base::CreatePlatformFile(
+ PlatformFile same_file = CreatePlatformFile(
file_path,
- base::PLATFORM_FILE_OPEN | base::PLATFORM_FILE_DELETE_ON_CLOSE |
- base::PLATFORM_FILE_READ,
+ PLATFORM_FILE_OPEN | PLATFORM_FILE_DELETE_ON_CLOSE |
+ PLATFORM_FILE_READ,
&created,
&error_code);
- EXPECT_NE(base::kInvalidPlatformFileValue, file);
+ EXPECT_NE(kInvalidPlatformFileValue, file);
EXPECT_FALSE(created);
- EXPECT_EQ(base::PLATFORM_FILE_OK, error_code);
+ EXPECT_EQ(PLATFORM_FILE_OK, error_code);
// Close both handles and check that the file is gone.
- base::ClosePlatformFile(file);
- base::ClosePlatformFile(same_file);
- EXPECT_FALSE(base::PathExists(file_path));
+ ClosePlatformFile(file);
+ ClosePlatformFile(same_file);
+ EXPECT_FALSE(PathExists(file_path));
}
TEST(PlatformFile, ReadWritePlatformFile) {
- base::ScopedTempDir temp_dir;
+ ScopedTempDir temp_dir;
ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
FilePath file_path = temp_dir.path().AppendASCII("read_write_file");
- base::PlatformFile file = base::CreatePlatformFile(
+ PlatformFile file = CreatePlatformFile(
file_path,
- base::PLATFORM_FILE_CREATE | base::PLATFORM_FILE_READ |
- base::PLATFORM_FILE_WRITE,
+ PLATFORM_FILE_CREATE | PLATFORM_FILE_READ |
+ PLATFORM_FILE_WRITE,
NULL,
NULL);
- EXPECT_NE(base::kInvalidPlatformFileValue, file);
+ EXPECT_NE(kInvalidPlatformFileValue, file);
char data_to_write[] = "test";
const int kTestDataSize = 4;
@@ -188,7 +188,7 @@ TEST(PlatformFile, ReadWritePlatformFile) {
EXPECT_EQ(data_to_write[i], data_read_1[i]);
// Read again, but using the trivial native wrapper.
- bytes_read = base::ReadPlatformFileNoBestEffort(file, 0, data_read_1,
+ bytes_read = ReadPlatformFileNoBestEffort(file, 0, data_read_1,
kTestDataSize);
EXPECT_LE(bytes_read, kTestDataSize);
for (int i = 0; i < bytes_read; i++)
@@ -203,7 +203,7 @@ TEST(PlatformFile, ReadWritePlatformFile) {
// Make sure the file was extended.
int64 file_size = 0;
- EXPECT_TRUE(file_util::GetFileSize(file_path, &file_size));
+ EXPECT_TRUE(GetFileSize(file_path, &file_size));
EXPECT_EQ(kOffsetBeyondEndOfFile + kPartialWriteLength, file_size);
// Make sure the file was zero-padded.
@@ -218,19 +218,19 @@ TEST(PlatformFile, ReadWritePlatformFile) {
EXPECT_EQ(data_to_write[i - kOffsetBeyondEndOfFile], data_read_2[i]);
// Close the file handle to allow the temp directory to be deleted.
- base::ClosePlatformFile(file);
+ ClosePlatformFile(file);
}
TEST(PlatformFile, AppendPlatformFile) {
- base::ScopedTempDir temp_dir;
+ ScopedTempDir temp_dir;
ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
FilePath file_path = temp_dir.path().AppendASCII("append_file");
- base::PlatformFile file = base::CreatePlatformFile(
+ PlatformFile file = CreatePlatformFile(
file_path,
- base::PLATFORM_FILE_CREATE | base::PLATFORM_FILE_APPEND,
+ PLATFORM_FILE_CREATE | PLATFORM_FILE_APPEND,
NULL,
NULL);
- EXPECT_NE(base::kInvalidPlatformFileValue, file);
+ EXPECT_NE(kInvalidPlatformFileValue, file);
char data_to_write[] = "test";
const int kTestDataSize = 4;
@@ -243,14 +243,14 @@ TEST(PlatformFile, AppendPlatformFile) {
bytes_written = WriteFully(file, 0, data_to_write, kTestDataSize);
EXPECT_EQ(kTestDataSize, bytes_written);
- base::ClosePlatformFile(file);
- file = base::CreatePlatformFile(
+ ClosePlatformFile(file);
+ file = CreatePlatformFile(
file_path,
- base::PLATFORM_FILE_OPEN | base::PLATFORM_FILE_READ |
- base::PLATFORM_FILE_APPEND,
+ PLATFORM_FILE_OPEN | PLATFORM_FILE_READ |
+ PLATFORM_FILE_APPEND,
NULL,
NULL);
- EXPECT_NE(base::kInvalidPlatformFileValue, file);
+ EXPECT_NE(kInvalidPlatformFileValue, file);
char append_data_to_write[] = "78";
const int kAppendDataSize = 2;
@@ -270,21 +270,21 @@ TEST(PlatformFile, AppendPlatformFile) {
EXPECT_EQ(append_data_to_write[i], data_read_1[kTestDataSize + i]);
// Close the file handle to allow the temp directory to be deleted.
- base::ClosePlatformFile(file);
+ ClosePlatformFile(file);
}
TEST(PlatformFile, TruncatePlatformFile) {
- base::ScopedTempDir temp_dir;
+ ScopedTempDir temp_dir;
ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
FilePath file_path = temp_dir.path().AppendASCII("truncate_file");
- base::PlatformFile file = base::CreatePlatformFile(
+ PlatformFile file = CreatePlatformFile(
file_path,
- base::PLATFORM_FILE_CREATE | base::PLATFORM_FILE_READ |
- base::PLATFORM_FILE_WRITE,
+ PLATFORM_FILE_CREATE | PLATFORM_FILE_READ |
+ PLATFORM_FILE_WRITE,
NULL,
NULL);
- EXPECT_NE(base::kInvalidPlatformFileValue, file);
+ EXPECT_NE(kInvalidPlatformFileValue, file);
// Write "test" to the file.
char data_to_write[] = "test";
@@ -295,8 +295,8 @@ TEST(PlatformFile, TruncatePlatformFile) {
// Extend the file.
const int kExtendedFileLength = 10;
int64 file_size = 0;
- EXPECT_TRUE(base::TruncatePlatformFile(file, kExtendedFileLength));
- EXPECT_TRUE(file_util::GetFileSize(file_path, &file_size));
+ EXPECT_TRUE(TruncatePlatformFile(file, kExtendedFileLength));
+ EXPECT_TRUE(GetFileSize(file_path, &file_size));
EXPECT_EQ(kExtendedFileLength, file_size);
// Make sure the file was zero-padded.
@@ -310,8 +310,8 @@ TEST(PlatformFile, TruncatePlatformFile) {
// Truncate the file.
const int kTruncatedFileLength = 2;
- EXPECT_TRUE(base::TruncatePlatformFile(file, kTruncatedFileLength));
- EXPECT_TRUE(file_util::GetFileSize(file_path, &file_size));
+ EXPECT_TRUE(TruncatePlatformFile(file, kTruncatedFileLength));
+ EXPECT_TRUE(GetFileSize(file_path, &file_size));
EXPECT_EQ(kTruncatedFileLength, file_size);
// Make sure the file was truncated.
@@ -321,7 +321,7 @@ TEST(PlatformFile, TruncatePlatformFile) {
EXPECT_EQ(data_to_write[i], data_read[i]);
// Close the file handle to allow the temp directory to be deleted.
- base::ClosePlatformFile(file);
+ ClosePlatformFile(file);
}
// Flakily fails: http://crbug.com/86494
@@ -330,30 +330,30 @@ TEST(PlatformFile, TouchGetInfoPlatformFile) {
#else
TEST(PlatformFile, DISABLED_TouchGetInfoPlatformFile) {
#endif
- base::ScopedTempDir temp_dir;
+ ScopedTempDir temp_dir;
ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
- base::PlatformFile file = base::CreatePlatformFile(
+ PlatformFile file = CreatePlatformFile(
temp_dir.path().AppendASCII("touch_get_info_file"),
- base::PLATFORM_FILE_CREATE | base::PLATFORM_FILE_WRITE |
- base::PLATFORM_FILE_WRITE_ATTRIBUTES,
+ PLATFORM_FILE_CREATE | PLATFORM_FILE_WRITE |
+ PLATFORM_FILE_WRITE_ATTRIBUTES,
NULL,
NULL);
- EXPECT_NE(base::kInvalidPlatformFileValue, file);
+ EXPECT_NE(kInvalidPlatformFileValue, file);
// Get info for a newly created file.
- base::PlatformFileInfo info;
- EXPECT_TRUE(base::GetPlatformFileInfo(file, &info));
+ PlatformFileInfo info;
+ EXPECT_TRUE(GetPlatformFileInfo(file, &info));
// Add 2 seconds to account for possible rounding errors on
// filesystems that use a 1s or 2s timestamp granularity.
- base::Time now = base::Time::Now() + base::TimeDelta::FromSeconds(2);
+ Time now = Time::Now() + TimeDelta::FromSeconds(2);
EXPECT_EQ(0, info.size);
EXPECT_FALSE(info.is_directory);
EXPECT_FALSE(info.is_symbolic_link);
EXPECT_LE(info.last_accessed.ToInternalValue(), now.ToInternalValue());
EXPECT_LE(info.last_modified.ToInternalValue(), now.ToInternalValue());
EXPECT_LE(info.creation_time.ToInternalValue(), now.ToInternalValue());
- base::Time creation_time = info.creation_time;
+ Time creation_time = info.creation_time;
// Write "test" to the file.
char data[] = "test";
@@ -365,16 +365,15 @@ TEST(PlatformFile, DISABLED_TouchGetInfoPlatformFile) {
// It's best to add values that are multiples of 2 (in seconds)
// to the current last_accessed and last_modified times, because
// FATxx uses a 2s timestamp granularity.
- base::Time new_last_accessed =
- info.last_accessed + base::TimeDelta::FromSeconds(234);
- base::Time new_last_modified =
- info.last_modified + base::TimeDelta::FromMinutes(567);
+ Time new_last_accessed =
+ info.last_accessed + TimeDelta::FromSeconds(234);
+ Time new_last_modified =
+ info.last_modified + TimeDelta::FromMinutes(567);
- EXPECT_TRUE(base::TouchPlatformFile(file, new_last_accessed,
- new_last_modified));
+ EXPECT_TRUE(TouchPlatformFile(file, new_last_accessed, new_last_modified));
// Make sure the file info was updated accordingly.
- EXPECT_TRUE(base::GetPlatformFileInfo(file, &info));
+ EXPECT_TRUE(GetPlatformFileInfo(file, &info));
EXPECT_EQ(info.size, kTestDataSize);
EXPECT_FALSE(info.is_directory);
EXPECT_FALSE(info.is_symbolic_link);
@@ -396,39 +395,40 @@ TEST(PlatformFile, DISABLED_TouchGetInfoPlatformFile) {
creation_time.ToInternalValue());
// Close the file handle to allow the temp directory to be deleted.
- base::ClosePlatformFile(file);
+ ClosePlatformFile(file);
}
TEST(PlatformFile, ReadFileAtCurrentPosition) {
- base::ScopedTempDir temp_dir;
+ ScopedTempDir temp_dir;
ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
FilePath file_path =
temp_dir.path().AppendASCII("read_file_at_current_position");
- base::PlatformFile file = base::CreatePlatformFile(
+ PlatformFile file = CreatePlatformFile(
file_path,
- base::PLATFORM_FILE_CREATE | base::PLATFORM_FILE_READ |
- base::PLATFORM_FILE_WRITE,
+ PLATFORM_FILE_CREATE | PLATFORM_FILE_READ |
+ PLATFORM_FILE_WRITE,
NULL, NULL);
- EXPECT_NE(base::kInvalidPlatformFileValue, file);
+ EXPECT_NE(kInvalidPlatformFileValue, file);
const char kData[] = "test";
const int kDataSize = arraysize(kData) - 1;
EXPECT_EQ(kDataSize, WriteFully(file, 0, kData, kDataSize));
- EXPECT_EQ(0, SeekPlatformFile(
- file, base::PLATFORM_FILE_FROM_BEGIN, 0));
+ EXPECT_EQ(0, SeekPlatformFile(file, PLATFORM_FILE_FROM_BEGIN, 0));
char buffer[kDataSize];
int first_chunk_size = kDataSize / 2;
EXPECT_EQ(first_chunk_size,
- base::ReadPlatformFileAtCurrentPos(
+ ReadPlatformFileAtCurrentPos(
file, buffer, first_chunk_size));
EXPECT_EQ(kDataSize - first_chunk_size,
- base::ReadPlatformFileAtCurrentPos(
+ ReadPlatformFileAtCurrentPos(
file, buffer + first_chunk_size,
kDataSize - first_chunk_size));
EXPECT_EQ(std::string(buffer, buffer + kDataSize),
std::string(kData));
- base::ClosePlatformFile(file);
+ ClosePlatformFile(file);
}
+
+} // namespace base
diff --git a/base/test/test_file_util_mac.cc b/base/test/test_file_util_mac.cc
index 3af2c10..d31a9a6 100644
--- a/base/test/test_file_util_mac.cc
+++ b/base/test/test_file_util_mac.cc
@@ -20,7 +20,7 @@ bool EvictFileFromSystemCache(const base::FilePath& file) {
// open should then have to load the file from disk.
int64 length;
- if (!file_util::GetFileSize(file, &length)) {
+ if (!base::GetFileSize(file, &length)) {
DLOG(ERROR) << "failed to get size of " << file.value();
return false;
}
diff --git a/chrome/browser/chromeos/drive/file_cache.cc b/chrome/browser/chromeos/drive/file_cache.cc
index bbdcb56..7b96f93 100644
--- a/chrome/browser/chromeos/drive/file_cache.cc
+++ b/chrome/browser/chromeos/drive/file_cache.cc
@@ -494,7 +494,7 @@ FileError FileCache::StoreInternal(const std::string& id,
int64 file_size = 0;
if (file_operation_type == FILE_OPERATION_COPY) {
- if (!file_util::GetFileSize(source_path, &file_size)) {
+ if (!base::GetFileSize(source_path, &file_size)) {
LOG(WARNING) << "Couldn't get file size for: " << source_path.value();
return FILE_ERROR_FAILED;
}
diff --git a/chrome/browser/chromeos/drive/file_system/copy_operation.cc b/chrome/browser/chromeos/drive/file_system/copy_operation.cc
index bd2564f..19a6ddd 100644
--- a/chrome/browser/chromeos/drive/file_system/copy_operation.cc
+++ b/chrome/browser/chromeos/drive/file_system/copy_operation.cc
@@ -54,7 +54,7 @@ FileError PrepareCopy(internal::ResourceMetadata* metadata,
int64 GetFileSize(const base::FilePath& file_path) {
int64 file_size;
- if (!file_util::GetFileSize(file_path, &file_size))
+ if (!base::GetFileSize(file_path, &file_size))
return -1;
return file_size;
}
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 726885c..633ad79 100644
--- a/chrome/browser/chromeos/drive/file_system/download_operation_unittest.cc
+++ b/chrome/browser/chromeos/drive/file_system/download_operation_unittest.cc
@@ -356,7 +356,7 @@ TEST_F(DownloadOperationTest,
// The content is available from the cache file.
EXPECT_TRUE(get_content_callback.data().empty());
int64 local_file_size = 0;
- file_util::GetFileSize(local_path, &local_file_size);
+ base::GetFileSize(local_path, &local_file_size);
EXPECT_EQ(entry->file_info().size(), local_file_size);
EXPECT_EQ(FILE_ERROR_OK, completion_error);
}
diff --git a/chrome/browser/chromeos/drive/file_system/get_file_for_saving_operation_unittest.cc b/chrome/browser/chromeos/drive/file_system/get_file_for_saving_operation_unittest.cc
index 814e767..ba9eb93 100644
--- a/chrome/browser/chromeos/drive/file_system/get_file_for_saving_operation_unittest.cc
+++ b/chrome/browser/chromeos/drive/file_system/get_file_for_saving_operation_unittest.cc
@@ -136,7 +136,7 @@ TEST_F(GetFileForSavingOperationTest, GetFileForSaving_NotExist) {
EXPECT_EQ(FILE_ERROR_OK, error);
EXPECT_EQ(FILE_ERROR_OK, GetLocalResourceEntry(drive_path, &src_entry));
int64 size = -1;
- EXPECT_TRUE(file_util::GetFileSize(local_path, &size));
+ EXPECT_TRUE(base::GetFileSize(local_path, &size));
EXPECT_EQ(0, size);
}
diff --git a/chrome/browser/chromeos/drive/file_system/open_file_operation_unittest.cc b/chrome/browser/chromeos/drive/file_system/open_file_operation_unittest.cc
index 5a1becf..2a34827 100644
--- a/chrome/browser/chromeos/drive/file_system/open_file_operation_unittest.cc
+++ b/chrome/browser/chromeos/drive/file_system/open_file_operation_unittest.cc
@@ -53,7 +53,7 @@ TEST_F(OpenFileOperationTest, OpenExistingFile) {
EXPECT_EQ(FILE_ERROR_OK, error);
ASSERT_TRUE(base::PathExists(file_path));
int64 local_file_size;
- ASSERT_TRUE(file_util::GetFileSize(file_path, &local_file_size));
+ ASSERT_TRUE(base::GetFileSize(file_path, &local_file_size));
EXPECT_EQ(file_size, local_file_size);
ASSERT_FALSE(close_callback.is_null());
@@ -123,7 +123,7 @@ TEST_F(OpenFileOperationTest, CreateNonExistingFile) {
EXPECT_EQ(FILE_ERROR_OK, error);
ASSERT_TRUE(base::PathExists(file_path));
int64 local_file_size;
- ASSERT_TRUE(file_util::GetFileSize(file_path, &local_file_size));
+ ASSERT_TRUE(base::GetFileSize(file_path, &local_file_size));
EXPECT_EQ(0, local_file_size); // Should be an empty file.
ASSERT_FALSE(close_callback.is_null());
@@ -158,7 +158,7 @@ TEST_F(OpenFileOperationTest, OpenOrCreateExistingFile) {
EXPECT_EQ(FILE_ERROR_OK, error);
ASSERT_TRUE(base::PathExists(file_path));
int64 local_file_size;
- ASSERT_TRUE(file_util::GetFileSize(file_path, &local_file_size));
+ ASSERT_TRUE(base::GetFileSize(file_path, &local_file_size));
EXPECT_EQ(file_size, local_file_size);
ASSERT_FALSE(close_callback.is_null());
@@ -201,7 +201,7 @@ TEST_F(OpenFileOperationTest, OpenOrCreateNonExistingFile) {
EXPECT_EQ(FILE_ERROR_OK, error);
ASSERT_TRUE(base::PathExists(file_path));
int64 local_file_size;
- ASSERT_TRUE(file_util::GetFileSize(file_path, &local_file_size));
+ ASSERT_TRUE(base::GetFileSize(file_path, &local_file_size));
EXPECT_EQ(0, local_file_size); // Should be an empty file.
ASSERT_FALSE(close_callback.is_null());
@@ -232,7 +232,7 @@ TEST_F(OpenFileOperationTest, OpenFileTwice) {
EXPECT_EQ(FILE_ERROR_OK, error);
ASSERT_TRUE(base::PathExists(file_path));
int64 local_file_size;
- ASSERT_TRUE(file_util::GetFileSize(file_path, &local_file_size));
+ ASSERT_TRUE(base::GetFileSize(file_path, &local_file_size));
EXPECT_EQ(file_size, local_file_size);
// Open again.
@@ -248,7 +248,7 @@ TEST_F(OpenFileOperationTest, OpenFileTwice) {
EXPECT_EQ(FILE_ERROR_OK, error);
ASSERT_TRUE(base::PathExists(file_path));
- ASSERT_TRUE(file_util::GetFileSize(file_path, &local_file_size));
+ ASSERT_TRUE(base::GetFileSize(file_path, &local_file_size));
EXPECT_EQ(file_size, local_file_size);
ASSERT_FALSE(close_callback.is_null());
diff --git a/chrome/browser/chromeos/drive/file_system/truncate_operation_unittest.cc b/chrome/browser/chromeos/drive/file_system/truncate_operation_unittest.cc
index 7d48c66..ce9312a 100644
--- a/chrome/browser/chromeos/drive/file_system/truncate_operation_unittest.cc
+++ b/chrome/browser/chromeos/drive/file_system/truncate_operation_unittest.cc
@@ -60,7 +60,7 @@ TEST_F(TruncateOperationTest, Truncate) {
// The local file should be truncated.
int64 local_file_size = 0;
- file_util::GetFileSize(local_path, &local_file_size);
+ base::GetFileSize(local_path, &local_file_size);
EXPECT_EQ(1, local_file_size);
}
diff --git a/chrome/browser/chromeos/drive/file_system_util.cc b/chrome/browser/chromeos/drive/file_system_util.cc
index 48b70cc..aae3cdf 100644
--- a/chrome/browser/chromeos/drive/file_system_util.cc
+++ b/chrome/browser/chromeos/drive/file_system_util.cc
@@ -72,7 +72,7 @@ std::string ReadStringFromGDocFile(const base::FilePath& file_path,
const std::string& key) {
const int64 kMaxGDocSize = 4096;
int64 file_size = 0;
- if (!file_util::GetFileSize(file_path, &file_size) ||
+ if (!base::GetFileSize(file_path, &file_size) ||
file_size > kMaxGDocSize) {
LOG(WARNING) << "File too large to be a GDoc file " << file_path.value();
return std::string();
diff --git a/chrome/browser/chromeos/extensions/install_limiter.cc b/chrome/browser/chromeos/extensions/install_limiter.cc
index 3b7b3fe..d60bc28 100644
--- a/chrome/browser/chromeos/extensions/install_limiter.cc
+++ b/chrome/browser/chromeos/extensions/install_limiter.cc
@@ -25,7 +25,7 @@ int64 GetFileSizeOnBlockingPool(const base::FilePath& file) {
// Get file size. In case of error, sets 0 as file size to let the installer
// run and fail.
int64 size;
- return file_util::GetFileSize(file, &size) ? size : 0;
+ return base::GetFileSize(file, &size) ? size : 0;
}
} // namespace
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 323baec..cf9eeb3 100644
--- a/chrome/browser/chromeos/policy/user_cloud_policy_store_chromeos.cc
+++ b/chrome/browser/chromeos/policy/user_cloud_policy_store_chromeos.cc
@@ -499,7 +499,7 @@ void UserCloudPolicyStoreChromeOS::LoadPolicyKey(const base::FilePath& path,
}
int64 size;
- if (!file_util::GetFileSize(path, &size)) {
+ if (!base::GetFileSize(path, &size)) {
LOG(ERROR) << "Could not get size of " << path.value();
} else if (size == 0 || size > kKeySizeLimit) {
LOG(ERROR) << "Key at " << path.value() << " has bad size " << size;
diff --git a/chrome/browser/chromeos/settings/owner_key_util.cc b/chrome/browser/chromeos/settings/owner_key_util.cc
index 2b333d1..560a6ce 100644
--- a/chrome/browser/chromeos/settings/owner_key_util.cc
+++ b/chrome/browser/chromeos/settings/owner_key_util.cc
@@ -39,7 +39,7 @@ OwnerKeyUtilImpl::~OwnerKeyUtilImpl() {}
bool OwnerKeyUtilImpl::ImportPublicKey(std::vector<uint8>* output) {
// Get the file size (must fit in a 32 bit int for NSS).
int64 file_size;
- if (!file_util::GetFileSize(key_file_, &file_size)) {
+ if (!base::GetFileSize(key_file_, &file_size)) {
LOG(ERROR) << "Could not get size of " << key_file_.value();
return false;
}
diff --git a/chrome/browser/diagnostics/recon_diagnostics.cc b/chrome/browser/diagnostics/recon_diagnostics.cc
index 185c9e2..fb1f7e5 100644
--- a/chrome/browser/diagnostics/recon_diagnostics.cc
+++ b/chrome/browser/diagnostics/recon_diagnostics.cc
@@ -191,7 +191,7 @@ class JSONTest : public DiagnosticsTest {
return true;
}
int64 file_size;
- if (!file_util::GetFileSize(path_, &file_size)) {
+ if (!base::GetFileSize(path_, &file_size)) {
RecordFailure(DIAG_RECON_CANNOT_OBTAIN_FILE_SIZE,
"Cannot obtain file size");
return true;
@@ -312,7 +312,7 @@ class PathTest : public DiagnosticsTest {
if (path_info_.is_directory) {
dir_or_file_size = base::ComputeDirectorySize(dir_or_file);
} else {
- file_util::GetFileSize(dir_or_file, &dir_or_file_size);
+ base::GetFileSize(dir_or_file, &dir_or_file_size);
}
if (!dir_or_file_size && !path_info_.is_optional) {
RecordFailure(DIAG_RECON_CANNOT_OBTAIN_SIZE,
diff --git a/chrome/browser/download/download_browsertest.cc b/chrome/browser/download/download_browsertest.cc
index db477ee..9f95079 100644
--- a/chrome/browser/download/download_browsertest.cc
+++ b/chrome/browser/download/download_browsertest.cc
@@ -677,7 +677,7 @@ class DownloadTest : public InProcessBrowserTest {
return false;
int64 origin_file_size = 0;
- EXPECT_TRUE(file_util::GetFileSize(origin_file, &origin_file_size));
+ EXPECT_TRUE(base::GetFileSize(origin_file, &origin_file_size));
std::string original_file_contents;
EXPECT_TRUE(base::ReadFileToString(origin_file, &original_file_contents));
EXPECT_TRUE(
@@ -1470,7 +1470,7 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, DownloadTest_IncognitoRegular) {
"downloads/a_zip_file.zip"))));
ASSERT_TRUE(base::PathExists(origin));
int64 origin_file_size = 0;
- EXPECT_TRUE(file_util::GetFileSize(origin, &origin_file_size));
+ EXPECT_TRUE(base::GetFileSize(origin, &origin_file_size));
std::string original_contents;
EXPECT_TRUE(base::ReadFileToString(origin, &original_contents));
@@ -3046,7 +3046,7 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, MAYBE_DownloadTest_PercentComplete) {
// Check that the file downloaded correctly.
ASSERT_TRUE(base::PathExists(download_items[0]->GetTargetFilePath()));
int64 downloaded_size = 0;
- ASSERT_TRUE(file_util::GetFileSize(
+ ASSERT_TRUE(base::GetFileSize(
download_items[0]->GetTargetFilePath(), &downloaded_size));
#if defined(OS_WIN)
ASSERT_EQ(1, downloaded_size);
diff --git a/chrome/browser/download/save_page_browsertest.cc b/chrome/browser/download/save_page_browsertest.cc
index 5f75f65..7f61669 100644
--- a/chrome/browser/download/save_page_browsertest.cc
+++ b/chrome/browser/download/save_page_browsertest.cc
@@ -789,7 +789,7 @@ IN_PROC_BROWSER_TEST_F(SavePageAsMHTMLBrowserTest, SavePageAsMHTML) {
ASSERT_TRUE(base::PathExists(full_file_name));
int64 actual_file_size = -1;
- EXPECT_TRUE(file_util::GetFileSize(full_file_name, &actual_file_size));
+ EXPECT_TRUE(base::GetFileSize(full_file_name, &actual_file_size));
EXPECT_LE(kFileSizeMin, actual_file_size);
}
diff --git a/chrome/browser/drive/drive_uploader.cc b/chrome/browser/drive/drive_uploader.cc
index b849e6f..7398297 100644
--- a/chrome/browser/drive/drive_uploader.cc
+++ b/chrome/browser/drive/drive_uploader.cc
@@ -214,7 +214,7 @@ CancelCallback DriveUploader::StartUploadFile(
base::PostTaskAndReplyWithResult(
blocking_task_runner_.get(),
FROM_HERE,
- base::Bind(&file_util::GetFileSize,
+ base::Bind(&base::GetFileSize,
info_ptr->file_path,
&info_ptr->content_length),
base::Bind(&DriveUploader::StartUploadFileAfterGetFileSize,
diff --git a/chrome/browser/extensions/api/image_writer_private/operation_linux.cc b/chrome/browser/extensions/api/image_writer_private/operation_linux.cc
index 8250363..e54b524 100644
--- a/chrome/browser/extensions/api/image_writer_private/operation_linux.cc
+++ b/chrome/browser/extensions/api/image_writer_private/operation_linux.cc
@@ -173,7 +173,7 @@ void Operation::VerifyWriteStage2(
int64 image_size;
scoped_ptr<base::FilePath> device_path(new base::FilePath(storage_unit_id_));
- if (!file_util::GetFileSize(image_path_, &image_size)){
+ if (!base::GetFileSize(image_path_, &image_size)){
Error(error::kImageSize);
return;
}
diff --git a/chrome/browser/extensions/api/media_galleries/media_galleries_apitest.cc b/chrome/browser/extensions/api/media_galleries/media_galleries_apitest.cc
index a048d1f..e5a53cc 100644
--- a/chrome/browser/extensions/api/media_galleries/media_galleries_apitest.cc
+++ b/chrome/browser/extensions/api/media_galleries/media_galleries_apitest.cc
@@ -155,8 +155,8 @@ class MediaGalleriesPlatformAppBrowserTest : public PlatformAppBrowserTest {
write_path.AppendASCII("test.txt")));
int64 file_size;
- ASSERT_TRUE(file_util::GetFileSize(test_data_path.AppendASCII("test.jpg"),
- &file_size));
+ ASSERT_TRUE(base::GetFileSize(test_data_path.AppendASCII("test.jpg"),
+ &file_size));
test_jpg_size_ = base::checked_numeric_cast<int>(file_size);
}
diff --git a/chrome/browser/extensions/sandboxed_unpacker.cc b/chrome/browser/extensions/sandboxed_unpacker.cc
index 8fd15ef..48c9230 100644
--- a/chrome/browser/extensions/sandboxed_unpacker.cc
+++ b/chrome/browser/extensions/sandboxed_unpacker.cc
@@ -72,7 +72,7 @@ void RecordSuccessfulUnpackTimeHistograms(
// To get a sense of how CRX size impacts unpack time, record unpack
// time for several increments of CRX size.
int64 crx_file_size;
- if (!file_util::GetFileSize(crx_path, &crx_file_size)) {
+ if (!base::GetFileSize(crx_path, &crx_file_size)) {
UMA_HISTOGRAM_COUNTS("Extensions.SandboxUnpackSuccessCantGetCrxSize", 1);
return;
}
@@ -135,8 +135,7 @@ bool VerifyJunctionFreeLocation(base::FilePath* temp_dir) {
return false;
base::FilePath normalized_temp_file;
- bool normalized =
- file_util::NormalizeFilePath(temp_file, &normalized_temp_file);
+ bool normalized = base::NormalizeFilePath(temp_file, &normalized_temp_file);
if (!normalized) {
// If |temp_file| contains a link, the sandbox will block al file system
// operations, and the install will fail.
@@ -293,7 +292,7 @@ void SandboxedUnpacker::Start() {
// will cause file system access outside the sandbox path, and the sandbox
// will deny the operation.
base::FilePath link_free_crx_path;
- if (!file_util::NormalizeFilePath(temp_crx_path, &link_free_crx_path)) {
+ if (!base::NormalizeFilePath(temp_crx_path, &link_free_crx_path)) {
LOG(ERROR) << "Could not get the normalized path of "
<< temp_crx_path.value();
ReportFailure(
diff --git a/chrome/browser/history/history_database.cc b/chrome/browser/history/history_database.cc
index 1f26b7e..40eb634 100644
--- a/chrome/browser/history/history_database.cc
+++ b/chrome/browser/history/history_database.cc
@@ -106,7 +106,7 @@ void HistoryDatabase::ComputeDatabaseMetrics(
const base::FilePath& history_name) {
base::TimeTicks start_time = base::TimeTicks::Now();
int64 file_size = 0;
- if (!file_util::GetFileSize(history_name, &file_size))
+ if (!base::GetFileSize(history_name, &file_size))
return;
int file_mb = static_cast<int>(file_size / (1024 * 1024));
UMA_HISTOGRAM_MEMORY_MB("History.DatabaseFileMB", file_mb);
diff --git a/chrome/browser/history/thumbnail_database.cc b/chrome/browser/history/thumbnail_database.cc
index 91253e3..46a182d 100644
--- a/chrome/browser/history/thumbnail_database.cc
+++ b/chrome/browser/history/thumbnail_database.cc
@@ -452,7 +452,7 @@ void RecoverDatabaseOrRaze(sql::Connection* db, const base::FilePath& db_path) {
size_t favicon_bitmaps_rows_recovered = 0;
size_t icon_mapping_rows_recovered = 0;
int64 original_size = 0;
- file_util::GetFileSize(db_path, &original_size);
+ base::GetFileSize(db_path, &original_size);
scoped_ptr<sql::Recovery> recovery = sql::Recovery::Begin(db, db_path);
if (!recovery) {
@@ -524,7 +524,7 @@ void RecoverDatabaseOrRaze(sql::Connection* db, const base::FilePath& db_path) {
// percentage results are very low, something is awry.
int64 final_size = 0;
if (original_size > 0 &&
- file_util::GetFileSize(db_path, &final_size) &&
+ base::GetFileSize(db_path, &final_size) &&
final_size > 0) {
int percentage = static_cast<int>(original_size * 100 / final_size);
UMA_HISTOGRAM_PERCENTAGE("History.FaviconsRecoveredPercentage",
@@ -627,7 +627,7 @@ void RecoverDatabaseOrRaze(sql::Connection* db, const base::FilePath& db_path) {
// percentage results are very low, something is awry.
int64 final_size = 0;
if (original_size > 0 &&
- file_util::GetFileSize(db_path, &final_size) &&
+ base::GetFileSize(db_path, &final_size) &&
final_size > 0) {
int percentage = static_cast<int>(original_size * 100 / final_size);
UMA_HISTOGRAM_PERCENTAGE("History.FaviconsRecoveredPercentage",
@@ -1241,7 +1241,7 @@ sql::InitStatus ThumbnailDatabase::OpenDatabase(sql::Connection* db,
const base::FilePath& db_name) {
size_t startup_kb = 0;
int64 size_64;
- if (file_util::GetFileSize(db_name, &size_64))
+ if (base::GetFileSize(db_name, &size_64))
startup_kb = static_cast<size_t>(size_64 / 1024);
db->set_histogram_tag("Thumbnail");
diff --git a/chrome/browser/net/net_log_temp_file_unittest.cc b/chrome/browser/net/net_log_temp_file_unittest.cc
index 6c414e82..78f55d1 100644
--- a/chrome/browser/net/net_log_temp_file_unittest.cc
+++ b/chrome/browser/net/net_log_temp_file_unittest.cc
@@ -95,8 +95,8 @@ class NetLogTempFileTest : public ::testing::Test {
EXPECT_TRUE(base::PathExists(net_export_log_));
int64 file_size;
- // file_util::GetFileSize returns proper file size on open handles.
- EXPECT_TRUE(file_util::GetFileSize(net_export_log_, &file_size));
+ // base::GetFileSize returns proper file size on open handles.
+ EXPECT_TRUE(base::GetFileSize(net_export_log_, &file_size));
EXPECT_GT(file_size, 0);
}
@@ -221,13 +221,13 @@ TEST_F(NetLogTempFileTest, DoStartClearsFile) {
VerifyFileAndStateAfterDoStart();
int64 start_file_size;
- EXPECT_TRUE(file_util::GetFileSize(net_export_log_, &start_file_size));
+ EXPECT_TRUE(base::GetFileSize(net_export_log_, &start_file_size));
net_log_temp_file_->ProcessCommand(NetLogTempFile::DO_STOP);
VerifyFileAndStateAfterDoStop();
int64 stop_file_size;
- EXPECT_TRUE(file_util::GetFileSize(net_export_log_, &stop_file_size));
+ EXPECT_TRUE(base::GetFileSize(net_export_log_, &stop_file_size));
EXPECT_GE(stop_file_size, start_file_size);
// Add some junk at the end of the file.
@@ -236,7 +236,7 @@ TEST_F(NetLogTempFileTest, DoStartClearsFile) {
net_export_log_, junk_data.c_str(), junk_data.size()), 0);
int64 junk_file_size;
- EXPECT_TRUE(file_util::GetFileSize(net_export_log_, &junk_file_size));
+ EXPECT_TRUE(base::GetFileSize(net_export_log_, &junk_file_size));
EXPECT_GT(junk_file_size, stop_file_size);
// Execute DO_START/DO_STOP commands and make sure the file is back to the
@@ -245,14 +245,14 @@ TEST_F(NetLogTempFileTest, DoStartClearsFile) {
VerifyFileAndStateAfterDoStart();
int64 new_start_file_size;
- EXPECT_TRUE(file_util::GetFileSize(net_export_log_, &new_start_file_size));
+ EXPECT_TRUE(base::GetFileSize(net_export_log_, &new_start_file_size));
EXPECT_EQ(new_start_file_size, start_file_size);
net_log_temp_file_->ProcessCommand(NetLogTempFile::DO_STOP);
VerifyFileAndStateAfterDoStop();
int64 new_stop_file_size;
- EXPECT_TRUE(file_util::GetFileSize(net_export_log_, &new_stop_file_size));
+ EXPECT_TRUE(base::GetFileSize(net_export_log_, &new_stop_file_size));
EXPECT_EQ(new_stop_file_size, stop_file_size);
}
@@ -267,7 +267,7 @@ TEST_F(NetLogTempFileTest, CheckAddEvent) {
VerifyFileAndStateAfterDoStop();
int64 stop_file_size;
- EXPECT_TRUE(file_util::GetFileSize(net_export_log_, &stop_file_size));
+ EXPECT_TRUE(base::GetFileSize(net_export_log_, &stop_file_size));
// Perform DO_START and add an Event and then DO_STOP and then compare
// file sizes.
@@ -281,6 +281,6 @@ TEST_F(NetLogTempFileTest, CheckAddEvent) {
VerifyFileAndStateAfterDoStop();
int64 new_stop_file_size;
- EXPECT_TRUE(file_util::GetFileSize(net_export_log_, &new_stop_file_size));
+ EXPECT_TRUE(base::GetFileSize(net_export_log_, &new_stop_file_size));
EXPECT_GE(new_stop_file_size, stop_file_size);
}
diff --git a/chrome/browser/net/sqlite_server_bound_cert_store.cc b/chrome/browser/net/sqlite_server_bound_cert_store.cc
index 88daa5d..fbac4c3 100644
--- a/chrome/browser/net/sqlite_server_bound_cert_store.cc
+++ b/chrome/browser/net/sqlite_server_bound_cert_store.cc
@@ -197,7 +197,7 @@ void SQLiteServerBoundCertStore::Backend::LoadOnDBThread(
return;
int64 db_size = 0;
- if (file_util::GetFileSize(path_, &db_size))
+ if (base::GetFileSize(path_, &db_size))
UMA_HISTOGRAM_COUNTS("DomainBoundCerts.DBSizeInKB", db_size / 1024 );
db_.reset(new sql::Connection);
diff --git a/chrome/browser/parsers/metadata_parser_filebase.cc b/chrome/browser/parsers/metadata_parser_filebase.cc
index 17e3f5b..bf78fcf 100644
--- a/chrome/browser/parsers/metadata_parser_filebase.cc
+++ b/chrome/browser/parsers/metadata_parser_filebase.cc
@@ -18,7 +18,7 @@ FileMetadataParser::~FileMetadataParser() {}
bool FileMetadataParser::Parse() {
std::string value;
int64 size;
- if (file_util::GetFileSize(path_, &size)) {
+ if (base::GetFileSize(path_, &size)) {
properties_[MetadataParser::kPropertyFilesize] = base::Int64ToString(size);
}
#if defined(OS_WIN)
diff --git a/chrome/browser/parsers/metadata_parser_filebase_unittest.cc b/chrome/browser/parsers/metadata_parser_filebase_unittest.cc
index 16bfc2a..312ab5a 100644
--- a/chrome/browser/parsers/metadata_parser_filebase_unittest.cc
+++ b/chrome/browser/parsers/metadata_parser_filebase_unittest.cc
@@ -40,7 +40,7 @@ class FileMetaDataParserTest : public testing::Test {
std::string test_file_size() {
int64 size;
- EXPECT_TRUE(file_util::GetFileSize(test_file_, &size));
+ EXPECT_TRUE(base::GetFileSize(test_file_, &size));
return base::Int64ToString(size);
}
diff --git a/chrome/browser/performance_monitor/performance_monitor_browsertest.cc b/chrome/browser/performance_monitor/performance_monitor_browsertest.cc
index e549bfd..0fa6655 100644
--- a/chrome/browser/performance_monitor/performance_monitor_browsertest.cc
+++ b/chrome/browser/performance_monitor/performance_monitor_browsertest.cc
@@ -758,12 +758,12 @@ IN_PROC_BROWSER_TEST_F(PerformanceMonitorBrowserTest, NetworkBytesRead) {
PathService::Get(chrome::DIR_TEST_DATA, &test_dir);
int64 page1_size = 0;
- ASSERT_TRUE(file_util::GetFileSize(test_dir.AppendASCII("title1.html"),
- &page1_size));
+ ASSERT_TRUE(base::GetFileSize(test_dir.AppendASCII("title1.html"),
+ &page1_size));
int64 page2_size = 0;
- ASSERT_TRUE(file_util::GetFileSize(test_dir.AppendASCII("title2.html"),
- &page2_size));
+ ASSERT_TRUE(base::GetFileSize(test_dir.AppendASCII("title2.html"),
+ &page2_size));
ASSERT_TRUE(test_server()->Start());
diff --git a/chrome/browser/predictors/predictor_database.cc b/chrome/browser/predictors/predictor_database.cc
index a9db8a3..d04f00e 100644
--- a/chrome/browser/predictors/predictor_database.cc
+++ b/chrome/browser/predictors/predictor_database.cc
@@ -112,7 +112,7 @@ void PredictorDatabaseInternal::LogDatabaseStats() {
CHECK(BrowserThread::CurrentlyOn(BrowserThread::DB));
int64 db_size;
- bool success = file_util::GetFileSize(db_path_, &db_size);
+ bool success = base::GetFileSize(db_path_, &db_size);
DCHECK(success) << "Failed to get file size for " << db_path_.value();
UMA_HISTOGRAM_MEMORY_KB("PredictorDatabase.DatabaseSizeKB",
static_cast<int>(db_size / 1024));
diff --git a/chrome/browser/printing/print_dialog_cloud.cc b/chrome/browser/printing/print_dialog_cloud.cc
index d7b75f7..6559a2f 100644
--- a/chrome/browser/printing/print_dialog_cloud.cc
+++ b/chrome/browser/printing/print_dialog_cloud.cc
@@ -644,7 +644,7 @@ void CreateDialogForFileImpl(content::BrowserContext* browser_context,
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
scoped_refptr<base::RefCountedMemory> data;
int64 file_size = 0;
- if (file_util::GetFileSize(path_to_file, &file_size) && file_size != 0) {
+ if (base::GetFileSize(path_to_file, &file_size) && file_size != 0) {
std::string file_data;
if (file_size < kuint32max) {
file_data.reserve(static_cast<unsigned int>(file_size));
diff --git a/chrome/browser/profiles/file_path_verifier_win.cc b/chrome/browser/profiles/file_path_verifier_win.cc
index 8626e0a..44d34a4 100644
--- a/chrome/browser/profiles/file_path_verifier_win.cc
+++ b/chrome/browser/profiles/file_path_verifier_win.cc
@@ -28,7 +28,7 @@ FileVerificationResult VerifyFileAtPath(const base::FilePath& file) {
FileVerificationResult file_verification_result =
FILE_VERIFICATION_FAILED_UNKNOWN;
base::FilePath normalized_path;
- if (!file_util::NormalizeFilePath(file, &normalized_path)) {
+ if (!base::NormalizeFilePath(file, &normalized_path)) {
if (::GetLastError() == ERROR_FILE_NOT_FOUND)
file_verification_result = FILE_VERIFICATION_FILE_NOT_FOUND;
else
diff --git a/chrome/browser/safe_browsing/prefix_set.cc b/chrome/browser/safe_browsing/prefix_set.cc
index 4216c51..e3100c7 100644
--- a/chrome/browser/safe_browsing/prefix_set.cc
+++ b/chrome/browser/safe_browsing/prefix_set.cc
@@ -154,7 +154,7 @@ void PrefixSet::GetPrefixes(std::vector<SBPrefix>* prefixes) const {
// static
PrefixSet* PrefixSet::LoadFile(const base::FilePath& filter_name) {
int64 size_64;
- if (!file_util::GetFileSize(filter_name, &size_64))
+ if (!base::GetFileSize(filter_name, &size_64))
return NULL;
using base::MD5Digest;
if (size_64 < static_cast<int64>(sizeof(FileHeader) + sizeof(MD5Digest)))
diff --git a/chrome/browser/safe_browsing/prefix_set_unittest.cc b/chrome/browser/safe_browsing/prefix_set_unittest.cc
index c76447a..10865e9 100644
--- a/chrome/browser/safe_browsing/prefix_set_unittest.cc
+++ b/chrome/browser/safe_browsing/prefix_set_unittest.cc
@@ -149,7 +149,7 @@ class PrefixSetTest : public PlatformTest {
void ModifyAndCleanChecksum(const base::FilePath& filename, long offset,
int inc) {
int64 size_64;
- ASSERT_TRUE(file_util::GetFileSize(filename, &size_64));
+ ASSERT_TRUE(base::GetFileSize(filename, &size_64));
file_util::ScopedFILE file(file_util::OpenFile(filename, "r+b"));
IncrementIntAt(file.get(), offset, inc);
@@ -157,7 +157,7 @@ class PrefixSetTest : public PlatformTest {
file.reset();
int64 new_size_64;
- ASSERT_TRUE(file_util::GetFileSize(filename, &new_size_64));
+ ASSERT_TRUE(base::GetFileSize(filename, &new_size_64));
ASSERT_EQ(new_size_64, size_64);
}
@@ -457,7 +457,7 @@ TEST_F(PrefixSetTest, CorruptionDigest) {
ASSERT_TRUE(GetPrefixSetFile(&filename));
int64 size_64;
- ASSERT_TRUE(file_util::GetFileSize(filename, &size_64));
+ ASSERT_TRUE(base::GetFileSize(filename, &size_64));
file_util::ScopedFILE file(file_util::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));
diff --git a/chrome/browser/safe_browsing/safe_browsing_database.cc b/chrome/browser/safe_browsing/safe_browsing_database.cc
index ba270ce..8aa5dad 100644
--- a/chrome/browser/safe_browsing/safe_browsing_database.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_database.cc
@@ -330,7 +330,7 @@ bool SBAddFullHashPrefixLess(const SBAddFullHash& a, const SBAddFullHash& b) {
// that less verbose.
int64 GetFileSizeOrZero(const base::FilePath& file_path) {
int64 size_64;
- if (!file_util::GetFileSize(file_path, &size_64))
+ if (!base::GetFileSize(file_path, &size_64))
return 0;
return size_64;
}
diff --git a/chrome/browser/safe_browsing/safe_browsing_store_file.cc b/chrome/browser/safe_browsing/safe_browsing_store_file.cc
index 10442c4..3500819 100644
--- a/chrome/browser/safe_browsing/safe_browsing_store_file.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_store_file.cc
@@ -135,7 +135,7 @@ void DeleteChunksFromSet(const base::hash_set<int32>& deleted,
bool FileHeaderSanityCheck(const base::FilePath& filename,
const FileHeader& header) {
int64 size = 0;
- if (!file_util::GetFileSize(filename, &size))
+ if (!base::GetFileSize(filename, &size))
return false;
int64 expected_size = sizeof(FileHeader);
@@ -181,7 +181,7 @@ void SafeBrowsingStoreFile::CheckForOriginalAndDelete(
current_filename.DirName().AppendASCII("Safe Browsing"));
if (base::PathExists(original_filename)) {
int64 size = 0;
- if (file_util::GetFileSize(original_filename, &size)) {
+ if (base::GetFileSize(original_filename, &size)) {
UMA_HISTOGRAM_COUNTS("SB2.OldDatabaseKilobytes",
static_cast<int>(size / 1024));
}
@@ -230,7 +230,7 @@ bool SafeBrowsingStoreFile::CheckValidity() {
return OnCorruptDatabase();
int64 size = 0;
- if (!file_util::GetFileSize(filename_, &size))
+ if (!base::GetFileSize(filename_, &size))
return OnCorruptDatabase();
base::MD5Context context;
@@ -547,7 +547,7 @@ bool SafeBrowsingStoreFile::DoUpdate(
// Get chunk file's size for validating counts.
int64 size = 0;
- if (!file_util::GetFileSize(TemporaryFileForFilename(filename_), &size))
+ if (!base::GetFileSize(TemporaryFileForFilename(filename_), &size))
return OnCorruptDatabase();
// Track update size to answer questions at http://crbug.com/72216 .
diff --git a/chrome/browser/sessions/session_backend.cc b/chrome/browser/sessions/session_backend.cc
index 8faed00..ca12051 100644
--- a/chrome/browser/sessions/session_backend.cc
+++ b/chrome/browser/sessions/session_backend.cc
@@ -278,7 +278,7 @@ void SessionBackend::MoveCurrentSessionToLastSession() {
base::DeleteFile(last_session_path, false);
if (base::PathExists(current_session_path)) {
int64 file_size;
- if (file_util::GetFileSize(current_session_path, &file_size)) {
+ if (base::GetFileSize(current_session_path, &file_size)) {
if (type_ == BaseSessionService::TAB_RESTORE) {
UMA_HISTOGRAM_COUNTS("TabRestore.last_session_file_size",
static_cast<int>(file_size / 1024));
diff --git a/chrome/browser/ui/network_profile_bubble.cc b/chrome/browser/ui/network_profile_bubble.cc
index 491a9e7..7e3d385 100644
--- a/chrome/browser/ui/network_profile_bubble.cc
+++ b/chrome/browser/ui/network_profile_bubble.cc
@@ -1,5 +1,4 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
+// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/ui/network_profile_bubble.h"
@@ -130,7 +129,7 @@ void NetworkProfileBubble::CheckNetworkProfile(
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))
+ if (!base::NormalizeFilePath(temp_file, &normalized_temp_file))
profile_on_network = true;
} else {
RecordUmaEvent(METRIC_CHECK_IO_FAILED);
diff --git a/chrome/common/extensions/extension_file_util.cc b/chrome/common/extensions/extension_file_util.cc
index 82982b0..f401b92 100644
--- a/chrome/common/extensions/extension_file_util.cc
+++ b/chrome/common/extensions/extension_file_util.cc
@@ -228,7 +228,7 @@ std::vector<base::FilePath> FindPrivateKeyFiles(
bool ValidateFilePath(const base::FilePath& path) {
int64 size = 0;
if (!base::PathExists(path) ||
- !file_util::GetFileSize(path, &size) ||
+ !base::GetFileSize(path, &size) ||
size == 0) {
return false;
}
diff --git a/chrome/installer/tools/validate_installation_main.cc b/chrome/installer/tools/validate_installation_main.cc
index 8c5069fd..65cb42a 100644
--- a/chrome/installer/tools/validate_installation_main.cc
+++ b/chrome/installer/tools/validate_installation_main.cc
@@ -80,7 +80,7 @@ ConsoleLogHelper::~ConsoleLogHelper() {
// Delete the log file if it wasn't written to (this is expected).
int64 file_size = 0;
- if (file_util::GetFileSize(log_file_path_, &file_size) && file_size == 0)
+ if (base::GetFileSize(log_file_path_, &file_size) && file_size == 0)
base::DeleteFile(log_file_path_, false);
}
diff --git a/chrome/installer/util/logging_installer.cc b/chrome/installer/util/logging_installer.cc
index 15b3d72..3ac60b3 100644
--- a/chrome/installer/util/logging_installer.cc
+++ b/chrome/installer/util/logging_installer.cc
@@ -34,7 +34,7 @@ TruncateResult TruncateLogFileIfNeeded(const base::FilePath& log_file) {
TruncateResult result = LOGFILE_UNTOUCHED;
int64 log_size = 0;
- if (file_util::GetFileSize(log_file, &log_size) &&
+ if (base::GetFileSize(log_file, &log_size) &&
log_size > kMaxInstallerLogFileSize) {
// Cause the old log file to be deleted when we are done with it.
const int file_flags = base::PLATFORM_FILE_OPEN |
diff --git a/chrome/installer/util/logging_installer_unittest.cc b/chrome/installer/util/logging_installer_unittest.cc
index c605be6..7bc1c45 100644
--- a/chrome/installer/util/logging_installer_unittest.cc
+++ b/chrome/installer/util/logging_installer_unittest.cc
@@ -24,13 +24,13 @@ TEST(LoggingInstallerTest, TestTruncate) {
ASSERT_TRUE(base::PathExists(temp_file));
int64 file_size = 0;
- EXPECT_TRUE(file_util::GetFileSize(temp_file, &file_size));
+ EXPECT_TRUE(base::GetFileSize(temp_file, &file_size));
EXPECT_EQ(test_data.size(), file_size);
EXPECT_EQ(installer::LOGFILE_TRUNCATED,
installer::TruncateLogFileIfNeeded(temp_file));
- EXPECT_TRUE(file_util::GetFileSize(temp_file, &file_size));
+ EXPECT_TRUE(base::GetFileSize(temp_file, &file_size));
EXPECT_EQ(installer::kTruncatedInstallerLogFileSize , file_size);
// Check that the temporary file was deleted.
@@ -49,13 +49,13 @@ TEST(LoggingInstallerTest, TestTruncationNotNeeded) {
ASSERT_TRUE(base::PathExists(temp_file));
int64 file_size = 0;
- EXPECT_TRUE(file_util::GetFileSize(temp_file, &file_size));
+ EXPECT_TRUE(base::GetFileSize(temp_file, &file_size));
EXPECT_EQ(test_data.size(), file_size);
EXPECT_EQ(installer::LOGFILE_UNTOUCHED,
installer::TruncateLogFileIfNeeded(temp_file));
EXPECT_TRUE(base::PathExists(temp_file));
- EXPECT_TRUE(file_util::GetFileSize(temp_file, &file_size));
+ EXPECT_TRUE(base::GetFileSize(temp_file, &file_size));
EXPECT_EQ(test_data.size(), file_size);
}
@@ -70,7 +70,7 @@ TEST(LoggingInstallerTest, TestInUseNeedsTruncation) {
file_util::WriteFile(temp_file, &test_data[0], test_data.size()));
ASSERT_TRUE(base::PathExists(temp_file));
int64 file_size = 0;
- EXPECT_TRUE(file_util::GetFileSize(temp_file, &file_size));
+ EXPECT_TRUE(base::GetFileSize(temp_file, &file_size));
EXPECT_EQ(test_data.size(), file_size);
// Prevent the log file from being moved or deleted.
@@ -84,7 +84,7 @@ TEST(LoggingInstallerTest, TestInUseNeedsTruncation) {
EXPECT_EQ(installer::LOGFILE_UNTOUCHED,
installer::TruncateLogFileIfNeeded(temp_file));
EXPECT_TRUE(base::PathExists(temp_file));
- EXPECT_TRUE(file_util::GetFileSize(temp_file, &file_size));
+ EXPECT_TRUE(base::GetFileSize(temp_file, &file_size));
EXPECT_EQ(test_data.size(), file_size);
}
@@ -99,7 +99,7 @@ TEST(LoggingInstallerTest, TestMoveFailsNeedsTruncation) {
file_util::WriteFile(temp_file, &test_data[0], test_data.size()));
ASSERT_TRUE(base::PathExists(temp_file));
int64 file_size = 0;
- EXPECT_TRUE(file_util::GetFileSize(temp_file, &file_size));
+ EXPECT_TRUE(base::GetFileSize(temp_file, &file_size));
EXPECT_EQ(test_data.size(), file_size);
// Create an inconvenient, non-deletable file in the location that
diff --git a/chrome_frame/test/perf/chrome_frame_perftest.cc b/chrome_frame/test/perf/chrome_frame_perftest.cc
index 5f1a0f1..80cef10 100644
--- a/chrome_frame/test/perf/chrome_frame_perftest.cc
+++ b/chrome_frame/test/perf/chrome_frame_perftest.cc
@@ -959,7 +959,7 @@ TEST(ImagePreReader, PreReadImage) {
ASSERT_TRUE(PathService::Get(base::FILE_EXE, &current_exe));
int64 file_size_64 = 0;
- ASSERT_TRUE(file_util::GetFileSize(current_exe, &file_size_64));
+ ASSERT_TRUE(base::GetFileSize(current_exe, &file_size_64));
ASSERT_TRUE(file_size_64 < std::numeric_limits<std::size_t>::max());
size_t file_size = static_cast<size_t>(file_size_64);
diff --git a/cloud_print/virtual_driver/win/port_monitor/port_monitor.cc b/cloud_print/virtual_driver/win/port_monitor/port_monitor.cc
index 4432404..a68c29e 100644
--- a/cloud_print/virtual_driver/win/port_monitor/port_monitor.cc
+++ b/cloud_print/virtual_driver/win/port_monitor/port_monitor.cc
@@ -482,7 +482,7 @@ BOOL WINAPI Monitor2EndDocPort(HANDLE port_handle) {
port_data->file = NULL;
bool delete_file = true;
int64 file_size = 0;
- file_util::GetFileSize(port_data->file_path, &file_size);
+ base::GetFileSize(port_data->file_path, &file_size);
if (file_size > 0) {
string16 job_title;
if (port_data->printer_handle != NULL) {
diff --git a/components/breakpad/browser/crash_dump_manager_android.cc b/components/breakpad/browser/crash_dump_manager_android.cc
index 2aa5d40..75d03b2 100644
--- a/components/breakpad/browser/crash_dump_manager_android.cc
+++ b/components/breakpad/browser/crash_dump_manager_android.cc
@@ -86,7 +86,7 @@ void CrashDumpManager::ProcessMinidump(const base::FilePath& minidump_path,
base::ProcessHandle pid) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
int64 file_size = 0;
- int r = file_util::GetFileSize(minidump_path, &file_size);
+ int r = base::GetFileSize(minidump_path, &file_size);
DCHECK(r) << "Failed to retrieve size for minidump "
<< minidump_path.value();
diff --git a/content/browser/download/download_file_unittest.cc b/content/browser/download/download_file_unittest.cc
index e46babc..1418086 100644
--- a/content/browser/download/download_file_unittest.cc
+++ b/content/browser/download/download_file_unittest.cc
@@ -195,7 +195,7 @@ class DownloadFileTest : public testing::Test {
void VerifyStreamAndSize() {
::testing::Mock::VerifyAndClearExpectations(input_stream_);
int64 size;
- EXPECT_TRUE(file_util::GetFileSize(download_file_->FullPath(), &size));
+ EXPECT_TRUE(base::GetFileSize(download_file_->FullPath(), &size));
EXPECT_EQ(expected_data_.size(), static_cast<size_t>(size));
}
diff --git a/content/browser/download/mhtml_generation_browsertest.cc b/content/browser/download/mhtml_generation_browsertest.cc
index 6e79013..11a0851 100644
--- a/content/browser/download/mhtml_generation_browsertest.cc
+++ b/content/browser/download/mhtml_generation_browsertest.cc
@@ -66,7 +66,7 @@ IN_PROC_BROWSER_TEST_F(MHTMLGenerationTest, GenerateMHTML) {
// Make sure the actual generated file has some contents.
int64 file_size;
- ASSERT_TRUE(file_util::GetFileSize(path, &file_size));
+ ASSERT_TRUE(base::GetFileSize(path, &file_size));
EXPECT_GT(file_size, 100);
}
diff --git a/content/browser/fileapi/obfuscated_file_util_unittest.cc b/content/browser/fileapi/obfuscated_file_util_unittest.cc
index 4f3727d..72dd360 100644
--- a/content/browser/fileapi/obfuscated_file_util_unittest.cc
+++ b/content/browser/fileapi/obfuscated_file_util_unittest.cc
@@ -44,7 +44,7 @@ bool FileExists(const base::FilePath& path) {
int64 GetSize(const base::FilePath& path) {
int64 size;
- EXPECT_TRUE(file_util::GetFileSize(path, &size));
+ EXPECT_TRUE(base::GetFileSize(path, &size));
return size;
}
diff --git a/content/browser/indexed_db/indexed_db_browsertest.cc b/content/browser/indexed_db/indexed_db_browsertest.cc
index 74b81b6..e979168 100644
--- a/content/browser/indexed_db/indexed_db_browsertest.cc
+++ b/content/browser/indexed_db/indexed_db_browsertest.cc
@@ -342,7 +342,7 @@ IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, LevelDBLogFileTest) {
base::FilePath log_file_path =
GetContext()->data_path().Append(leveldb_dir).Append(log_file);
int64 size;
- EXPECT_TRUE(file_util::GetFileSize(log_file_path, &size));
+ EXPECT_TRUE(base::GetFileSize(log_file_path, &size));
EXPECT_GT(size, 0);
}
diff --git a/content/browser/net/sqlite_persistent_cookie_store.cc b/content/browser/net/sqlite_persistent_cookie_store.cc
index e03d9ba..a337733 100644
--- a/content/browser/net/sqlite_persistent_cookie_store.cc
+++ b/content/browser/net/sqlite_persistent_cookie_store.cc
@@ -549,7 +549,7 @@ bool SQLitePersistentCookieStore::Backend::InitializeDatabase() {
}
int64 db_size = 0;
- if (file_util::GetFileSize(path_, &db_size))
+ if (base::GetFileSize(path_, &db_size))
UMA_HISTOGRAM_COUNTS("Cookie.DBSizeInKB", db_size / 1024 );
db_.reset(new sql::Connection);
diff --git a/content/browser/tracing/tracing_controller_browsertest.cc b/content/browser/tracing/tracing_controller_browsertest.cc
index 6b2cc35..bccf90a 100644
--- a/content/browser/tracing/tracing_controller_browsertest.cc
+++ b/content/browser/tracing/tracing_controller_browsertest.cc
@@ -51,7 +51,7 @@ class TracingControllerTest : public ContentBrowserTest {
disable_recording_done_callback_count_++;
EXPECT_TRUE(PathExists(file_path));
int64 file_size;
- file_util::GetFileSize(file_path, &file_size);
+ base::GetFileSize(file_path, &file_size);
EXPECT_TRUE(file_size > 0);
quit_callback.Run();
last_actual_recording_file_path_ = file_path;
@@ -72,7 +72,7 @@ class TracingControllerTest : public ContentBrowserTest {
capture_monitoring_snapshot_done_callback_count_++;
EXPECT_TRUE(PathExists(file_path));
int64 file_size;
- file_util::GetFileSize(file_path, &file_size);
+ base::GetFileSize(file_path, &file_size);
EXPECT_TRUE(file_size > 0);
quit_callback.Run();
last_actual_monitoring_file_path_ = file_path;
diff --git a/content/common/mac/font_loader.mm b/content/common/mac/font_loader.mm
index 6ecb7ca..d919680 100644
--- a/content/common/mac/font_loader.mm
+++ b/content/common/mac/font_loader.mm
@@ -124,7 +124,7 @@ void FontLoader::LoadFont(const FontDescriptor& font,
// Load file into shared memory buffer.
int64 font_file_size_64 = -1;
- if (!file_util::GetFileSize(font_path, &font_file_size_64)) {
+ if (!base::GetFileSize(font_path, &font_file_size_64)) {
DLOG(ERROR) << "Couldn't get font file size for " << font_path.value();
return;
}
diff --git a/content/common/plugin_list_posix.cc b/content/common/plugin_list_posix.cc
index abc74ba..47856b3 100644
--- a/content/common/plugin_list_posix.cc
+++ b/content/common/plugin_list_posix.cc
@@ -108,7 +108,7 @@ bool IsBlacklistedBySha1sumAndQuirks(const base::FilePath& path) {
};
int64 size;
- if (!file_util::GetFileSize(path, &size))
+ if (!base::GetFileSize(path, &size))
return false;
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(bad_entries); i++) {
if (bad_entries[i].size != size)
diff --git a/content/renderer/media/media_stream_audio_processor_unittest.cc b/content/renderer/media/media_stream_audio_processor_unittest.cc
index 2d20ded..79311c8 100644
--- a/content/renderer/media/media_stream_audio_processor_unittest.cc
+++ b/content/renderer/media/media_stream_audio_processor_unittest.cc
@@ -45,7 +45,7 @@ void ReadDataFromSpeechFile(char* data, int length) {
.Append(FILE_PATH_LITERAL("speech_16b_stereo_48kHz.raw"));
DCHECK(base::PathExists(file));
int64 data_file_size64 = 0;
- DCHECK(file_util::GetFileSize(file, &data_file_size64));
+ DCHECK(base::GetFileSize(file, &data_file_size64));
EXPECT_EQ(length, file_util::ReadFile(file, data, length));
DCHECK(data_file_size64 > length);
}
diff --git a/content/renderer/media/webrtc_audio_device_unittest.cc b/content/renderer/media/webrtc_audio_device_unittest.cc
index a79176e..5e111a5 100644
--- a/content/renderer/media/webrtc_audio_device_unittest.cc
+++ b/content/renderer/media/webrtc_audio_device_unittest.cc
@@ -295,7 +295,7 @@ void ReadDataFromSpeechFile(char* data, int length) {
.Append(FILE_PATH_LITERAL("speech_16b_stereo_48kHz.raw"));
DCHECK(base::PathExists(data_file));
int64 data_file_size64 = 0;
- DCHECK(file_util::GetFileSize(data_file, &data_file_size64));
+ DCHECK(base::GetFileSize(data_file, &data_file_size64));
EXPECT_EQ(length, file_util::ReadFile(data_file, data, length));
DCHECK(data_file_size64 > length);
}
diff --git a/content/test/image_decoder_test.cc b/content/test/image_decoder_test.cc
index 13b3608..351d491 100644
--- a/content/test/image_decoder_test.cc
+++ b/content/test/image_decoder_test.cc
@@ -31,7 +31,7 @@ bool ShouldSkipFile(const base::FilePath& path,
return false;
int64 image_size = 0;
- file_util::GetFileSize(path, &image_size);
+ base::GetFileSize(path, &image_size);
return (file_selection == TEST_SMALLER) == (image_size > threshold);
}
diff --git a/content/test/weburl_loader_mock_factory.cc b/content/test/weburl_loader_mock_factory.cc
index 791ae1e..38a9d50 100644
--- a/content/test/weburl_loader_mock_factory.cc
+++ b/content/test/weburl_loader_mock_factory.cc
@@ -176,7 +176,7 @@ bool WebURLLoaderMockFactory::IsPending(WebURLLoaderMock* loader) {
bool WebURLLoaderMockFactory::ReadFile(const base::FilePath& file_path,
WebData* data) {
int64 file_size = 0;
- if (!file_util::GetFileSize(file_path, &file_size))
+ if (!base::GetFileSize(file_path, &file_size))
return false;
int size = static_cast<int>(file_size);
diff --git a/courgette/courgette_tool.cc b/courgette/courgette_tool.cc
index a487ce9..3b5b5e6 100644
--- a/courgette/courgette_tool.cc
+++ b/courgette/courgette_tool.cc
@@ -49,7 +49,7 @@ void Problem(const char* format, ...) {
std::string ReadOrFail(const base::FilePath& file_name, const char* kind) {
int64 file_size = 0;
- if (!file_util::GetFileSize(file_name, &file_size))
+ if (!base::GetFileSize(file_name, &file_size))
Problem("Can't read %s file.", kind);
std::string buffer;
buffer.reserve(static_cast<size_t>(file_size));
diff --git a/media/base/container_names_unittest.cc b/media/base/container_names_unittest.cc
index 21f80af..0cd2c3c 100644
--- a/media/base/container_names_unittest.cc
+++ b/media/base/container_names_unittest.cc
@@ -109,7 +109,7 @@ void TestFile(MediaContainerName expected, const base::FilePath& filename) {
// so use file length if file less than 8192 bytes (http://crbug.com/243885).
int read_size = sizeof(buffer);
int64 actual_size;
- if (file_util::GetFileSize(filename, &actual_size) && actual_size < read_size)
+ if (base::GetFileSize(filename, &actual_size) && actual_size < read_size)
read_size = actual_size;
int read = file_util::ReadFile(filename, buffer, read_size);
diff --git a/media/base/test_data_util.cc b/media/base/test_data_util.cc
index 55e82fc86..b60bf77 100644
--- a/media/base/test_data_util.cc
+++ b/media/base/test_data_util.cc
@@ -30,7 +30,7 @@ scoped_refptr<DecoderBuffer> ReadTestDataFile(const std::string& name) {
.AppendASCII(name);
int64 tmp = 0;
- CHECK(file_util::GetFileSize(file_path, &tmp))
+ CHECK(base::GetFileSize(file_path, &tmp))
<< "Failed to get file size for '" << name << "'";
int file_size = static_cast<int>(tmp);
diff --git a/media/base/yuv_convert_unittest.cc b/media/base/yuv_convert_unittest.cc
index 21a82f1..f1504ba 100644
--- a/media/base/yuv_convert_unittest.cc
+++ b/media/base/yuv_convert_unittest.cc
@@ -51,7 +51,7 @@ static void ReadData(const base::FilePath::CharType* filename,
// Verify file size is correct.
int64 actual_size = 0;
- file_util::GetFileSize(path, &actual_size);
+ base::GetFileSize(path, &actual_size);
CHECK_EQ(actual_size, expected_size);
// Verify bytes read are correct.
diff --git a/net/base/file_stream_unittest.cc b/net/base/file_stream_unittest.cc
index 95e9ebd..6f35985 100644
--- a/net/base/file_stream_unittest.cc
+++ b/net/base/file_stream_unittest.cc
@@ -225,7 +225,7 @@ TEST_F(FileStreamTest, UseClosedStream) {
TEST_F(FileStreamTest, BasicRead) {
int64 file_size;
- bool ok = file_util::GetFileSize(temp_file_path(), &file_size);
+ bool ok = base::GetFileSize(temp_file_path(), &file_size);
EXPECT_TRUE(ok);
FileStream stream(NULL, base::MessageLoopProxy::current());
@@ -255,7 +255,7 @@ TEST_F(FileStreamTest, BasicRead) {
TEST_F(FileStreamTest, AsyncRead) {
int64 file_size;
- bool ok = file_util::GetFileSize(temp_file_path(), &file_size);
+ bool ok = base::GetFileSize(temp_file_path(), &file_size);
EXPECT_TRUE(ok);
FileStream stream(NULL, base::MessageLoopProxy::current());
@@ -290,7 +290,7 @@ TEST_F(FileStreamTest, AsyncRead) {
TEST_F(FileStreamTest, AsyncRead_EarlyDelete) {
int64 file_size;
- bool ok = file_util::GetFileSize(temp_file_path(), &file_size);
+ bool ok = base::GetFileSize(temp_file_path(), &file_size);
EXPECT_TRUE(ok);
scoped_ptr<FileStream> stream(
@@ -321,7 +321,7 @@ TEST_F(FileStreamTest, AsyncRead_EarlyDelete) {
TEST_F(FileStreamTest, BasicRead_FromOffset) {
int64 file_size;
- bool ok = file_util::GetFileSize(temp_file_path(), &file_size);
+ bool ok = base::GetFileSize(temp_file_path(), &file_size);
EXPECT_TRUE(ok);
FileStream stream(NULL, base::MessageLoopProxy::current());
@@ -356,7 +356,7 @@ TEST_F(FileStreamTest, BasicRead_FromOffset) {
TEST_F(FileStreamTest, AsyncRead_FromOffset) {
int64 file_size;
- bool ok = file_util::GetFileSize(temp_file_path(), &file_size);
+ bool ok = base::GetFileSize(temp_file_path(), &file_size);
EXPECT_TRUE(ok);
FileStream stream(NULL, base::MessageLoopProxy::current());
@@ -464,7 +464,7 @@ TEST_F(FileStreamTest, BasicWrite) {
EXPECT_EQ(OK, rv);
int64 file_size;
- bool ok = file_util::GetFileSize(temp_file_path(), &file_size);
+ bool ok = base::GetFileSize(temp_file_path(), &file_size);
EXPECT_TRUE(ok);
EXPECT_EQ(0, file_size);
@@ -472,7 +472,7 @@ TEST_F(FileStreamTest, BasicWrite) {
EXPECT_EQ(kTestDataSize, rv);
stream.reset();
- ok = file_util::GetFileSize(temp_file_path(), &file_size);
+ ok = base::GetFileSize(temp_file_path(), &file_size);
EXPECT_TRUE(ok);
EXPECT_EQ(kTestDataSize, file_size);
}
@@ -488,7 +488,7 @@ TEST_F(FileStreamTest, AsyncWrite) {
EXPECT_EQ(OK, callback.WaitForResult());
int64 file_size;
- bool ok = file_util::GetFileSize(temp_file_path(), &file_size);
+ bool ok = base::GetFileSize(temp_file_path(), &file_size);
EXPECT_TRUE(ok);
EXPECT_EQ(0, file_size);
@@ -508,7 +508,7 @@ TEST_F(FileStreamTest, AsyncWrite) {
drainable->DidConsume(rv);
total_bytes_written += rv;
}
- ok = file_util::GetFileSize(temp_file_path(), &file_size);
+ ok = base::GetFileSize(temp_file_path(), &file_size);
EXPECT_TRUE(ok);
EXPECT_EQ(file_size, total_bytes_written);
}
@@ -525,7 +525,7 @@ TEST_F(FileStreamTest, AsyncWrite_EarlyDelete) {
EXPECT_EQ(OK, callback.WaitForResult());
int64 file_size;
- bool ok = file_util::GetFileSize(temp_file_path(), &file_size);
+ bool ok = base::GetFileSize(temp_file_path(), &file_size);
EXPECT_TRUE(ok);
EXPECT_EQ(0, file_size);
@@ -538,7 +538,7 @@ TEST_F(FileStreamTest, AsyncWrite_EarlyDelete) {
base::RunLoop().RunUntilIdle();
EXPECT_FALSE(callback.have_result());
} else {
- ok = file_util::GetFileSize(temp_file_path(), &file_size);
+ ok = base::GetFileSize(temp_file_path(), &file_size);
EXPECT_TRUE(ok);
EXPECT_EQ(file_size, rv);
}
@@ -553,7 +553,7 @@ TEST_F(FileStreamTest, BasicWrite_FromOffset) {
EXPECT_EQ(OK, rv);
int64 file_size;
- bool ok = file_util::GetFileSize(temp_file_path(), &file_size);
+ bool ok = base::GetFileSize(temp_file_path(), &file_size);
EXPECT_TRUE(ok);
EXPECT_EQ(kTestDataSize, file_size);
@@ -565,14 +565,14 @@ TEST_F(FileStreamTest, BasicWrite_FromOffset) {
EXPECT_EQ(kTestDataSize, rv);
stream.reset();
- ok = file_util::GetFileSize(temp_file_path(), &file_size);
+ ok = base::GetFileSize(temp_file_path(), &file_size);
EXPECT_TRUE(ok);
EXPECT_EQ(kTestDataSize * 2, file_size);
}
TEST_F(FileStreamTest, AsyncWrite_FromOffset) {
int64 file_size;
- bool ok = file_util::GetFileSize(temp_file_path(), &file_size);
+ bool ok = base::GetFileSize(temp_file_path(), &file_size);
EXPECT_TRUE(ok);
FileStream stream(NULL, base::MessageLoopProxy::current());
@@ -607,14 +607,14 @@ TEST_F(FileStreamTest, AsyncWrite_FromOffset) {
drainable->DidConsume(rv);
total_bytes_written += rv;
}
- ok = file_util::GetFileSize(temp_file_path(), &file_size);
+ ok = base::GetFileSize(temp_file_path(), &file_size);
EXPECT_TRUE(ok);
EXPECT_EQ(file_size, kTestDataSize * 2);
}
TEST_F(FileStreamTest, BasicReadWrite) {
int64 file_size;
- bool ok = file_util::GetFileSize(temp_file_path(), &file_size);
+ bool ok = base::GetFileSize(temp_file_path(), &file_size);
EXPECT_TRUE(ok);
scoped_ptr<FileStream> stream(
@@ -647,14 +647,14 @@ TEST_F(FileStreamTest, BasicReadWrite) {
EXPECT_EQ(kTestDataSize, rv);
stream.reset();
- ok = file_util::GetFileSize(temp_file_path(), &file_size);
+ ok = base::GetFileSize(temp_file_path(), &file_size);
EXPECT_TRUE(ok);
EXPECT_EQ(kTestDataSize * 2, file_size);
}
TEST_F(FileStreamTest, BasicWriteRead) {
int64 file_size;
- bool ok = file_util::GetFileSize(temp_file_path(), &file_size);
+ bool ok = base::GetFileSize(temp_file_path(), &file_size);
EXPECT_TRUE(ok);
scoped_ptr<FileStream> stream(
@@ -691,7 +691,7 @@ TEST_F(FileStreamTest, BasicWriteRead) {
}
stream.reset();
- ok = file_util::GetFileSize(temp_file_path(), &file_size);
+ ok = base::GetFileSize(temp_file_path(), &file_size);
EXPECT_TRUE(ok);
EXPECT_EQ(kTestDataSize * 2, file_size);
EXPECT_EQ(kTestDataSize * 2, total_bytes_read);
@@ -703,7 +703,7 @@ TEST_F(FileStreamTest, BasicWriteRead) {
TEST_F(FileStreamTest, BasicAsyncReadWrite) {
int64 file_size;
- bool ok = file_util::GetFileSize(temp_file_path(), &file_size);
+ bool ok = base::GetFileSize(temp_file_path(), &file_size);
EXPECT_TRUE(ok);
scoped_ptr<FileStream> stream(
@@ -756,14 +756,14 @@ TEST_F(FileStreamTest, BasicAsyncReadWrite) {
stream.reset();
- ok = file_util::GetFileSize(temp_file_path(), &file_size);
+ ok = base::GetFileSize(temp_file_path(), &file_size);
EXPECT_TRUE(ok);
EXPECT_EQ(kTestDataSize * 2, file_size);
}
TEST_F(FileStreamTest, BasicAsyncWriteRead) {
int64 file_size;
- bool ok = file_util::GetFileSize(temp_file_path(), &file_size);
+ bool ok = base::GetFileSize(temp_file_path(), &file_size);
EXPECT_TRUE(ok);
scoped_ptr<FileStream> stream(
@@ -826,7 +826,7 @@ TEST_F(FileStreamTest, BasicAsyncWriteRead) {
}
stream.reset();
- ok = file_util::GetFileSize(temp_file_path(), &file_size);
+ ok = base::GetFileSize(temp_file_path(), &file_size);
EXPECT_TRUE(ok);
EXPECT_EQ(kTestDataSize * 2, file_size);
@@ -930,7 +930,7 @@ class TestWriteReadCompletionCallback {
TEST_F(FileStreamTest, AsyncWriteRead) {
int64 file_size;
- bool ok = file_util::GetFileSize(temp_file_path(), &file_size);
+ bool ok = base::GetFileSize(temp_file_path(), &file_size);
EXPECT_TRUE(ok);
scoped_ptr<FileStream> stream(
@@ -965,7 +965,7 @@ TEST_F(FileStreamTest, AsyncWriteRead) {
stream.reset();
- ok = file_util::GetFileSize(temp_file_path(), &file_size);
+ ok = base::GetFileSize(temp_file_path(), &file_size);
EXPECT_TRUE(ok);
EXPECT_EQ(kTestDataSize * 2, file_size);
@@ -1040,7 +1040,7 @@ class TestWriteCloseCompletionCallback {
TEST_F(FileStreamTest, AsyncWriteClose) {
int64 file_size;
- bool ok = file_util::GetFileSize(temp_file_path(), &file_size);
+ bool ok = base::GetFileSize(temp_file_path(), &file_size);
EXPECT_TRUE(ok);
scoped_ptr<FileStream> stream(
@@ -1072,7 +1072,7 @@ TEST_F(FileStreamTest, AsyncWriteClose) {
stream.reset();
- ok = file_util::GetFileSize(temp_file_path(), &file_size);
+ ok = base::GetFileSize(temp_file_path(), &file_size);
EXPECT_TRUE(ok);
EXPECT_EQ(kTestDataSize * 2, file_size);
}
@@ -1193,7 +1193,7 @@ TEST_F(FileStreamTest, ContentUriAsyncRead) {
EXPECT_TRUE(path.IsContentUri());
EXPECT_TRUE(base::PathExists(path));
int64 file_size;
- EXPECT_TRUE(file_util::GetFileSize(path, &file_size));
+ EXPECT_TRUE(base::GetFileSize(path, &file_size));
EXPECT_LT(0, file_size);
FileStream stream(NULL, base::MessageLoopProxy::current());
diff --git a/net/base/upload_file_element_reader.cc b/net/base/upload_file_element_reader.cc
index 77c7705..e7bf0c12 100644
--- a/net/base/upload_file_element_reader.cc
+++ b/net/base/upload_file_element_reader.cc
@@ -46,7 +46,7 @@ int InitInternal(const base::FilePath& path,
}
int64 length = 0;
- if (!file_util::GetFileSize(path, &length)) {
+ if (!base::GetFileSize(path, &length)) {
DLOG(WARNING) << "Failed to get file size of \"" << path.value() << "\"";
return ERR_FILE_NOT_FOUND;
}
diff --git a/net/dns/dns_hosts.cc b/net/dns/dns_hosts.cc
index 3edea2a..2fb627e 100644
--- a/net/dns/dns_hosts.cc
+++ b/net/dns/dns_hosts.cc
@@ -147,7 +147,7 @@ bool ParseHostsFile(const base::FilePath& path, DnsHosts* dns_hosts) {
return true;
int64 size;
- if (!file_util::GetFileSize(path, &size))
+ if (!base::GetFileSize(path, &size))
return false;
UMA_HISTOGRAM_COUNTS("AsyncDNS.HostsSize", size);
diff --git a/net/url_request/url_request_unittest.cc b/net/url_request/url_request_unittest.cc
index 9913fbc..6b53b41 100644
--- a/net/url_request/url_request_unittest.cc
+++ b/net/url_request/url_request_unittest.cc
@@ -704,7 +704,7 @@ TEST_F(URLRequestTest, FileTest) {
base::RunLoop().Run();
int64 file_size = -1;
- EXPECT_TRUE(file_util::GetFileSize(app_path, &file_size));
+ EXPECT_TRUE(base::GetFileSize(app_path, &file_size));
EXPECT_TRUE(!r.is_pending());
EXPECT_EQ(1, d.response_started_count());
@@ -747,7 +747,7 @@ TEST_F(URLRequestTest, FileTestFullSpecifiedRange) {
EXPECT_TRUE(file_util::WriteFile(temp_path, buffer.get(), buffer_size));
int64 file_size;
- EXPECT_TRUE(file_util::GetFileSize(temp_path, &file_size));
+ EXPECT_TRUE(base::GetFileSize(temp_path, &file_size));
const size_t first_byte_position = 500;
const size_t last_byte_position = buffer_size - first_byte_position;
@@ -791,7 +791,7 @@ TEST_F(URLRequestTest, FileTestHalfSpecifiedRange) {
EXPECT_TRUE(file_util::WriteFile(temp_path, buffer.get(), buffer_size));
int64 file_size;
- EXPECT_TRUE(file_util::GetFileSize(temp_path, &file_size));
+ EXPECT_TRUE(base::GetFileSize(temp_path, &file_size));
const size_t first_byte_position = 500;
const size_t last_byte_position = buffer_size - 1;
@@ -834,7 +834,7 @@ TEST_F(URLRequestTest, FileTestMultipleRanges) {
EXPECT_TRUE(file_util::WriteFile(temp_path, buffer.get(), buffer_size));
int64 file_size;
- EXPECT_TRUE(file_util::GetFileSize(temp_path, &file_size));
+ EXPECT_TRUE(base::GetFileSize(temp_path, &file_size));
TestDelegate d;
{
@@ -4726,7 +4726,7 @@ TEST_F(URLRequestTestHTTP, PostFileTest) {
base::RunLoop().Run();
int64 size = 0;
- ASSERT_EQ(true, file_util::GetFileSize(path, &size));
+ ASSERT_EQ(true, base::GetFileSize(path, &size));
scoped_ptr<char[]> buf(new char[size]);
ASSERT_EQ(size, file_util::ReadFile(path, buf.get(), size));
@@ -7068,7 +7068,7 @@ TEST_F(URLRequestTestFTP, DISABLED_FTPGetTestAnonymous) {
base::RunLoop().Run();
int64 file_size = 0;
- file_util::GetFileSize(app_path, &file_size);
+ base::GetFileSize(app_path, &file_size);
EXPECT_FALSE(r.is_pending());
EXPECT_EQ(1, d.response_started_count());
@@ -7101,7 +7101,7 @@ TEST_F(URLRequestTestFTP, DISABLED_FTPGetTest) {
base::RunLoop().Run();
int64 file_size = 0;
- file_util::GetFileSize(app_path, &file_size);
+ base::GetFileSize(app_path, &file_size);
EXPECT_FALSE(r.is_pending());
EXPECT_EQ(test_server_.host_port_pair().host(),
@@ -7138,7 +7138,7 @@ TEST_F(URLRequestTestFTP, DISABLED_FTPCheckWrongPassword) {
base::RunLoop().Run();
int64 file_size = 0;
- file_util::GetFileSize(app_path, &file_size);
+ base::GetFileSize(app_path, &file_size);
EXPECT_FALSE(r.is_pending());
EXPECT_EQ(1, d.response_started_count());
@@ -7170,7 +7170,7 @@ TEST_F(URLRequestTestFTP, DISABLED_FTPCheckWrongPasswordRestart) {
base::RunLoop().Run();
int64 file_size = 0;
- file_util::GetFileSize(app_path, &file_size);
+ base::GetFileSize(app_path, &file_size);
EXPECT_FALSE(r.is_pending());
EXPECT_EQ(1, d.response_started_count());
@@ -7199,7 +7199,7 @@ TEST_F(URLRequestTestFTP, DISABLED_FTPCheckWrongUser) {
base::RunLoop().Run();
int64 file_size = 0;
- file_util::GetFileSize(app_path, &file_size);
+ base::GetFileSize(app_path, &file_size);
EXPECT_FALSE(r.is_pending());
EXPECT_EQ(1, d.response_started_count());
@@ -7231,7 +7231,7 @@ TEST_F(URLRequestTestFTP, DISABLED_FTPCheckWrongUserRestart) {
base::RunLoop().Run();
int64 file_size = 0;
- file_util::GetFileSize(app_path, &file_size);
+ base::GetFileSize(app_path, &file_size);
EXPECT_FALSE(r.is_pending());
EXPECT_EQ(1, d.response_started_count());
@@ -7262,7 +7262,7 @@ TEST_F(URLRequestTestFTP, DISABLED_FTPCacheURLCredentials) {
base::RunLoop().Run();
int64 file_size = 0;
- file_util::GetFileSize(app_path, &file_size);
+ base::GetFileSize(app_path, &file_size);
EXPECT_FALSE(r.is_pending());
EXPECT_EQ(1, d->response_started_count());
@@ -7283,7 +7283,7 @@ TEST_F(URLRequestTestFTP, DISABLED_FTPCacheURLCredentials) {
base::RunLoop().Run();
int64 file_size = 0;
- file_util::GetFileSize(app_path, &file_size);
+ base::GetFileSize(app_path, &file_size);
EXPECT_FALSE(r.is_pending());
EXPECT_EQ(1, d->response_started_count());
@@ -7316,7 +7316,7 @@ TEST_F(URLRequestTestFTP, DISABLED_FTPCacheLoginBoxCredentials) {
base::RunLoop().Run();
int64 file_size = 0;
- file_util::GetFileSize(app_path, &file_size);
+ base::GetFileSize(app_path, &file_size);
EXPECT_FALSE(r.is_pending());
EXPECT_EQ(1, d->response_started_count());
@@ -7340,7 +7340,7 @@ TEST_F(URLRequestTestFTP, DISABLED_FTPCacheLoginBoxCredentials) {
base::RunLoop().Run();
int64 file_size = 0;
- file_util::GetFileSize(app_path, &file_size);
+ base::GetFileSize(app_path, &file_size);
EXPECT_FALSE(r.is_pending());
EXPECT_EQ(1, d->response_started_count());
diff --git a/printing/emf_win_unittest.cc b/printing/emf_win_unittest.cc
index 261fe73..c9600ed 100644
--- a/printing/emf_win_unittest.cc
+++ b/printing/emf_win_unittest.cc
@@ -189,7 +189,7 @@ TEST(EmfTest, FileBackedEmf) {
EXPECT_EQ(data.size(), size);
}
int64 file_size = 0;
- file_util::GetFileSize(metafile_path, &file_size);
+ base::GetFileSize(metafile_path, &file_size);
EXPECT_EQ(size, file_size);
// Playback the data.
diff --git a/sql/connection.cc b/sql/connection.cc
index 6ca60ef..6e02cd7 100644
--- a/sql/connection.cc
+++ b/sql/connection.cc
@@ -213,7 +213,7 @@ Connection::~Connection() {
bool Connection::Open(const base::FilePath& path) {
if (!histogram_tag_.empty()) {
int64 size_64 = 0;
- if (file_util::GetFileSize(path, &size_64)) {
+ if (base::GetFileSize(path, &size_64)) {
size_t sample = static_cast<size_t>(size_64 / 1024);
std::string full_histogram_name = "Sqlite.SizeKB." + histogram_tag_;
base::HistogramBase* histogram =
diff --git a/sql/test/test_helpers.cc b/sql/test/test_helpers.cc
index 5438bd6..a913352 100644
--- a/sql/test/test_helpers.cc
+++ b/sql/test/test_helpers.cc
@@ -65,7 +65,7 @@ bool CorruptSizeInHeader(const base::FilePath& db_path) {
return false;
int64 db_size = 0;
- if (!file_util::GetFileSize(db_path, &db_size))
+ if (!base::GetFileSize(db_path, &db_size))
return false;
const unsigned page_size = ReadBigEndian(header + kPageSizeOffset, 2);
diff --git a/third_party/leveldatabase/env_chromium.cc b/third_party/leveldatabase/env_chromium.cc
index e0ab97d..ee36b14 100644
--- a/third_party/leveldatabase/env_chromium.cc
+++ b/third_party/leveldatabase/env_chromium.cc
@@ -863,7 +863,7 @@ Status ChromiumEnv::DeleteDir(const std::string& name) {
Status ChromiumEnv::GetFileSize(const std::string& fname, uint64_t* size) {
Status s;
int64_t signed_size;
- if (!::file_util::GetFileSize(CreateFilePath(fname), &signed_size)) {
+ if (!::base::GetFileSize(CreateFilePath(fname), &signed_size)) {
*size = 0;
s = MakeIOError(fname, "Could not determine file size.", kGetFileSize);
RecordErrorAt(kGetFileSize);
diff --git a/webkit/browser/database/database_tracker.cc b/webkit/browser/database/database_tracker.cc
index 0b80811..50a3bf1 100644
--- a/webkit/browser/database/database_tracker.cc
+++ b/webkit/browser/database/database_tracker.cc
@@ -574,7 +574,7 @@ int64 DatabaseTracker::GetDBFileSize(const std::string& origin_identifier,
base::FilePath db_file_name = GetFullDBFilePath(origin_identifier,
database_name);
int64 db_file_size = 0;
- if (!file_util::GetFileSize(db_file_name, &db_file_size))
+ if (!base::GetFileSize(db_file_name, &db_file_size))
db_file_size = 0;
return db_file_size;
}
diff --git a/webkit/browser/database/vfs_backend.cc b/webkit/browser/database/vfs_backend.cc
index 41331d6..3f51c2e 100644
--- a/webkit/browser/database/vfs_backend.cc
+++ b/webkit/browser/database/vfs_backend.cc
@@ -161,7 +161,7 @@ uint32 VfsBackend::GetFileAttributes(const base::FilePath& file_path) {
// static
int64 VfsBackend::GetFileSize(const base::FilePath& file_path) {
int64 size = 0;
- return (file_util::GetFileSize(file_path, &size) ? size : 0);
+ return (base::GetFileSize(file_path, &size) ? size : 0);
}
} // namespace webkit_database
diff --git a/webkit/browser/fileapi/dump_file_system.cc b/webkit/browser/fileapi/dump_file_system.cc
index 6584fd8..a1ffa4a 100644
--- a/webkit/browser/fileapi/dump_file_system.cc
+++ b/webkit/browser/fileapi/dump_file_system.cc
@@ -116,7 +116,7 @@ static void DumpDirectoryTree(const std::string& origin_name,
if (info.is_directory()) {
size = static_cast<int64>(children.size());
} else {
- file_util::GetFileSize(origin_dir.Append(info.data_path), &size);
+ base::GetFileSize(origin_dir.Append(info.data_path), &size);
}
// TODO(hamaji): Modification time?
printf("%s%s %"PRId64" %"PRId64" %s\n",
diff --git a/webkit/browser/fileapi/quota/open_file_handle_context.cc b/webkit/browser/fileapi/quota/open_file_handle_context.cc
index a730f06..0928fff 100644
--- a/webkit/browser/fileapi/quota/open_file_handle_context.cc
+++ b/webkit/browser/fileapi/quota/open_file_handle_context.cc
@@ -18,7 +18,7 @@ OpenFileHandleContext::OpenFileHandleContext(
reservation_buffer_(reservation_buffer) {
DCHECK(sequence_checker_.CalledOnValidSequencedThread());
- file_util::GetFileSize(platform_path, &initial_file_size_);
+ base::GetFileSize(platform_path, &initial_file_size_);
maximum_written_offset_ = initial_file_size_;
}
@@ -43,7 +43,7 @@ OpenFileHandleContext::~OpenFileHandleContext() {
// TODO(tzik): Optimize this for single operation.
int64 file_size = 0;
- file_util::GetFileSize(platform_path_, &file_size);
+ base::GetFileSize(platform_path_, &file_size);
int64 usage_delta = file_size - initial_file_size_;
// |quota_consumption| may be greater than the recorded file growth when a
diff --git a/webkit/browser/fileapi/quota/quota_reservation_manager_unittest.cc b/webkit/browser/fileapi/quota/quota_reservation_manager_unittest.cc
index d9a521d..6cdc062 100644
--- a/webkit/browser/fileapi/quota/quota_reservation_manager_unittest.cc
+++ b/webkit/browser/fileapi/quota/quota_reservation_manager_unittest.cc
@@ -112,7 +112,7 @@ class QuotaReservationManagerTest : public testing::Test {
int64 GetFileSize() {
int64 size = 0;
- file_util::GetFileSize(file_path_, &size);
+ base::GetFileSize(file_path_, &size);
return size;
}