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

Unified Diff: base/file_util.cc

Issue 6085015: Order function definitions in base/ according to the header. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: lrn2merge Created 9 years, 11 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/debug/trace_event.cc ('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 d1a46c92fbca89651dfe244462289c28cc3dc5c8..c9661e714d2ffcfdb0fccd56b56e7e9488b08e69 100644
--- a/base/file_util.cc
+++ b/base/file_util.cc
@@ -315,13 +315,11 @@ MemoryMappedFile::~MemoryMappedFile() {
CloseHandles();
}
-bool MemoryMappedFile::Initialize(base::PlatformFile file) {
+bool MemoryMappedFile::Initialize(const FilePath& file_name) {
if (IsValid())
return false;
- file_ = file;
-
- if (!MapFileToMemoryInternal()) {
+ if (!MapFileToMemory(file_name)) {
CloseHandles();
return false;
}
@@ -329,11 +327,13 @@ bool MemoryMappedFile::Initialize(base::PlatformFile file) {
return true;
}
-bool MemoryMappedFile::Initialize(const FilePath& file_name) {
+bool MemoryMappedFile::Initialize(base::PlatformFile file) {
if (IsValid())
return false;
- if (!MapFileToMemory(file_name)) {
+ file_ = file;
+
+ if (!MapFileToMemoryInternal()) {
CloseHandles();
return false;
}
@@ -341,6 +341,10 @@ bool MemoryMappedFile::Initialize(const FilePath& file_name) {
return true;
}
+bool MemoryMappedFile::IsValid() {
+ return data_ != NULL;
+}
+
bool MemoryMappedFile::MapFileToMemory(const FilePath& file_name) {
file_ = base::CreatePlatformFile(
file_name, base::PLATFORM_FILE_OPEN | base::PLATFORM_FILE_READ,
@@ -354,10 +358,6 @@ bool MemoryMappedFile::MapFileToMemory(const FilePath& file_name) {
return MapFileToMemoryInternal();
}
-bool MemoryMappedFile::IsValid() {
- return data_ != NULL;
-}
-
// Deprecated functions ----------------------------------------------------
#if defined(OS_WIN)
« no previous file with comments | « base/debug/trace_event.cc ('k') | base/file_util_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698