Index: net/disk_cache/simple/simple_entry_impl.cc |
diff --git a/net/disk_cache/simple/simple_entry_impl.cc b/net/disk_cache/simple/simple_entry_impl.cc |
index dc395d67e84eac208ad8465809331bb07dc867ac..98ad8a7392439920bacbf3c6a5a830ebef532923 100644 |
--- a/net/disk_cache/simple/simple_entry_impl.cc |
+++ b/net/disk_cache/simple/simple_entry_impl.cc |
@@ -161,6 +161,8 @@ class SimpleEntryImpl::ScopedOperationRunner { |
SimpleEntryImpl* const entry_; |
}; |
+SimpleEntryImpl::ActiveEntryProxy::~ActiveEntryProxy() {} |
+ |
SimpleEntryImpl::SimpleEntryImpl(net::CacheType cache_type, |
const FilePath& path, |
const uint64 entry_hash, |
@@ -196,6 +198,12 @@ SimpleEntryImpl::SimpleEntryImpl(net::CacheType cache_type, |
CreateNetLogSimpleEntryConstructionCallback(this)); |
} |
+void SimpleEntryImpl::SetActiveEntryProxy( |
+ scoped_ptr<ActiveEntryProxy> active_entry_proxy) { |
+ DCHECK(!active_entry_proxy_); |
+ active_entry_proxy_.reset(active_entry_proxy.release()); |
+} |
+ |
int SimpleEntryImpl::OpenEntry(Entry** out_entry, |
const CompletionCallback& callback) { |
DCHECK(backend_.get()); |
@@ -526,7 +534,6 @@ SimpleEntryImpl::~SimpleEntryImpl() { |
DCHECK_EQ(0U, pending_operations_.size()); |
DCHECK(state_ == STATE_UNINITIALIZED || state_ == STATE_FAILURE); |
DCHECK(!synchronous_entry_); |
- RemoveSelfFromBackend(); |
net_log_.EndEvent(net::NetLog::TYPE_SIMPLE_CACHE_ENTRY); |
} |
@@ -568,18 +575,12 @@ void SimpleEntryImpl::ReturnEntryToCaller(Entry** out_entry) { |
*out_entry = this; |
} |
-void SimpleEntryImpl::RemoveSelfFromBackend() { |
- if (!backend_.get()) |
- return; |
- backend_->OnDeactivated(this); |
-} |
- |
void SimpleEntryImpl::MarkAsDoomed() { |
doomed_ = true; |
if (!backend_.get()) |
return; |
backend_->index()->Remove(entry_hash_); |
- RemoveSelfFromBackend(); |
+ active_entry_proxy_.reset(); |
} |
void SimpleEntryImpl::RunNextOperationIfNeeded() { |