Chromium Code Reviews| 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..5dbc4dcc4ed4101a0df333ba7c8fbd572aac99eb 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::BackendDisconnector::~BackendDisconnector() {} |
| + |
| 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::SetBackendDisconnector( |
| + scoped_ptr<BackendDisconnector> backend_disconnector) { |
| + DCHECK(!backend_disconnector_); |
| + backend_disconnector_.reset(backend_disconnector.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(); |
| + backend_disconnector_.reset(); |
|
Deprecated (see juliatuttle)
2014/08/22 19:26:38
I'd like a comment here making it clear that reset
gavinp
2014/08/25 13:18:27
I like your suggestion we rename this; I have gone
|
| } |
| void SimpleEntryImpl::RunNextOperationIfNeeded() { |