diff options
author | ojan@google.com <ojan@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-12 22:12:43 +0000 |
---|---|---|
committer | ojan@google.com <ojan@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-12 22:12:43 +0000 |
commit | c1da9339ac3ac493e53a094dffb4d49cc3aa8dfd (patch) | |
tree | 0224c0b3d85fe5078e49cc8d9b1c8f54c98fe200 /base/file_util_posix.cc | |
parent | 6bea3284a8c15fc9a0e793d0da00423c2c2b885c (diff) | |
download | chromium_src-c1da9339ac3ac493e53a094dffb4d49cc3aa8dfd.zip chromium_src-c1da9339ac3ac493e53a094dffb4d49cc3aa8dfd.tar.gz chromium_src-c1da9339ac3ac493e53a094dffb4d49cc3aa8dfd.tar.bz2 |
Reverting 6935.
Broke compile
Review URL: http://codereview.chromium.org/14083
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6938 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/file_util_posix.cc')
-rw-r--r-- | base/file_util_posix.cc | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/base/file_util_posix.cc b/base/file_util_posix.cc index 7448ed8..153f70a 100644 --- a/base/file_util_posix.cc +++ b/base/file_util_posix.cc @@ -12,7 +12,6 @@ #include <stdio.h> #include <string.h> #include <sys/errno.h> -#include <sys/mman.h> #include <sys/stat.h> #include <time.h> @@ -379,9 +378,6 @@ bool SetCurrentDirectory(const FilePath& path) { return !ret; } -/////////////////////////////////////////////// -// FileEnumerator - FileEnumerator::FileEnumerator(const FilePath& root_path, bool recursive, FileEnumerator::FILE_TYPE file_type) @@ -483,41 +479,5 @@ FilePath FileEnumerator::Next() { return Next(); } -/////////////////////////////////////////////// -// MemoryMappedFile - -MemoryMappedFile::MemoryMappedFile() - : file_(-1), - data_(NULL), - length_(0) { -} - -bool MemoryMappedFile::MapFileToMemory(const FilePath& file_name) { - file_ = open(file_name.value().c_str(), O_RDONLY); - if (file_ == -1) - return false; - - struct stat file_stat; - if (fstat(file_, &file_stat) == -1) - return false; - length_ = file_stat.st_size; - - data_ = static_cast<uint8*>( - mmap(NULL, length_, PROT_READ, MAP_SHARED, file_, 0)); - if (data_ == MAP_FAILED) - data_ = NULL; - return data_ != NULL; -} - -void MemoryMappedFile::CloseHandles() { - if (data_ != NULL) - munmap(data_, length_); - if (file_ != -1) - close(file_); - - data_ = NULL; - length_ = 0; - file_ = -1; -} } // namespace file_util |