summaryrefslogtreecommitdiffstats
path: root/net/disk_cache/blockfile/backend_impl.cc
diff options
context:
space:
mode:
Diffstat (limited to 'net/disk_cache/blockfile/backend_impl.cc')
-rw-r--r--net/disk_cache/blockfile/backend_impl.cc29
1 files changed, 9 insertions, 20 deletions
diff --git a/net/disk_cache/blockfile/backend_impl.cc b/net/disk_cache/blockfile/backend_impl.cc
index e368328..c38b2bb 100644
--- a/net/disk_cache/blockfile/backend_impl.cc
+++ b/net/disk_cache/blockfile/backend_impl.cc
@@ -1250,27 +1250,16 @@ int BackendImpl::DoomEntriesSince(const base::Time initial_time,
return net::ERR_IO_PENDING;
}
-class BackendImpl::IteratorImpl : public Backend::Iterator {
- public:
- explicit IteratorImpl(base::WeakPtr<InFlightBackendIO> background_queue)
- : background_queue_(background_queue), data_(NULL) {
- }
-
- virtual int OpenNextEntry(Entry** next_entry,
- const net::CompletionCallback& callback) OVERRIDE {
- if (!background_queue_)
- return net::ERR_FAILED;
- background_queue_->OpenNextEntry(&data_, next_entry, callback);
- return net::ERR_IO_PENDING;
- }
-
- private:
- const base::WeakPtr<InFlightBackendIO> background_queue_;
- void* data_;
-};
+int BackendImpl::OpenNextEntry(void** iter, Entry** next_entry,
+ const CompletionCallback& callback) {
+ DCHECK(!callback.is_null());
+ background_queue_.OpenNextEntry(iter, next_entry, callback);
+ return net::ERR_IO_PENDING;
+}
-scoped_ptr<Backend::Iterator> BackendImpl::CreateIterator() {
- return scoped_ptr<Backend::Iterator>(new IteratorImpl(GetBackgroundQueue()));
+void BackendImpl::EndEnumeration(void** iter) {
+ background_queue_.EndEnumeration(*iter);
+ *iter = NULL;
}
void BackendImpl::GetStats(StatsItems* stats) {