Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(138)

Unified Diff: net/disk_cache/simple/simple_test_util.cc

Issue 101143006: Convert base::file_util to use File instead of PlatformFile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove base:: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/disk_cache/simple/simple_index_file.cc ('k') | net/disk_cache/simple/simple_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/simple/simple_test_util.cc
diff --git a/net/disk_cache/simple/simple_test_util.cc b/net/disk_cache/simple/simple_test_util.cc
index 9a27558823014a67fa3d3ce7d8ad4b0277c7ce79..f7209a762e1b6edd51660ef27bd0422d7e8068cb 100644
--- a/net/disk_cache/simple/simple_test_util.cc
+++ b/net/disk_cache/simple/simple_test_util.cc
@@ -4,7 +4,7 @@
#include "net/disk_cache/simple/simple_test_util.h"
-#include "base/file_util.h"
+#include "base/files/file.h"
#include "net/disk_cache/simple/simple_util.h"
namespace disk_cache {
@@ -14,19 +14,14 @@ bool CreateCorruptFileForTests(const std::string& key,
const base::FilePath& cache_path) {
base::FilePath entry_file_path = cache_path.AppendASCII(
disk_cache::simple_util::GetFilenameFromKeyAndFileIndex(key, 0));
- int flags = base::PLATFORM_FILE_CREATE_ALWAYS | base::PLATFORM_FILE_WRITE;
- base::PlatformFile entry_file =
- base::CreatePlatformFile(entry_file_path, flags, NULL, NULL);
+ int flags = base::File::FLAG_CREATE_ALWAYS | base::File::FLAG_WRITE;
+ base::File entry_file(entry_file_path, flags);
- if (base::kInvalidPlatformFileValue == entry_file)
- return false;
- if (base::WritePlatformFile(entry_file, 0, "dummy", 1) != 1)
- return false;
- if (!base::ClosePlatformFile(entry_file))
+ if (!entry_file.IsValid())
return false;
- return true;
+ return entry_file.Write(0, "dummy", 1) == 1;
}
-} // namespace simple_backend
+} // namespace simple_util
} // namespace disk_cache
« no previous file with comments | « net/disk_cache/simple/simple_index_file.cc ('k') | net/disk_cache/simple/simple_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698