diff options
author | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-06 22:17:01 +0000 |
---|---|---|
committer | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-06 22:17:01 +0000 |
commit | 88feac14cb43bc5753e1a2f1a23ce9e40c2f7b12 (patch) | |
tree | 1cc6a292515b89f2f04132266c7324a450a81009 /net | |
parent | 4eb669c6dea2cc17d843fa4757e20edca0b8717c (diff) | |
download | chromium_src-88feac14cb43bc5753e1a2f1a23ce9e40c2f7b12.zip chromium_src-88feac14cb43bc5753e1a2f1a23ce9e40c2f7b12.tar.gz chromium_src-88feac14cb43bc5753e1a2f1a23ce9e40c2f7b12.tar.bz2 |
base::Bind: Convert chrome_benchmarking_message_filter.cc.
BUG=none
TEST=none
R=csilv
Review URL: http://codereview.chromium.org/8792006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@113263 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r-- | net/disk_cache/backend_impl.cc | 7 | ||||
-rw-r--r-- | net/disk_cache/backend_impl.h | 2 | ||||
-rw-r--r-- | net/disk_cache/disk_cache.h | 2 | ||||
-rw-r--r-- | net/disk_cache/in_flight_backend_io.cc | 7 | ||||
-rw-r--r-- | net/disk_cache/in_flight_backend_io.h | 2 | ||||
-rw-r--r-- | net/disk_cache/mem_backend_impl.cc | 8 | ||||
-rw-r--r-- | net/disk_cache/mem_backend_impl.h | 2 | ||||
-rw-r--r-- | net/http/mock_http_cache.cc | 5 | ||||
-rw-r--r-- | net/http/mock_http_cache.h | 2 |
9 files changed, 37 insertions, 0 deletions
diff --git a/net/disk_cache/backend_impl.cc b/net/disk_cache/backend_impl.cc index cf9c6e1..d452f22 100644 --- a/net/disk_cache/backend_impl.cc +++ b/net/disk_cache/backend_impl.cc @@ -1451,6 +1451,13 @@ int BackendImpl::OpenNextEntry(void** iter, Entry** next_entry, return net::ERR_IO_PENDING; } +int BackendImpl::OpenNextEntry(void** iter, Entry** next_entry, + const net::CompletionCallback& callback) { + DCHECK(!callback.is_null()); + background_queue_.OpenNextEntry(iter, next_entry, callback); + return net::ERR_IO_PENDING; +} + void BackendImpl::EndEnumeration(void** iter) { background_queue_.EndEnumeration(*iter); *iter = NULL; diff --git a/net/disk_cache/backend_impl.h b/net/disk_cache/backend_impl.h index 45af7e3..96ac24b 100644 --- a/net/disk_cache/backend_impl.h +++ b/net/disk_cache/backend_impl.h @@ -281,6 +281,8 @@ class NET_EXPORT_PRIVATE BackendImpl : public Backend { OldCompletionCallback* callback) OVERRIDE; virtual int OpenNextEntry(void** iter, Entry** next_entry, OldCompletionCallback* callback) OVERRIDE; + virtual int OpenNextEntry(void** iter, Entry** next_entry, + const net::CompletionCallback& callback) OVERRIDE; virtual void EndEnumeration(void** iter) OVERRIDE; virtual void GetStats(StatsItems* stats) OVERRIDE; virtual void OnExternalCacheHit(const std::string& key) OVERRIDE; diff --git a/net/disk_cache/disk_cache.h b/net/disk_cache/disk_cache.h index f6fda87..ca29cb2 100644 --- a/net/disk_cache/disk_cache.h +++ b/net/disk_cache/disk_cache.h @@ -135,6 +135,8 @@ class NET_EXPORT Backend { // therefore it does not impact the eviction ranking of the entry. virtual int OpenNextEntry(void** iter, Entry** next_entry, OldCompletionCallback* callback) = 0; + virtual int OpenNextEntry(void** iter, Entry** next_entry, + const net::CompletionCallback& callback) = 0; // Releases iter without returning the next entry. Whenever OpenNextEntry() // returns true, but the caller is not interested in continuing the diff --git a/net/disk_cache/in_flight_backend_io.cc b/net/disk_cache/in_flight_backend_io.cc index ffd326a..25d39a5 100644 --- a/net/disk_cache/in_flight_backend_io.cc +++ b/net/disk_cache/in_flight_backend_io.cc @@ -398,6 +398,13 @@ void InFlightBackendIO::OpenNextEntry(void** iter, Entry** next_entry, PostOperation(operation); } +void InFlightBackendIO::OpenNextEntry(void** iter, Entry** next_entry, + const net::CompletionCallback& callback) { + scoped_refptr<BackendIO> operation(new BackendIO(this, backend_, callback)); + operation->OpenNextEntry(iter, next_entry); + PostOperation(operation); +} + void InFlightBackendIO::OpenPrevEntry(void** iter, Entry** prev_entry, OldCompletionCallback* callback) { scoped_refptr<BackendIO> operation(new BackendIO(this, backend_, callback)); diff --git a/net/disk_cache/in_flight_backend_io.h b/net/disk_cache/in_flight_backend_io.h index 2b48e7b..3d66cdc 100644 --- a/net/disk_cache/in_flight_backend_io.h +++ b/net/disk_cache/in_flight_backend_io.h @@ -172,6 +172,8 @@ class InFlightBackendIO : public InFlightIO { net::OldCompletionCallback* callback); void OpenNextEntry(void** iter, Entry** next_entry, net::OldCompletionCallback* callback); + void OpenNextEntry(void** iter, Entry** next_entry, + const net::CompletionCallback& callback); void OpenPrevEntry(void** iter, Entry** prev_entry, net::OldCompletionCallback* callback); void EndEnumeration(void* iterator); diff --git a/net/disk_cache/mem_backend_impl.cc b/net/disk_cache/mem_backend_impl.cc index d760b39..8cdf0ac 100644 --- a/net/disk_cache/mem_backend_impl.cc +++ b/net/disk_cache/mem_backend_impl.cc @@ -216,6 +216,14 @@ int MemBackendImpl::OpenNextEntry(void** iter, Entry** next_entry, return net::ERR_FAILED; } +int MemBackendImpl::OpenNextEntry(void** iter, Entry** next_entry, + const net::CompletionCallback& callback) { + if (OpenNextEntry(iter, next_entry)) + return net::OK; + + return net::ERR_FAILED; +} + void MemBackendImpl::EndEnumeration(void** iter) { *iter = NULL; } diff --git a/net/disk_cache/mem_backend_impl.h b/net/disk_cache/mem_backend_impl.h index b6153d5..85b0144 100644 --- a/net/disk_cache/mem_backend_impl.h +++ b/net/disk_cache/mem_backend_impl.h @@ -87,6 +87,8 @@ class NET_EXPORT_PRIVATE MemBackendImpl : public Backend { OldCompletionCallback* callback) OVERRIDE; virtual int OpenNextEntry(void** iter, Entry** next_entry, OldCompletionCallback* callback) OVERRIDE; + virtual int OpenNextEntry(void** iter, Entry** next_entry, + const net::CompletionCallback& callback) OVERRIDE; virtual void EndEnumeration(void** iter) OVERRIDE; virtual void GetStats( std::vector<std::pair<std::string, std::string> >* stats) OVERRIDE {} diff --git a/net/http/mock_http_cache.cc b/net/http/mock_http_cache.cc index c34fe4a..4ff840d 100644 --- a/net/http/mock_http_cache.cc +++ b/net/http/mock_http_cache.cc @@ -637,6 +637,11 @@ int MockDiskCache::OpenNextEntry(void** iter, disk_cache::Entry** next_entry, return net::ERR_NOT_IMPLEMENTED; } +int MockDiskCache::OpenNextEntry(void** iter, disk_cache::Entry** next_entry, + const net::CompletionCallback& callback) { + return net::ERR_NOT_IMPLEMENTED; +} + void MockDiskCache::EndEnumeration(void** iter) { } diff --git a/net/http/mock_http_cache.h b/net/http/mock_http_cache.h index f76a44b..d2c8853 100644 --- a/net/http/mock_http_cache.h +++ b/net/http/mock_http_cache.h @@ -127,6 +127,8 @@ class MockDiskCache : public disk_cache::Backend { net::OldCompletionCallback* callback) OVERRIDE; virtual int OpenNextEntry(void** iter, disk_cache::Entry** next_entry, net::OldCompletionCallback* callback) OVERRIDE; + virtual int OpenNextEntry(void** iter, disk_cache::Entry** next_entry, + const net::CompletionCallback& callback) OVERRIDE; virtual void EndEnumeration(void** iter) OVERRIDE; virtual void GetStats( std::vector<std::pair<std::string, std::string> >* stats) OVERRIDE; |