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

Unified Diff: base/file_util_win.cc

Issue 19610: Safe browsing cleanup:... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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 | « base/file_util_posix.cc ('k') | chrome/browser/safe_browsing/database_perftest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/file_util_win.cc
===================================================================
--- base/file_util_win.cc (revision 8772)
+++ base/file_util_win.cc (working copy)
@@ -497,8 +497,8 @@
return file;
}
-int ReadFile(const std::wstring& filename, char* data, int size) {
- ScopedHandle file(CreateFile(filename.c_str(),
+int ReadFile(const FilePath& filename, char* data, int size) {
+ ScopedHandle file(CreateFile(filename.value().c_str(),
GENERIC_READ,
FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL,
@@ -519,8 +519,8 @@
return ret_value;
}
-int WriteFile(const std::wstring& filename, const char* data, int size) {
- ScopedHandle file(CreateFile(filename.c_str(),
+int WriteFile(const FilePath& filename, const char* data, int size) {
+ ScopedHandle file(CreateFile(filename.value().c_str(),
GENERIC_WRITE,
0,
NULL,
@@ -528,7 +528,7 @@
0,
NULL));
if (file == INVALID_HANDLE_VALUE) {
- LOG(WARNING) << "CreateFile failed for path " << filename <<
+ LOG(WARNING) << "CreateFile failed for path " << filename.value() <<
" error code=" << GetLastError() <<
" error text=" << win_util::FormatLastWin32Error();
return -1;
@@ -541,13 +541,13 @@
if (!result) {
// WriteFile failed.
- LOG(WARNING) << "writing file " << filename <<
+ LOG(WARNING) << "writing file " << filename.value() <<
" failed, error code=" << GetLastError() <<
" description=" << win_util::FormatLastWin32Error();
} else {
// Didn't write all the bytes.
- LOG(WARNING) << "wrote" << written << " bytes to " << filename <<
- " expected " << size;
+ LOG(WARNING) << "wrote" << written << " bytes to " <<
+ filename.value() << " expected " << size;
}
return -1;
}
« no previous file with comments | « base/file_util_posix.cc ('k') | chrome/browser/safe_browsing/database_perftest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698