summaryrefslogtreecommitdiffstats
path: root/net/disk_cache/stress_cache.cc
diff options
context:
space:
mode:
authorjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-16 19:25:48 +0000
committerjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-16 19:25:48 +0000
commit915f251d0504a176e4a612a2b2ff2b00592a8819 (patch)
treed1005c9105f1308ab05ae8e93684f43f8da50041 /net/disk_cache/stress_cache.cc
parentbadc5a57fd63efdb03ce99e65d4dd9e90a2f870e (diff)
downloadchromium_src-915f251d0504a176e4a612a2b2ff2b00592a8819.zip
chromium_src-915f251d0504a176e4a612a2b2ff2b00592a8819.tar.gz
chromium_src-915f251d0504a176e4a612a2b2ff2b00592a8819.tar.bz2
base::Bind: Remove even moar OldCompletionCallback.
BUG=none TEST=none R=dpapad Review URL: http://codereview.chromium.org/8947024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@114838 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/disk_cache/stress_cache.cc')
-rw-r--r--net/disk_cache/stress_cache.cc22
1 files changed, 12 insertions, 10 deletions
diff --git a/net/disk_cache/stress_cache.cc b/net/disk_cache/stress_cache.cc
index a18df2a..52abb16 100644
--- a/net/disk_cache/stress_cache.cc
+++ b/net/disk_cache/stress_cache.cc
@@ -113,8 +113,8 @@ void StressTheCache(int iteration) {
cache->SetMaxSize(cache_size);
cache->SetFlags(disk_cache::kNoLoadProtection);
- TestOldCompletionCallback cb;
- int rv = cache->Init(&cb);
+ net::TestCompletionCallback cb;
+ int rv = cache->Init(cb.callback());
if (cb.GetResult(rv) != net::OK) {
printf("Unable to initialize cache.\n");
@@ -154,22 +154,24 @@ void StressTheCache(int iteration) {
if (entries[slot])
entries[slot]->Close();
- rv = cache->OpenEntry(keys[key], &entries[slot], &cb);
- if (cb.GetResult(rv) != net::OK) {
- rv = cache->CreateEntry(keys[key], &entries[slot], &cb);
- CHECK_EQ(net::OK, cb.GetResult(rv));
+ TestOldCompletionCallback old_cb;
+ rv = cache->OpenEntry(keys[key], &entries[slot], &old_cb);
+ if (old_cb.GetResult(rv) != net::OK) {
+ rv = cache->CreateEntry(keys[key], &entries[slot], &old_cb);
+ CHECK_EQ(net::OK, old_cb.GetResult(rv));
}
base::snprintf(buffer->data(), kSize,
"i: %d iter: %d, size: %d, truncate: %d ", i, iteration,
size, truncate ? 1 : 0);
- rv = entries[slot]->WriteData(0, 0, buffer, size, &cb, truncate);
- CHECK_EQ(size, cb.GetResult(rv));
+ rv = entries[slot]->WriteData(0, 0, buffer, size, &old_cb, truncate);
+ CHECK_EQ(size, old_cb.GetResult(rv));
if (rand() % 100 > 80) {
key = rand() % kNumKeys;
- rv = cache->DoomEntry(keys[key], &cb);
- cb.GetResult(rv);
+ net::TestCompletionCallback cb2;
+ rv = cache->DoomEntry(keys[key], cb2.callback());
+ cb2.GetResult(rv);
}
if (!(i % 100))