Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2544)

Unified Diff: base/file_util.h

Issue 14087: revert r6938 (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 12 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/file_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/file_util.h
===================================================================
--- base/file_util.h (revision 6940)
+++ base/file_util.h (working copy)
@@ -414,8 +414,6 @@
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 @@
// 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 @@
// 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.
« no previous file with comments | « no previous file | base/file_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698