Index: net/disk_cache/mapped_file_win.cc |
=================================================================== |
--- net/disk_cache/mapped_file_win.cc (revision 199883) |
+++ net/disk_cache/mapped_file_win.cc (working copy) |
@@ -28,14 +28,26 @@ |
view_size_ = size; |
// Make sure we detect hardware failures reading the headers. |
- size_t temp_len = size ? size : 4096; |
+ /*size_t temp_len = size ? size : 4096; |
scoped_ptr<char[]> temp(new char[temp_len]); |
if (!Read(temp.get(), temp_len, 0)) |
- return NULL; |
+ return NULL;*/ |
return buffer_; |
} |
+bool MappedFile::InitNoMap(const base::FilePath& name) { |
+ DCHECK(!init_); |
+ if (init_ || !File::Init(name)) |
+ return false; |
+ |
+ buffer_ = NULL; |
+ section_ = NULL; |
+ view_size_ = 0; |
+ init_ = true; |
+ return true; |
+} |
+ |
MappedFile::~MappedFile() { |
if (!init_) |
return; |
@@ -49,16 +61,6 @@ |
CloseHandle(section_); |
} |
-bool MappedFile::Load(const FileBlock* block) { |
- size_t offset = block->offset() + view_size_; |
- return Read(block->buffer(), block->size(), offset); |
-} |
- |
-bool MappedFile::Store(const FileBlock* block) { |
- size_t offset = block->offset() + view_size_; |
- return Write(block->buffer(), block->size(), offset); |
-} |
- |
void MappedFile::Flush() { |
} |