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

Unified Diff: base/file_util_win.cc

Issue 14073: Implement the memory mapped file class for posix. (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
Index: base/file_util_win.cc
===================================================================
--- base/file_util_win.cc (revision 6919)
+++ base/file_util_win.cc (working copy)
@@ -704,22 +704,6 @@
length_(INVALID_FILE_SIZE) {
}
-MemoryMappedFile::~MemoryMappedFile() {
- CloseHandles();
-}
-
-bool MemoryMappedFile::Initialize(const FilePath& file_name) {
- if (IsValid())
- return false;
-
- if (!MapFileToMemory(file_name)) {
- CloseHandles();
- return false;
- }
-
- return true;
-}
-
bool MemoryMappedFile::MapFileToMemory(const FilePath& file_name) {
file_ = ::CreateFile(file_name.value().c_str(), GENERIC_READ,
FILE_SHARE_READ, NULL, OPEN_EXISTING,
@@ -741,10 +725,6 @@
return data_ != NULL;
}
-bool MemoryMappedFile::IsValid() {
- return data_ != NULL;
-}
-
void MemoryMappedFile::CloseHandles() {
if (data_)
::UnmapViewOfFile(data_);

Powered by Google App Engine
This is Rietveld 408576698