| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef BASE_FILE_UTIL_PROXY_H_ | 5 #ifndef BASE_FILE_UTIL_PROXY_H_ |
| 6 #define BASE_FILE_UTIL_PROXY_H_ | 6 #define BASE_FILE_UTIL_PROXY_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/base_export.h" | 10 #include "base/base_export.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 // The ownership of |callback| is taken by the function and will always be | 38 // The ownership of |callback| is taken by the function and will always be |
| 39 // deleted by the function even on failure. | 39 // deleted by the function even on failure. |
| 40 typedef Callback1<PlatformFileError /* error code */>::Type StatusCallback; | 40 typedef Callback1<PlatformFileError /* error code */>::Type StatusCallback; |
| 41 | 41 |
| 42 typedef base::Callback<void(PlatformFileError /* error code */, | 42 typedef base::Callback<void(PlatformFileError /* error code */, |
| 43 PassPlatformFile, | 43 PassPlatformFile, |
| 44 bool /* created */)> CreateOrOpenCallback; | 44 bool /* created */)> CreateOrOpenCallback; |
| 45 typedef base::Callback<void(PlatformFileError /* error code */, | 45 typedef base::Callback<void(PlatformFileError /* error code */, |
| 46 PassPlatformFile, | 46 PassPlatformFile, |
| 47 FilePath)> CreateTemporaryCallback; | 47 FilePath)> CreateTemporaryCallback; |
| 48 typedef Callback2<PlatformFileError /* error code */, | 48 typedef base::Callback<void(PlatformFileError /* error code */, |
| 49 bool /* created */>::Type EnsureFileExistsCallback; | 49 bool /* created */)> EnsureFileExistsCallback; |
| 50 typedef Callback2<PlatformFileError /* error code */, | 50 typedef Callback2<PlatformFileError /* error code */, |
| 51 const PlatformFileInfo& /* file_info */ | 51 const PlatformFileInfo& /* file_info */ |
| 52 >::Type GetFileInfoCallback; | 52 >::Type GetFileInfoCallback; |
| 53 typedef Callback2<PlatformFileError /* error code */, | 53 typedef Callback2<PlatformFileError /* error code */, |
| 54 const std::vector<Entry>&>::Type ReadDirectoryCallback; | 54 const std::vector<Entry>&>::Type ReadDirectoryCallback; |
| 55 typedef Callback3<PlatformFileError /* error code */, | 55 typedef Callback3<PlatformFileError /* error code */, |
| 56 const char* /* data */, | 56 const char* /* data */, |
| 57 int /* bytes read/written */>::Type ReadCallback; | 57 int /* bytes read/written */>::Type ReadCallback; |
| 58 typedef Callback2<PlatformFileError /* error code */, | 58 typedef Callback2<PlatformFileError /* error code */, |
| 59 int /* bytes written */>::Type WriteCallback; | 59 int /* bytes written */>::Type WriteCallback; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 // If a new file han not existed and is created at the |file_path|, | 92 // If a new file han not existed and is created at the |file_path|, |
| 93 // |created| of the callback argument is set true and |error code| | 93 // |created| of the callback argument is set true and |error code| |
| 94 // is set PLATFORM_FILE_OK. | 94 // is set PLATFORM_FILE_OK. |
| 95 // If the file already exists, |created| is set false and |error code| | 95 // If the file already exists, |created| is set false and |error code| |
| 96 // is set PLATFORM_FILE_OK. | 96 // is set PLATFORM_FILE_OK. |
| 97 // If the file hasn't existed but it couldn't be created for some other | 97 // If the file hasn't existed but it couldn't be created for some other |
| 98 // reasons, |created| is set false and |error code| indicates the error. | 98 // reasons, |created| is set false and |error code| indicates the error. |
| 99 static bool EnsureFileExists( | 99 static bool EnsureFileExists( |
| 100 scoped_refptr<MessageLoopProxy> message_loop_proxy, | 100 scoped_refptr<MessageLoopProxy> message_loop_proxy, |
| 101 const FilePath& file_path, | 101 const FilePath& file_path, |
| 102 EnsureFileExistsCallback* callback); | 102 const EnsureFileExistsCallback& callback); |
| 103 | 103 |
| 104 // Retrieves the information about a file. It is invalid to pass NULL for the | 104 // Retrieves the information about a file. It is invalid to pass NULL for the |
| 105 // callback. | 105 // callback. |
| 106 static bool GetFileInfo( | 106 static bool GetFileInfo( |
| 107 scoped_refptr<MessageLoopProxy> message_loop_proxy, | 107 scoped_refptr<MessageLoopProxy> message_loop_proxy, |
| 108 const FilePath& file_path, | 108 const FilePath& file_path, |
| 109 GetFileInfoCallback* callback); | 109 GetFileInfoCallback* callback); |
| 110 | 110 |
| 111 static bool GetFileInfoFromPlatformFile( | 111 static bool GetFileInfoFromPlatformFile( |
| 112 scoped_refptr<MessageLoopProxy> message_loop_proxy, | 112 scoped_refptr<MessageLoopProxy> message_loop_proxy, |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 PlatformFile file, | 221 PlatformFile file, |
| 222 StatusCallback* callback); | 222 StatusCallback* callback); |
| 223 | 223 |
| 224 private: | 224 private: |
| 225 DISALLOW_IMPLICIT_CONSTRUCTORS(FileUtilProxy); | 225 DISALLOW_IMPLICIT_CONSTRUCTORS(FileUtilProxy); |
| 226 }; | 226 }; |
| 227 | 227 |
| 228 } // namespace base | 228 } // namespace base |
| 229 | 229 |
| 230 #endif // BASE_FILE_UTIL_PROXY_H_ | 230 #endif // BASE_FILE_UTIL_PROXY_H_ |
| OLD | NEW |