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

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 again 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
« no previous file with comments | « base/file_util.h ('k') | base/file_util_posix.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/file_util.cc
diff --git a/base/file_util.cc b/base/file_util.cc
index b6cdc98d9a6a680bd6b34d2893fad581e8b47289..f951e3b34c04ca491990e0cb4ec12caaedfb189c 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
« no previous file with comments | « base/file_util.h ('k') | base/file_util_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698