diff options
author | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-12 20:41:01 +0000 |
---|---|---|
committer | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-12 20:41:01 +0000 |
commit | 275dbf43124797427aad10c3bcb2fb59844fa88e (patch) | |
tree | d6e825f202bfb252c350903c815754c206cb4e36 /net/disk_cache | |
parent | c3b46a5eadb75d2d4208fcb90240917ae6f12e4f (diff) | |
download | chromium_src-275dbf43124797427aad10c3bcb2fb59844fa88e.zip chromium_src-275dbf43124797427aad10c3bcb2fb59844fa88e.tar.gz chromium_src-275dbf43124797427aad10c3bcb2fb59844fa88e.tar.bz2 |
Reland r113263 rebased after revert of r113249.
base::Bind: Convert chrome_benchmarking_message_filter.cc.
BUG=none
TEST=none
R=csilv,ajwong
Review URL: http://codereview.chromium.org/8897026
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@114072 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/disk_cache')
-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 |
7 files changed, 30 insertions, 0 deletions
diff --git a/net/disk_cache/backend_impl.cc b/net/disk_cache/backend_impl.cc index 4ffac86..1443f7f 100644 --- a/net/disk_cache/backend_impl.cc +++ b/net/disk_cache/backend_impl.cc @@ -1437,6 +1437,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 80998c4..3563fde 100644 --- a/net/disk_cache/backend_impl.h +++ b/net/disk_cache/backend_impl.h @@ -277,6 +277,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 d220d91..3f52e23 100644 --- a/net/disk_cache/disk_cache.h +++ b/net/disk_cache/disk_cache.h @@ -131,6 +131,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 eb42b2a..868ceed 100644 --- a/net/disk_cache/in_flight_backend_io.cc +++ b/net/disk_cache/in_flight_backend_io.cc @@ -384,6 +384,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 992d3c4..aa6979c 100644 --- a/net/disk_cache/in_flight_backend_io.h +++ b/net/disk_cache/in_flight_backend_io.h @@ -168,6 +168,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 226050c..a5165ed 100644 --- a/net/disk_cache/mem_backend_impl.cc +++ b/net/disk_cache/mem_backend_impl.cc @@ -200,6 +200,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 326bfba..da94425 100644 --- a/net/disk_cache/mem_backend_impl.h +++ b/net/disk_cache/mem_backend_impl.h @@ -83,6 +83,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 {} |