diff options
author | dumi@chromium.org <dumi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-31 19:30:27 +0000 |
---|---|---|
committer | dumi@chromium.org <dumi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-31 19:30:27 +0000 |
commit | ed65fece343181e91b4d36e161434cc763475de7 (patch) | |
tree | 27af7d7cb8a12f65b24dba3ebd5ede3d592e2d8e /base/file_util_proxy.h | |
parent | 2d723bc66e60bedd617ebd464996ee2388c0c365 (diff) | |
download | chromium_src-ed65fece343181e91b4d36e161434cc763475de7.zip chromium_src-ed65fece343181e91b4d36e161434cc763475de7.tar.gz chromium_src-ed65fece343181e91b4d36e161434cc763475de7.tar.bz2 |
Add an optional parameter to CreatePlatformFile() to report the type
of error that occured while trying to open/create a file.
TEST=none
BUG=none
Review URL: http://codereview.chromium.org/3223007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58045 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/file_util_proxy.h')
-rw-r--r-- | base/file_util_proxy.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/base/file_util_proxy.h b/base/file_util_proxy.h index ff04e5b..9899c77 100644 --- a/base/file_util_proxy.h +++ b/base/file_util_proxy.h @@ -24,11 +24,13 @@ class FileUtilProxy { // This callback is used by methods that report only an error code. It is // valid to pass NULL as the callback parameter to any function that takes a // StatusCallback, in which case the operation will complete silently. - typedef Callback1<int /* error code */>::Type StatusCallback; + typedef Callback1<base::PlatformFileError /* error code */ + >::Type StatusCallback; // Creates or opens a file with the given flags. It is invalid to pass NULL // for the callback. - typedef Callback3<int /* error code */, base::PassPlatformFile, + typedef Callback3<base::PlatformFileError /* error code */, + base::PassPlatformFile, bool /* created */>::Type CreateOrOpenCallback; static bool CreateOrOpen(scoped_refptr<MessageLoopProxy> message_loop_proxy, const FilePath& file_path, @@ -37,7 +39,8 @@ class FileUtilProxy { // Creates a temporary file for writing. The path and an open file handle // are returned. It is invalid to pass NULL for the callback. - typedef Callback3<int /* error code */, base::PassPlatformFile, + typedef Callback3<base::PlatformFileError /* error code */, + base::PassPlatformFile, FilePath>::Type CreateTemporaryCallback; static bool CreateTemporary( scoped_refptr<MessageLoopProxy> message_loop_proxy, @@ -61,7 +64,7 @@ class FileUtilProxy { // Retrieves the information about a file. It is invalid to pass NULL for the // callback. - typedef Callback2<bool /*exists*/, + typedef Callback2<base::PlatformFileError /* error code */, const file_util::FileInfo& /*file_info*/ >::Type GetFileInfoCallback; static bool GetFileInfo( |