| Index: net/disk_cache/blockfile/mapped_file.cc
|
| diff --git a/net/disk_cache/blockfile/mapped_file.cc b/net/disk_cache/blockfile/mapped_file.cc
|
| index 4b0f27fc0972da59294c07d0bb6b45c7575a7e9d..d26cead89aab2064646b598e8b7b0ac5f0520c1e 100644
|
| --- a/net/disk_cache/blockfile/mapped_file.cc
|
| +++ b/net/disk_cache/blockfile/mapped_file.cc
|
| @@ -4,6 +4,10 @@
|
|
|
| #include "net/disk_cache/blockfile/mapped_file.h"
|
|
|
| +#include <algorithm>
|
| +
|
| +#include "base/memory/scoped_ptr.h"
|
| +
|
| namespace disk_cache {
|
|
|
| // Note: Most of this class is implemented in platform-specific files.
|
| @@ -32,4 +36,11 @@ bool MappedFile::Store(const FileBlock* block,
|
| return Write(block->buffer(), block->size(), offset, callback, completed);
|
| }
|
|
|
| +bool MappedFile::Preload() {
|
| + size_t file_len = GetLength();
|
| + scoped_ptr<char[]> buf(new char[file_len]);
|
| + if (!Read(buf.get(), file_len, 0))
|
| + return false;
|
| + return true;
|
| +}
|
| } // namespace disk_cache
|
|
|