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

Unified Diff: base/platform_file_win.cc

Issue 270066: Step 2 in porting disk cache to using FilePath. (Closed)
Patch Set: deprecated Created 11 years, 2 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 | « base/platform_file_posix.cc ('k') | net/disk_cache/block_files_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/platform_file_win.cc
diff --git a/base/platform_file_win.cc b/base/platform_file_win.cc
index 06e6200e98fb3ed4848ee4677d00a434854ae481..11434874e479105c98746ff14d751cd4e1d49648 100644
--- a/base/platform_file_win.cc
+++ b/base/platform_file_win.cc
@@ -4,11 +4,12 @@
#include "base/platform_file.h"
+#include "base/file_path.h"
#include "base/logging.h"
namespace base {
-PlatformFile CreatePlatformFile(const std::wstring& name,
+PlatformFile CreatePlatformFile(const FilePath& name,
int flags,
bool* created) {
DWORD disposition = 0;
@@ -54,8 +55,8 @@ PlatformFile CreatePlatformFile(const std::wstring& name,
if (flags & PLATFORM_FILE_DELETE_ON_CLOSE)
create_flags |= FILE_FLAG_DELETE_ON_CLOSE;
- HANDLE file = CreateFile(name.c_str(), access, sharing, NULL, disposition,
- create_flags, NULL);
+ HANDLE file = CreateFile(name.value().c_str(), access, sharing, NULL,
+ disposition, create_flags, NULL);
if ((flags & PLATFORM_FILE_OPEN_ALWAYS) && created &&
INVALID_HANDLE_VALUE != file) {
@@ -65,6 +66,11 @@ PlatformFile CreatePlatformFile(const std::wstring& name,
return file;
}
+PlatformFile CreatePlatformFile(const std::wstring& name, int flags,
+ bool* created) {
+ return CreatePlatformFile(FilePath::FromWStringHack(name), flags, created);
+}
+
bool ClosePlatformFile(PlatformFile file) {
return (CloseHandle(file) == 0);
}
« no previous file with comments | « base/platform_file_posix.cc ('k') | net/disk_cache/block_files_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698