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

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

Issue 585833002: Revert of Remove void** from disk_cache interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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_v3.h ('k') | net/disk_cache/disk_cache.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_v3.cc
diff --git a/net/disk_cache/blockfile/backend_impl_v3.cc b/net/disk_cache/blockfile/backend_impl_v3.cc
index b44b1950abc9205b0d67bd3ff55533d8f0543442..9a7cff1c79000c8e9e41f9f7728da3bf025cc680 100644
--- a/net/disk_cache/blockfile/backend_impl_v3.cc
+++ b/net/disk_cache/blockfile/backend_impl_v3.cc
@@ -660,27 +660,17 @@
}
}
-class BackendImplV3::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_;
-};
-
-scoped_ptr<Backend::Iterator> BackendImplV3::CreateIterator() {
- return scoped_ptr<Backend::Iterator>(new IteratorImpl(GetBackgroundQueue()));
+int BackendImplV3::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;
+}
+
+void BackendImplV3::EndEnumeration(void** iter) {
+ scoped_ptr<IndexIterator> iterator(
+ reinterpret_cast<IndexIterator*>(*iter));
+ *iter = NULL;
}
void BackendImplV3::GetStats(StatsItems* stats) {
@@ -1507,17 +1497,13 @@
return net::ERR_FAILED;
}
-
-class BackendImplV3::NotImplementedIterator : public Backend::Iterator {
- public:
- virtual int OpenNextEntry(disk_cache::Entry** next_entry,
- const net::CompletionCallback& callback) OVERRIDE {
- return net::ERR_NOT_IMPLEMENTED;
- }
-};
-
-scoped_ptr<Backend::Iterator> BackendImplV3::CreateIterator() {
- return scoped_ptr<Iterator>(new NotImplementedIterator());
+int BackendImplV3::OpenNextEntry(void** iter, Entry** next_entry,
+ const CompletionCallback& callback) {
+ return net::ERR_FAILED;
+}
+
+void BackendImplV3::EndEnumeration(void** iter) {
+ NOTIMPLEMENTED();
}
void BackendImplV3::GetStats(StatsItems* stats) {
« no previous file with comments | « net/disk_cache/blockfile/backend_impl_v3.h ('k') | net/disk_cache/disk_cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698