Chromium Code Reviews| 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 29 matching lines...) Expand all Loading... | |
| 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 base::Callback<void(PlatformFileError /* error code */, | 48 typedef base::Callback<void(PlatformFileError /* error code */, |
| 49 bool /* created */)> EnsureFileExistsCallback; | 49 bool /* created */)> EnsureFileExistsCallback; |
| 50 typedef Callback2<PlatformFileError /* error code */, | 50 typedef base::Callback<void(PlatformFileError /* error code */, |
| 51 const PlatformFileInfo& /* file_info */ | 51 const PlatformFileInfo& /* file_info */)> |
| 52 >::Type GetFileInfoCallback; | 52 GetFileInfoCallback; |
| 53 typedef Callback2<PlatformFileError /* error code */, | 53 typedef Callback2<PlatformFileError /* error code */, |
|
csilv
2011/10/17 20:10:17
This formatting is a little ugly IMHO, but I'm not
| |
| 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; |
| 60 | 60 |
| 61 // Creates or opens a file with the given flags. It is invalid to pass NULL | 61 // Creates or opens a file with the given flags. It is invalid to pass NULL |
| 62 // for the callback. | 62 // for the callback. |
| 63 // If PLATFORM_FILE_CREATE is set in |file_flags| it always tries to create | 63 // If PLATFORM_FILE_CREATE is set in |file_flags| it always tries to create |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 const 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 const 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, |
| 113 PlatformFile file, | 113 PlatformFile file, |
| 114 GetFileInfoCallback* callback); | 114 const GetFileInfoCallback& callback); |
| 115 | 115 |
| 116 static bool ReadDirectory(scoped_refptr<MessageLoopProxy> message_loop_proxy, | 116 static bool ReadDirectory(scoped_refptr<MessageLoopProxy> message_loop_proxy, |
| 117 const FilePath& file_path, | 117 const FilePath& file_path, |
| 118 ReadDirectoryCallback* callback); | 118 ReadDirectoryCallback* callback); |
| 119 | 119 |
| 120 // Creates directory at given path. It's an error to create | 120 // Creates directory at given path. It's an error to create |
| 121 // if |exclusive| is true and dir already exists. | 121 // if |exclusive| is true and dir already exists. |
| 122 static bool CreateDirectory( | 122 static bool CreateDirectory( |
| 123 scoped_refptr<MessageLoopProxy> message_loop_proxy, | 123 scoped_refptr<MessageLoopProxy> message_loop_proxy, |
| 124 const FilePath& file_path, | 124 const FilePath& file_path, |
| (...skipping 96 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 |