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

Unified Diff: net/disk_cache/mapped_file_win.cc

Issue 15203004: Disk cache: Reference CL for the implementation of file format version 3. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: IndexTable review Created 7 years, 1 month 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 | « net/disk_cache/mapped_file.h ('k') | net/disk_cache/mem_entry_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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() {
}
« no previous file with comments | « net/disk_cache/mapped_file.h ('k') | net/disk_cache/mem_entry_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698