summaryrefslogtreecommitdiffstats
path: root/net/http
diff options
context:
space:
mode:
authorgavinp <gavinp@chromium.org>2014-09-20 06:20:43 -0700
committerCommit bot <commit-bot@chromium.org>2014-09-20 13:21:01 +0000
commitedbfba945a76d97383122a01529abfe3ce63d34d (patch)
tree42ed81a84d4c746fa29dc24db7f44113489bfbb1 /net/http
parent8ba4546fd0922508e212348f19dd2b624290c683 (diff)
downloadchromium_src-edbfba945a76d97383122a01529abfe3ce63d34d.zip
chromium_src-edbfba945a76d97383122a01529abfe3ce63d34d.tar.gz
chromium_src-edbfba945a76d97383122a01529abfe3ce63d34d.tar.bz2
Reland of "Remove void** from disk_cache interface."
Enumeration and iteration were passing around void**. With this CL, we instead use an Iterator object. TBR=clamy@chromium.org,jkarlin@chromium.org,jsbell@chromium.org BUG=413644 Review URL: https://codereview.chromium.org/583283002 Cr-Commit-Position: refs/heads/master@{#295870}
Diffstat (limited to 'net/http')
-rw-r--r--net/http/mock_http_cache.cc14
-rw-r--r--net/http/mock_http_cache.h5
2 files changed, 11 insertions, 8 deletions
diff --git a/net/http/mock_http_cache.cc b/net/http/mock_http_cache.cc
index a91b2c1..cbae9b8 100644
--- a/net/http/mock_http_cache.cc
+++ b/net/http/mock_http_cache.cc
@@ -457,12 +457,16 @@ int MockDiskCache::DoomEntriesSince(const base::Time initial_time,
return net::ERR_NOT_IMPLEMENTED;
}
-int MockDiskCache::OpenNextEntry(void** iter, disk_cache::Entry** next_entry,
- const net::CompletionCallback& callback) {
- return net::ERR_NOT_IMPLEMENTED;
-}
+class MockDiskCache::NotImplementedIterator : public Iterator {
+ public:
+ virtual int OpenNextEntry(disk_cache::Entry** next_entry,
+ const net::CompletionCallback& callback) OVERRIDE {
+ return net::ERR_NOT_IMPLEMENTED;
+ }
+};
-void MockDiskCache::EndEnumeration(void** iter) {
+scoped_ptr<disk_cache::Backend::Iterator> MockDiskCache::CreateIterator() {
+ return scoped_ptr<Iterator>(new NotImplementedIterator());
}
void MockDiskCache::GetStats(
diff --git a/net/http/mock_http_cache.h b/net/http/mock_http_cache.h
index 5ead727..ab63b11 100644
--- a/net/http/mock_http_cache.h
+++ b/net/http/mock_http_cache.h
@@ -114,9 +114,7 @@ class MockDiskCache : public disk_cache::Backend {
virtual int DoomEntriesSince(
base::Time initial_time,
const net::CompletionCallback& callback) OVERRIDE;
- virtual int OpenNextEntry(void** iter, disk_cache::Entry** next_entry,
- const net::CompletionCallback& callback) OVERRIDE;
- virtual void EndEnumeration(void** iter) OVERRIDE;
+ virtual scoped_ptr<Iterator> CreateIterator() OVERRIDE;
virtual void GetStats(
std::vector<std::pair<std::string, std::string> >* stats) OVERRIDE;
virtual void OnExternalCacheHit(const std::string& key) OVERRIDE;
@@ -143,6 +141,7 @@ class MockDiskCache : public disk_cache::Backend {
private:
typedef base::hash_map<std::string, MockDiskEntry*> EntryMap;
+ class NotImplementedIterator;
void CallbackLater(const net::CompletionCallback& callback, int result);