| Index: base/files/memory_mapped_file.cc
|
| diff --git a/base/files/memory_mapped_file.cc b/base/files/memory_mapped_file.cc
|
| index ace4e112628519137e7f56fbfb36f6176c2e8e83..01de9248138c081f73883b815a69638bb118a6f8 100644
|
| --- a/base/files/memory_mapped_file.cc
|
| +++ b/base/files/memory_mapped_file.cc
|
| @@ -24,7 +24,7 @@ bool MemoryMappedFile::Initialize(const FilePath& file_name) {
|
| return false;
|
| }
|
|
|
| - if (!MapFileToMemory()) {
|
| + if (!MapFileToMemory(base::File::Region(file_))) {
|
| CloseHandles();
|
| return false;
|
| }
|
| @@ -33,12 +33,17 @@ bool MemoryMappedFile::Initialize(const FilePath& file_name) {
|
| }
|
|
|
| bool MemoryMappedFile::Initialize(File file) {
|
| + const base::File::Region whole_file(file);
|
| + return Initialize(file.Pass(), whole_file);
|
| +}
|
| +
|
| +bool MemoryMappedFile::Initialize(File file, const base::File::Region& region) {
|
| if (IsValid())
|
| return false;
|
|
|
| file_ = file.Pass();
|
|
|
| - if (!MapFileToMemory()) {
|
| + if (!MapFileToMemory(region)) {
|
| CloseHandles();
|
| return false;
|
| }
|
|
|