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

Unified Diff: base/file_util.cc

Issue 12321062: base: Move MemoryMappedFile out of file_util.h and into its own header file. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix chrome_frame Created 7 years, 10 months 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.cc
diff --git a/base/file_util.cc b/base/file_util.cc
index 03e70f911a8461d01d460eb7f1bd451af7a17a7b..e15064af4895ed92d725c4b02b778e922f5fe9ea 100644
--- a/base/file_util.cc
+++ b/base/file_util.cc
@@ -351,56 +351,6 @@ int64 ComputeFilesSize(const FilePath& directory,
}
///////////////////////////////////////////////
-// MemoryMappedFile
-
-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::Initialize(base::PlatformFile file) {
- if (IsValid())
- return false;
-
- file_ = file;
-
- if (!MapFileToMemoryInternal()) {
- CloseHandles();
- return false;
- }
-
- return true;
-}
-
-bool MemoryMappedFile::IsValid() const {
- return data_ != NULL;
-}
-
-bool MemoryMappedFile::MapFileToMemory(const FilePath& file_name) {
- file_ = base::CreatePlatformFile(
- file_name, base::PLATFORM_FILE_OPEN | base::PLATFORM_FILE_READ,
- NULL, NULL);
-
- if (file_ == base::kInvalidPlatformFileValue) {
- DLOG(ERROR) << "Couldn't open " << file_name.value();
- return false;
- }
-
- return MapFileToMemoryInternal();
-}
-
-///////////////////////////////////////////////
// FileEnumerator
//
// Note: the main logic is in file_util_<platform>.cc

Powered by Google App Engine
This is Rietveld 408576698