summaryrefslogtreecommitdiffstats
path: root/base/file_util.h
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-12 23:43:03 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-12 23:43:03 +0000
commit7856bb83df917cfaebfe7881dc620bf264a94885 (patch)
tree441a77bf222db624ec3c3bbf58f0f3f9698befd9 /base/file_util.h
parent6d2b8132aaa55a9e01b8b49bcce5eb44c68a1972 (diff)
downloadchromium_src-7856bb83df917cfaebfe7881dc620bf264a94885.zip
chromium_src-7856bb83df917cfaebfe7881dc620bf264a94885.tar.gz
chromium_src-7856bb83df917cfaebfe7881dc620bf264a94885.tar.bz2
revert r6938
(i.e. reapply 6935, with fix) Review URL: http://codereview.chromium.org/14087 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6953 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/file_util.h')
-rw-r--r--base/file_util.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/base/file_util.h b/base/file_util.h
index 854703f..d1cfb05 100644
--- a/base/file_util.h
+++ b/base/file_util.h
@@ -414,8 +414,6 @@ class FileEnumerator {
DISALLOW_EVIL_CONSTRUCTORS(FileEnumerator);
};
-// TODO(port): port this class to posix.
-#if defined(OS_WIN)
class MemoryMappedFile {
public:
// The default constructor sets all members to invalid/null values.
@@ -429,8 +427,8 @@ class MemoryMappedFile {
// Later we may want to allow the user to specify access.
bool Initialize(const FilePath& file_name);
- const uint8* Data() const { return data_; }
- size_t Length() const { return length_; }
+ const uint8* data() const { return data_; }
+ size_t length() const { return length_; }
// Is file_ a valid file handle that points to an open, memory mapped file?
bool IsValid();
@@ -443,14 +441,18 @@ class MemoryMappedFile {
// Closes all open handles. Later we may want to make this public.
void CloseHandles();
+#if defined(OS_WIN)
HANDLE file_;
HANDLE file_mapping_;
- const uint8* data_;
+#elif defined(OS_POSIX)
+ // The file descriptor.
+ int file_;
+#endif
+ uint8* data_;
size_t length_;
DISALLOW_COPY_AND_ASSIGN(MemoryMappedFile);
};
-#endif // defined(OS_WIN)
// Renames a file using the SHFileOperation API to ensure that the target file
// gets the correct default security descriptor in the new path.