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

Unified Diff: base/file_util.h

Issue 397014: Revert 31875 to see whether it fixes reliability bot. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 1 month 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 32064)
+++ base/file_util.h (working copy)
@@ -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 @@
// 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 @@
bool IsValid();
private:
- // Open the given file and pass it to MapFileToMemoryInternal().
+ // 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);
- // 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().
+#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_;
« 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