Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(101)

Unified Diff: net/disk_cache/blockfile/backend_impl_v3.cc

Issue 542733002: Remove void** from disk_cache interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: narrowest, remove unused function Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/disk_cache/blockfile/backend_impl_v3.cc
diff --git a/net/disk_cache/blockfile/backend_impl_v3.cc b/net/disk_cache/blockfile/backend_impl_v3.cc
index e5c6033ebb99086ed41d30e283e0e912aac4fce0..58a0ff8b7a7e52ffea95ffd449e27c67f451b471 100644
--- a/net/disk_cache/blockfile/backend_impl_v3.cc
+++ b/net/disk_cache/blockfile/backend_impl_v3.cc
@@ -668,10 +668,32 @@ int BackendImplV3::DoomEntriesSince(base::Time initial_time,
}
}
-int BackendImplV3::OpenNextEntry(void** iter, Entry** next_entry,
+int BackendImplV3::OpenNextEntry(Iterator* iter, Entry** next_entry,
const CompletionCallback& callback) {
+ // TODO(gavinp): Remove all void** iter from cache.
DCHECK(!callback.is_null());
- background_queue_.OpenNextEntry(iter, next_entry, callback);
+ class State : public EnumerationState {
+ public:
+ State(base::WeakPtr<InFlightBackendIO> background_queue)
+ : background_queue_(background_queue),
+ iter_(NULL) {}
+
+ virtual ~State() {
+ if (background_queue_)
+ background_queue_->EndEnumeration(*iter());
+ }
+
+ void** iter() { return &iter_; }
+
+ private:
+ base::WeakPtr<InFlightBackendIO> background_queue_;
+ void* iter_;
+ };
+ if (!*iter)
+ iter->reset(new State(GetBackgroundQueue()));
+ State* state = static_cast<State*>(iter->get());
+
+ background_queue_.OpenNextEntry(state->iter(), next_entry, callback);
return net::ERR_IO_PENDING;
}
@@ -1585,15 +1607,11 @@ int BackendImplV3::DoomEntriesSince(base::Time initial_time,
return net::ERR_FAILED;
}
-int BackendImplV3::OpenNextEntry(void** iter, Entry** next_entry,
+int BackendImplV3::OpenNextEntry(Iterator* iter, Entry** next_entry,
const CompletionCallback& callback) {
return net::ERR_FAILED;
}
-void BackendImplV3::EndEnumeration(void** iter) {
- NOTIMPLEMENTED();
-}
-
void BackendImplV3::GetStats(StatsItems* stats) {
NOTIMPLEMENTED();
}

Powered by Google App Engine
This is Rietveld 408576698