summaryrefslogtreecommitdiffstats
path: root/base/file_util_proxy.h
diff options
context:
space:
mode:
authorkkanetkar@chromium.org <kkanetkar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-02 20:36:52 +0000
committerkkanetkar@chromium.org <kkanetkar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-02 20:36:52 +0000
commit841daf1da7feb933fb5ae82d86f82f1d218ad912 (patch)
tree1cf23b1c6648d7d61129b74ab61c98f87b37db87 /base/file_util_proxy.h
parent2ba5f33bc46a606baaac64a23c78e8726a2c8edd (diff)
downloadchromium_src-841daf1da7feb933fb5ae82d86f82f1d218ad912.zip
chromium_src-841daf1da7feb933fb5ae82d86f82f1d218ad912.tar.gz
chromium_src-841daf1da7feb933fb5ae82d86f82f1d218ad912.tar.bz2
Moving Entry from base::file_util_proxy namespace to within class base::FileUtilProxy
BUG=None TEST=None Review URL: http://codereview.chromium.org/4261001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@64806 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/file_util_proxy.h')
-rw-r--r--base/file_util_proxy.h62
1 files changed, 28 insertions, 34 deletions
diff --git a/base/file_util_proxy.h b/base/file_util_proxy.h
index 09c2377..f266562 100644
--- a/base/file_util_proxy.h
+++ b/base/file_util_proxy.h
@@ -16,35 +16,30 @@
namespace base {
-namespace file_util_proxy {
-
-// Holds metadata for file or directory entry.
-struct Entry {
- FilePath::StringType name;
- bool is_directory;
-};
-
-} // namespace file_util_proxy
-
class MessageLoopProxy;
class Time;
// This class provides asynchronous access to common file routines.
class FileUtilProxy {
public:
+ // Holds metadata for file or directory entry. Used by ReadDirectoryCallback.
+ struct Entry {
+ FilePath::StringType name;
+ bool is_directory;
+ };
+
// 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<base::PlatformFileError /* error code */
- >::Type StatusCallback;
+ typedef Callback1<PlatformFileError /* error code */>::Type StatusCallback;
// Creates or opens a file with the given flags. It is invalid to pass NULL
// for the callback.
// If PLATFORM_FILE_CREATE is set in |file_flags| it always tries to create
// a new file at the given |file_path| and calls back with
// PLATFORM_FILE_ERROR_FILE_EXISTS if the |file_path| already exists.
- typedef Callback3<base::PlatformFileError /* error code */,
- base::PassPlatformFile,
+ typedef Callback3<PlatformFileError /* error code */,
+ PassPlatformFile,
bool /* created */>::Type CreateOrOpenCallback;
static bool CreateOrOpen(scoped_refptr<MessageLoopProxy> message_loop_proxy,
const FilePath& file_path,
@@ -53,8 +48,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<base::PlatformFileError /* error code */,
- base::PassPlatformFile,
+ typedef Callback3<PlatformFileError /* error code */,
+ PassPlatformFile,
FilePath>::Type CreateTemporaryCallback;
static bool CreateTemporary(
scoped_refptr<MessageLoopProxy> message_loop_proxy,
@@ -62,7 +57,7 @@ class FileUtilProxy {
// Close the given file handle.
static bool Close(scoped_refptr<MessageLoopProxy> message_loop_proxy,
- base::PlatformFile,
+ PlatformFile,
StatusCallback* callback);
// Ensures that the given |file_path| exist. This creates a empty new file
@@ -74,7 +69,7 @@ class FileUtilProxy {
// is set PLATFORM_FILE_OK.
// If the file hasn't existed but it couldn't be created for some other
// reasons, |created| is set false and |error code| indicates the error.
- typedef Callback2<base::PlatformFileError /* error code */,
+ typedef Callback2<PlatformFileError /* error code */,
bool /* created */>::Type EnsureFileExistsCallback;
static bool EnsureFileExists(
scoped_refptr<MessageLoopProxy> message_loop_proxy,
@@ -83,8 +78,8 @@ class FileUtilProxy {
// Retrieves the information about a file. It is invalid to pass NULL for the
// callback.
- typedef Callback2<base::PlatformFileError /* error code */,
- const base::PlatformFileInfo& /* file_info */
+ typedef Callback2<PlatformFileError /* error code */,
+ const PlatformFileInfo& /* file_info */
>::Type GetFileInfoCallback;
static bool GetFileInfo(
scoped_refptr<MessageLoopProxy> message_loop_proxy,
@@ -93,12 +88,11 @@ class FileUtilProxy {
static bool GetFileInfoFromPlatformFile(
scoped_refptr<MessageLoopProxy> message_loop_proxy,
- base::PlatformFile file,
+ PlatformFile file,
GetFileInfoCallback* callback);
- typedef Callback2<base::PlatformFileError /* error code */,
- const std::vector<base::file_util_proxy::Entry>&
- >::Type ReadDirectoryCallback;
+ typedef Callback2<PlatformFileError /* error code */,
+ const std::vector<Entry>&>::Type ReadDirectoryCallback;
static bool ReadDirectory(scoped_refptr<MessageLoopProxy> message_loop_proxy,
const FilePath& file_path,
ReadDirectoryCallback* callback);
@@ -148,11 +142,11 @@ class FileUtilProxy {
// Reads from a file. On success, the file pointer is moved to position
// |offset + bytes_to_read| in the file. The callback can be NULL.
- typedef Callback2<base::PlatformFileError /* error code */,
+ typedef Callback2<PlatformFileError /* error code */,
int /* bytes read/written */>::Type ReadWriteCallback;
static bool Read(
scoped_refptr<MessageLoopProxy> message_loop_proxy,
- base::PlatformFile file,
+ PlatformFile file,
int64 offset,
char* buffer,
int bytes_to_read,
@@ -163,7 +157,7 @@ class FileUtilProxy {
// |offset + bytes_to_write| in the file. The callback can be NULL.
static bool Write(
scoped_refptr<MessageLoopProxy> message_loop_proxy,
- base::PlatformFile file,
+ PlatformFile file,
int64 offset,
const char* buffer,
int bytes_to_write,
@@ -172,17 +166,17 @@ class FileUtilProxy {
// Touches a file. The callback can be NULL.
static bool Touch(
scoped_refptr<MessageLoopProxy> message_loop_proxy,
- base::PlatformFile file,
- const base::Time& last_access_time,
- const base::Time& last_modified_time,
+ PlatformFile file,
+ const Time& last_access_time,
+ const Time& last_modified_time,
StatusCallback* callback);
// Touches a file. The callback can be NULL.
static bool Touch(
scoped_refptr<MessageLoopProxy> message_loop_proxy,
const FilePath& file_path,
- const base::Time& last_access_time,
- const base::Time& last_modified_time,
+ const Time& last_access_time,
+ const Time& last_modified_time,
StatusCallback* callback);
// Truncates a file to the given length. If |length| is greater than the
@@ -190,7 +184,7 @@ class FileUtilProxy {
// The callback can be NULL.
static bool Truncate(
scoped_refptr<MessageLoopProxy> message_loop_proxy,
- base::PlatformFile file,
+ PlatformFile file,
int64 length,
StatusCallback* callback);
@@ -206,7 +200,7 @@ class FileUtilProxy {
// Flushes a file. The callback can be NULL.
static bool Flush(
scoped_refptr<MessageLoopProxy> message_loop_proxy,
- base::PlatformFile file,
+ PlatformFile file,
StatusCallback* callback);
private: