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

Unified Diff: net/disk_cache/blockfile/backend_impl.cc

Issue 206453003: Move Preload() code to MappedFile (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reworded comment Created 6 years, 9 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 | « no previous file | net/disk_cache/blockfile/block_files.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/blockfile/backend_impl.cc
diff --git a/net/disk_cache/blockfile/backend_impl.cc b/net/disk_cache/blockfile/backend_impl.cc
index 85c4e36c1f3c5fff79290b0180e6db9d9ccfeae1..af84b10f169e3d3e4570f0def5f5fd31dc475fef 100644
--- a/net/disk_cache/blockfile/backend_impl.cc
+++ b/net/disk_cache/blockfile/backend_impl.cc
@@ -1285,7 +1285,7 @@ bool BackendImpl::InitBackingStore(bool* file_created) {
return false;
index_ = new MappedFile();
- data_ = reinterpret_cast<Index*>(index_->Init(index_name, 0));
+ data_ = static_cast<Index*>(index_->Init(index_name, 0));
if (!data_) {
LOG(ERROR) << "Unable to map Index file";
return false;
@@ -2016,9 +2016,8 @@ bool BackendImpl::CheckIndex() {
if (!mask_)
mask_ = data_->header.table_len - 1;
- // Load the table into memory with a single read.
- scoped_ptr<char[]> buf(new char[current_size]);
- return index_->Read(buf.get(), current_size, 0);
+ // Load the table into memory.
+ return index_->Preload();
}
int BackendImpl::CheckAllEntries() {
« no previous file with comments | « no previous file | net/disk_cache/blockfile/block_files.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698