From c870c76357fc05d3f7181f8121181f983bd25e7f Mon Sep 17 00:00:00 2001 From: "estade@chromium.org" Date: Wed, 28 Jan 2009 05:47:15 +0000 Subject: Safe browsing cleanup: * wstring -> FilePath * create versions of WriteFile/ReadFile with FilePath signatures Review URL: http://codereview.chromium.org/19610 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8797 0039d316-1c4b-4281-b951-d872f2087c98 --- base/file_util_posix.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'base/file_util_posix.cc') diff --git a/base/file_util_posix.cc b/base/file_util_posix.cc index 9ab29eb..d44b743 100644 --- a/base/file_util_posix.cc +++ b/base/file_util_posix.cc @@ -353,8 +353,8 @@ FILE* OpenFile(const FilePath& filename, const char* mode) { return fopen(filename.value().c_str(), mode); } -int ReadFile(const std::wstring& filename, char* data, int size) { - int fd = open(WideToUTF8(filename).c_str(), O_RDONLY); +int ReadFile(const FilePath& filename, char* data, int size) { + int fd = open(filename.value().c_str(), O_RDONLY); if (fd < 0) return -1; @@ -363,8 +363,8 @@ int ReadFile(const std::wstring& filename, char* data, int size) { return ret_value; } -int WriteFile(const std::wstring& filename, const char* data, int size) { - int fd = creat(WideToUTF8(filename).c_str(), 0666); +int WriteFile(const FilePath& filename, const char* data, int size) { + int fd = creat(filename.value().c_str(), 0666); if (fd < 0) return -1; -- cgit v1.1