diff options
author | huanr@chromium.org <huanr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-16 19:34:59 +0000 |
---|---|---|
committer | huanr@chromium.org <huanr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-16 19:34:59 +0000 |
commit | 7075b06c4ddb77982b62ffcecb46a6c52d7860f4 (patch) | |
tree | 2f0e1f34ef05253c573b4cfbe3a7ff48fe7dfe8f /base/file_util.h | |
parent | 37048f235367c282f1dba8c26364050dfc083d90 (diff) | |
download | chromium_src-7075b06c4ddb77982b62ffcecb46a6c52d7860f4.zip chromium_src-7075b06c4ddb77982b62ffcecb46a6c52d7860f4.tar.gz chromium_src-7075b06c4ddb77982b62ffcecb46a6c52d7860f4.tar.bz2 |
Revert 31875 to see whether it fixes reliability bot.
BUG=25677
TEST=None
Review URL: http://codereview.chromium.org/397014
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32074 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/file_util.h')
-rw-r--r-- | base/file_util.h | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/base/file_util.h b/base/file_util.h index 782a6a2..8654e62 100644 --- a/base/file_util.h +++ b/base/file_util.h @@ -24,7 +24,6 @@ #include "base/basictypes.h" #include "base/file_path.h" -#include "base/platform_file.h" #include "base/scoped_ptr.h" #include "base/string16.h" #include "base/time.h" @@ -491,9 +490,10 @@ class MemoryMappedFile { // the file does not exist, or the memory mapping fails, it will return false. // Later we may want to allow the user to specify access. bool Initialize(const FilePath& file_name); - // As above, but works with an already-opened file. MemoryMappedFile will take - // ownership of |file| and close it when done. - bool Initialize(base::PlatformFile file); +#if defined(OS_POSIX) + // As above, but works with an alreay-opened file. + bool Initialize(const base::FileDescriptor& fd); +#endif const uint8* data() const { return data_; } size_t length() const { return length_; } @@ -502,19 +502,23 @@ class MemoryMappedFile { bool IsValid(); private: - // Open the given file and pass it to MapFileToMemoryInternal(). - bool MapFileToMemory(const FilePath& file_name); - // Map the file to memory, set data_ to that memory address. Return true on // success, false on any kind of failure. This is a helper for Initialize(). + bool MapFileToMemory(const FilePath& file_name); + +#if defined(OS_POSIX) bool MapFileToMemoryInternal(); +#endif // Closes all open handles. Later we may want to make this public. void CloseHandles(); - base::PlatformFile file_; #if defined(OS_WIN) + HANDLE file_; HANDLE file_mapping_; +#elif defined(OS_POSIX) + // The file descriptor. + base::FileDescriptor file_; #endif uint8* data_; size_t length_; |