| Index: net/disk_cache/simple/simple_synchronous_entry.cc
|
| diff --git a/net/disk_cache/simple/simple_synchronous_entry.cc b/net/disk_cache/simple/simple_synchronous_entry.cc
|
| index 19598f36e6a0aecaa1820742c44021b50b82225b..c380c7916aba33ea7a9f736f02a34bfc75eea808 100644
|
| --- a/net/disk_cache/simple/simple_synchronous_entry.cc
|
| +++ b/net/disk_cache/simple/simple_synchronous_entry.cc
|
| @@ -17,7 +17,6 @@
|
| #include "base/task_runner.h"
|
| #include "net/base/io_buffer.h"
|
| #include "net/base/net_errors.h"
|
| -#include "net/disk_cache/simple/simple_disk_format.h"
|
|
|
| using base::ClosePlatformFile;
|
| using base::GetPlatformFileInfo;
|
| @@ -102,7 +101,7 @@ void SimpleSynchronousEntry::DoomEntry(
|
| const std::string& key,
|
| scoped_refptr<TaskRunner> callback_runner,
|
| const net::CompletionCallback& callback) {
|
| - for (int i = 0; i < kIndexCount; ++i) {
|
| + for (int i = 0; i < kSimpleEntryFileCount; ++i) {
|
| bool delete_result =
|
| file_util::Delete(path.AppendASCII(GetFilenameForKeyAndIndex(key, i)),
|
| false);
|
| @@ -124,7 +123,7 @@ void SimpleSynchronousEntry::DoomAndClose() {
|
| }
|
|
|
| void SimpleSynchronousEntry::Close() {
|
| - for (int i = 0; i < kIndexCount; ++i) {
|
| + for (int i = 0; i < kSimpleEntryFileCount; ++i) {
|
| bool result = ClosePlatformFile(files_[i]);
|
| DCHECK(result);
|
| }
|
| @@ -208,7 +207,7 @@ SimpleSynchronousEntry::~SimpleSynchronousEntry() {
|
| }
|
|
|
| bool SimpleSynchronousEntry::OpenOrCreateFiles(bool create) {
|
| - for (int i = 0; i < kIndexCount; ++i) {
|
| + for (int i = 0; i < kSimpleEntryFileCount; ++i) {
|
| FilePath filename = path_.AppendASCII(GetFilenameForKeyAndIndex(key_, i));
|
| int flags = PLATFORM_FILE_READ | PLATFORM_FILE_WRITE;
|
| if (create)
|
| @@ -226,7 +225,7 @@ bool SimpleSynchronousEntry::OpenOrCreateFiles(bool create) {
|
| }
|
| }
|
|
|
| - for (int i = 0; i < kIndexCount; ++i) {
|
| + for (int i = 0; i < kSimpleEntryFileCount; ++i) {
|
| PlatformFileInfo file_info;
|
| CHECK(GetPlatformFileInfo(files_[i], &file_info));
|
| last_used_ = std::max(last_used_, file_info.last_accessed);
|
| @@ -242,7 +241,7 @@ bool SimpleSynchronousEntry::InitializeForOpen() {
|
| if (!OpenOrCreateFiles(false))
|
| return false;
|
|
|
| - for (int i = 0; i < kIndexCount; ++i) {
|
| + for (int i = 0; i < kSimpleEntryFileCount; ++i) {
|
| SimpleFileHeader header;
|
| if (ReadPlatformFile(files_[i], 0, reinterpret_cast<char*>(&header),
|
| sizeof(header)) != sizeof(header)) {
|
| @@ -300,7 +299,7 @@ bool SimpleSynchronousEntry::InitializeForCreate() {
|
| return false;
|
| }
|
|
|
| - for (int i = 0; i < kIndexCount; ++i) {
|
| + for (int i = 0; i < kSimpleEntryFileCount; ++i) {
|
| SimpleFileHeader header;
|
| header.initial_magic_number = kSimpleInitialMagicNumber;
|
| header.version = kSimpleVersion;
|
|
|