Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(171)

Unified Diff: net/disk_cache/disk_cache_perftest.cc

Issue 15203004: Disk cache: Reference CL for the implementation of file format version 3. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: IndexTable review Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/disk_cache/cache_creator.cc ('k') | net/disk_cache/disk_cache_test_base.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/disk_cache_perftest.cc
===================================================================
--- net/disk_cache/disk_cache_perftest.cc (revision 199883)
+++ net/disk_cache/disk_cache_perftest.cc (working copy)
@@ -67,7 +67,7 @@
if (net::OK != cb.GetResult(rv))
break;
int ret = cache_entry->WriteData(
- 0, 0, buffer1, kSize1,
+ 0, 0, buffer1.get(), kSize1,
base::Bind(&CallbackTest::Run, base::Unretained(&callback)), false);
if (net::ERR_IO_PENDING == ret)
expected++;
@@ -75,7 +75,7 @@
break;
ret = cache_entry->WriteData(
- 1, 0, buffer2, entry.data_len,
+ 1, 0, buffer2.get(), entry.data_len,
base::Bind(&CallbackTest::Run, base::Unretained(&callback)), false);
if (net::ERR_IO_PENDING == ret)
expected++;
@@ -116,7 +116,7 @@
if (net::OK != cb.GetResult(rv))
break;
int ret = cache_entry->ReadData(
- 0, 0, buffer1, kSize1,
+ 0, 0, buffer1.get(), kSize1,
base::Bind(&CallbackTest::Run, base::Unretained(&callback)));
if (net::ERR_IO_PENDING == ret)
expected++;
@@ -124,7 +124,7 @@
break;
ret = cache_entry->ReadData(
- 1, 0, buffer2, entries[i].data_len,
+ 1, 0, buffer2.get(), entries[i].data_len,
base::Bind(&CallbackTest::Run, base::Unretained(&callback)));
if (net::ERR_IO_PENDING == ret)
expected++;
@@ -161,14 +161,14 @@
TEST_F(DiskCacheTest, CacheBackendPerformance) {
base::Thread cache_thread("CacheThread");
ASSERT_TRUE(cache_thread.StartWithOptions(
- base::Thread::Options(MessageLoop::TYPE_IO, 0)));
+ base::Thread::Options(base::MessageLoop::TYPE_IO, 0)));
ASSERT_TRUE(CleanupCacheDir());
net::TestCompletionCallback cb;
disk_cache::Backend* cache;
int rv = disk_cache::CreateCacheBackend(
net::DISK_CACHE, net::CACHE_BACKEND_BLOCKFILE, cache_path_, 0, false,
- cache_thread.message_loop_proxy(), NULL, &cache, cb.callback());
+ cache_thread.message_loop_proxy().get(), NULL, &cache, cb.callback());
ASSERT_EQ(net::OK, cb.GetResult(rv));
@@ -180,7 +180,7 @@
EXPECT_TRUE(TimeWrite(num_entries, cache, &entries));
- MessageLoop::current()->RunUntilIdle();
+ base::MessageLoop::current()->RunUntilIdle();
delete cache;
ASSERT_TRUE(file_util::EvictFileFromSystemCache(
@@ -196,15 +196,14 @@
rv = disk_cache::CreateCacheBackend(
net::DISK_CACHE, net::CACHE_BACKEND_BLOCKFILE, cache_path_, 0, false,
- cache_thread.message_loop_proxy(),
- NULL, &cache, cb.callback());
+ cache_thread.message_loop_proxy().get(), NULL, &cache, cb.callback());
ASSERT_EQ(net::OK, cb.GetResult(rv));
EXPECT_TRUE(TimeRead(num_entries, cache, entries, true));
EXPECT_TRUE(TimeRead(num_entries, cache, entries, false));
- MessageLoop::current()->RunUntilIdle();
+ base::MessageLoop::current()->RunUntilIdle();
delete cache;
}
@@ -217,7 +216,7 @@
ASSERT_TRUE(CleanupCacheDir());
disk_cache::BlockFiles files(cache_path_);
- ASSERT_TRUE(files.Init(true));
+ ASSERT_TRUE(files.Init(true, disk_cache::kFirstAdditionalBlockFile));
int seed = static_cast<int>(Time::Now().ToInternalValue());
srand(seed);
@@ -247,6 +246,6 @@
}
timer2.Done();
- MessageLoop::current()->RunUntilIdle();
+ base::MessageLoop::current()->RunUntilIdle();
delete[] address;
}
« no previous file with comments | « net/disk_cache/cache_creator.cc ('k') | net/disk_cache/disk_cache_test_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698