summaryrefslogtreecommitdiffstats
path: root/net/disk_cache/entry_impl.cc
diff options
context:
space:
mode:
authorrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-30 18:51:41 +0000
committerrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-30 18:51:41 +0000
commit66f16b11638993ead4028e853d5565a74b9acba3 (patch)
tree2166dd5ebb9d17d32f7fdd984425e15d58c66f0c /net/disk_cache/entry_impl.cc
parentd861c764cf88c5d99327ef15bb603373186c5bda (diff)
downloadchromium_src-66f16b11638993ead4028e853d5565a74b9acba3.zip
chromium_src-66f16b11638993ead4028e853d5565a74b9acba3.tar.gz
chromium_src-66f16b11638993ead4028e853d5565a74b9acba3.tar.bz2
Disk cache: Remove remaining uses of RankingsNode.pointer.
We now have a map of open entries so we don't need to do a lookup through the rankings node anymore. This simplifies the 64 bit version of the code. BUG=17881 TEST=unittests Review URL: http://codereview.chromium.org/159643 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22074 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/disk_cache/entry_impl.cc')
-rw-r--r--net/disk_cache/entry_impl.cc21
1 files changed, 4 insertions, 17 deletions
diff --git a/net/disk_cache/entry_impl.cc b/net/disk_cache/entry_impl.cc
index 334eb76..3493152 100644
--- a/net/disk_cache/entry_impl.cc
+++ b/net/disk_cache/entry_impl.cc
@@ -110,12 +110,6 @@ EntryImpl::~EntryImpl() {
entry_.Data()->data_size[index]);
}
}
- if (node_.HasData() && this == node_.Data()->pointer) {
- // We have to do this after Flush because we may trigger a cache trim from
- // there, and technically this entry should be "in use".
- node_.Data()->pointer = NULL;
- node_.set_modified();
- }
if (!ret) {
// There was a failure writing the actual data. Mark the entry as dirty.
@@ -398,7 +392,6 @@ bool EntryImpl::CreateEntry(Addr node_address, const std::string& key,
entry_store->rankings_node = node_address.value();
node->contents = entry_.address().value();
- node->pointer = this;
entry_store->hash = hash;
entry_store->creation_time = Time::Now().ToInternalValue();
@@ -515,12 +508,8 @@ bool EntryImpl::Update() {
DCHECK(node_.HasData());
RankingsNode* rankings = node_.Data();
- if (rankings->pointer) {
- // Nothing to do here, the entry was in memory.
- DCHECK(rankings->pointer == this);
- } else {
+ if (!rankings->dirty) {
rankings->dirty = backend_->GetCurrentEntryId();
- rankings->pointer = this;
if (!node_.Store())
return false;
}
@@ -531,7 +520,7 @@ bool EntryImpl::IsDirty(int32 current_id) {
DCHECK(node_.HasData());
// We are checking if the entry is valid or not. If there is a pointer here,
// we should not be checking the entry.
- if (node_.Data()->pointer)
+ if (node_.Data()->dummy)
return true;
return node_.Data()->dirty && current_id != node_.Data()->dirty;
@@ -543,7 +532,7 @@ void EntryImpl::ClearDirtyFlag() {
void EntryImpl::SetPointerForInvalidEntry(int32 new_id) {
node_.Data()->dirty = new_id;
- node_.Data()->pointer = this;
+ node_.Data()->dummy = 0;
node_.Store();
}
@@ -892,10 +881,8 @@ void EntryImpl::ReportIOTime(Operation op, const base::Time& start) {
}
void EntryImpl::Log(const char* msg) {
- void* pointer = NULL;
int dirty = 0;
if (node_.HasData()) {
- pointer = node_.Data()->pointer;
dirty = node_.Data()->dirty;
}
@@ -905,7 +892,7 @@ void EntryImpl::Log(const char* msg) {
Trace(" data: 0x%x 0x%x 0x%x", entry_.Data()->data_addr[0],
entry_.Data()->data_addr[1], entry_.Data()->long_key);
- Trace(" doomed: %d 0x%p 0x%x", doomed_, pointer, dirty);
+ Trace(" doomed: %d 0x%x", doomed_, dirty);
}
} // namespace disk_cache