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

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

Issue 542733002: Remove void** from disk_cache interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix EnumerateAndMatchKeys 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
« no previous file with comments | « net/disk_cache/blockfile/backend_impl.h ('k') | net/disk_cache/blockfile/backend_impl_v3.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/blockfile/backend_impl.cc
diff --git a/net/disk_cache/blockfile/backend_impl.cc b/net/disk_cache/blockfile/backend_impl.cc
index c38b2bb9e33b49fa7e4945edc7380b235b5d3b8a..e3683286ed04efc638ebb74462222d2c0982014d 100644
--- a/net/disk_cache/blockfile/backend_impl.cc
+++ b/net/disk_cache/blockfile/backend_impl.cc
@@ -1250,16 +1250,27 @@ int BackendImpl::DoomEntriesSince(const base::Time initial_time,
return net::ERR_IO_PENDING;
}
-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;
-}
+class BackendImpl::IteratorImpl : public Backend::Iterator {
+ public:
+ explicit IteratorImpl(base::WeakPtr<InFlightBackendIO> background_queue)
+ : background_queue_(background_queue), data_(NULL) {
+ }
-void BackendImpl::EndEnumeration(void** iter) {
- background_queue_.EndEnumeration(*iter);
gavinp 2014/09/19 16:09:35 This turns out to be important.
- *iter = 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_;
+};
+
+scoped_ptr<Backend::Iterator> BackendImpl::CreateIterator() {
+ return scoped_ptr<Backend::Iterator>(new IteratorImpl(GetBackgroundQueue()));
}
void BackendImpl::GetStats(StatsItems* stats) {
« no previous file with comments | « net/disk_cache/blockfile/backend_impl.h ('k') | net/disk_cache/blockfile/backend_impl_v3.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698