| 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)
|
|
|