| Index: net/http/http_cache_unittest.cc
|
| diff --git a/net/http/http_cache_unittest.cc b/net/http/http_cache_unittest.cc
|
| index 93f7476f03939445ec7531f4ed8d8c8d8752db2e..0c0ff6f966bfd888f7c0ca1bf28cc18e9f432011 100644
|
| --- a/net/http/http_cache_unittest.cc
|
| +++ b/net/http/http_cache_unittest.cc
|
| @@ -11,7 +11,6 @@
|
| #include "base/stringprintf.h"
|
| #include "net/base/cache_type.h"
|
| #include "net/base/cert_status_flags.h"
|
| -#include "net/base/completion_callback.h"
|
| #include "net/base/host_port_pair.h"
|
| #include "net/base/load_flags.h"
|
| #include "net/base/net_errors.h"
|
| @@ -33,27 +32,18 @@ using base::Time;
|
|
|
| namespace {
|
|
|
| -class DeleteCacheCompletionCallback : public TestCompletionCallbackBase {
|
| +class DeleteCacheOldCompletionCallback : public TestOldCompletionCallback {
|
| public:
|
| - explicit DeleteCacheCompletionCallback(MockHttpCache* cache)
|
| - : cache_(cache),
|
| - ALLOW_THIS_IN_INITIALIZER_LIST(callback_(
|
| - base::Bind(&DeleteCacheCompletionCallback::OnComplete,
|
| - base::Unretained(this)))) {
|
| - }
|
| -
|
| - const net::CompletionCallback& callback() const { return callback_; }
|
| + explicit DeleteCacheOldCompletionCallback(MockHttpCache* cache)
|
| + : cache_(cache) {}
|
|
|
| - private:
|
| - void OnComplete(int result) {
|
| + virtual void RunWithParams(const Tuple1<int>& params) {
|
| delete cache_;
|
| - SetResult(result);
|
| + TestOldCompletionCallback::RunWithParams(params);
|
| }
|
|
|
| + private:
|
| MockHttpCache* cache_;
|
| - const net::CompletionCallback callback_;
|
| -
|
| - DISALLOW_COPY_AND_ASSIGN(DeleteCacheCompletionCallback);
|
| };
|
|
|
| //-----------------------------------------------------------------------------
|
| @@ -405,9 +395,9 @@ TEST(HttpCache, GetBackend) {
|
| MockHttpCache cache(net::HttpCache::DefaultBackend::InMemory(0));
|
|
|
| disk_cache::Backend* backend;
|
| - net::TestCompletionCallback cb;
|
| + TestOldCompletionCallback cb;
|
| // This will lazily initialize the backend.
|
| - int rv = cache.http_cache()->GetBackend(&backend, cb.callback());
|
| + int rv = cache.http_cache()->GetBackend(&backend, &cb);
|
| EXPECT_EQ(net::OK, cb.GetResult(rv));
|
| }
|
|
|
| @@ -1475,9 +1465,9 @@ TEST(HttpCache, DeleteCacheWaitingForBackend2) {
|
| MockBlockingBackendFactory* factory = new MockBlockingBackendFactory();
|
| MockHttpCache* cache = new MockHttpCache(factory);
|
|
|
| - DeleteCacheCompletionCallback cb(cache);
|
| + DeleteCacheOldCompletionCallback cb(cache);
|
| disk_cache::Backend* backend;
|
| - int rv = cache->http_cache()->GetBackend(&backend, cb.callback());
|
| + int rv = cache->http_cache()->GetBackend(&backend, &cb);
|
| EXPECT_EQ(net::ERR_IO_PENDING, rv);
|
|
|
| // Now let's queue a regular transaction
|
| @@ -1490,8 +1480,8 @@ TEST(HttpCache, DeleteCacheWaitingForBackend2) {
|
| c->trans->Start(&request, &c->callback, net::BoundNetLog());
|
|
|
| // And another direct backend request.
|
| - net::TestCompletionCallback cb2;
|
| - rv = cache->http_cache()->GetBackend(&backend, cb2.callback());
|
| + TestOldCompletionCallback cb2;
|
| + rv = cache->http_cache()->GetBackend(&backend, &cb2);
|
| EXPECT_EQ(net::ERR_IO_PENDING, rv);
|
|
|
| // Just to make sure that everything is still pending.
|
|
|