| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/hash.h" | 9 #include "base/hash.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 timer.Done(); | 156 timer.Done(); |
| 157 } | 157 } |
| 158 | 158 |
| 159 TEST_F(DiskCacheTest, CacheBackendPerformance) { | 159 TEST_F(DiskCacheTest, CacheBackendPerformance) { |
| 160 base::Thread cache_thread("CacheThread"); | 160 base::Thread cache_thread("CacheThread"); |
| 161 ASSERT_TRUE(cache_thread.StartWithOptions( | 161 ASSERT_TRUE(cache_thread.StartWithOptions( |
| 162 base::Thread::Options(base::MessageLoop::TYPE_IO, 0))); | 162 base::Thread::Options(base::MessageLoop::TYPE_IO, 0))); |
| 163 | 163 |
| 164 ASSERT_TRUE(CleanupCacheDir()); | 164 ASSERT_TRUE(CleanupCacheDir()); |
| 165 net::TestCompletionCallback cb; | 165 net::TestCompletionCallback cb; |
| 166 scoped_ptr<disk_cache::Backend> cache; | 166 std::unique_ptr<disk_cache::Backend> cache; |
| 167 int rv = disk_cache::CreateCacheBackend(net::DISK_CACHE, | 167 int rv = disk_cache::CreateCacheBackend(net::DISK_CACHE, |
| 168 net::CACHE_BACKEND_BLOCKFILE, | 168 net::CACHE_BACKEND_BLOCKFILE, |
| 169 cache_path_, | 169 cache_path_, |
| 170 0, | 170 0, |
| 171 false, | 171 false, |
| 172 cache_thread.task_runner(), | 172 cache_thread.task_runner(), |
| 173 NULL, | 173 NULL, |
| 174 &cache, | 174 &cache, |
| 175 cb.callback()); | 175 cb.callback()); |
| 176 | 176 |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 | 251 |
| 252 files.DeleteBlock(address[entry], false); | 252 files.DeleteBlock(address[entry], false); |
| 253 EXPECT_TRUE(files.CreateBlock(disk_cache::RANKINGS, BlockSize(), | 253 EXPECT_TRUE(files.CreateBlock(disk_cache::RANKINGS, BlockSize(), |
| 254 &address[entry])); | 254 &address[entry])); |
| 255 } | 255 } |
| 256 | 256 |
| 257 timer2.Done(); | 257 timer2.Done(); |
| 258 base::MessageLoop::current()->RunUntilIdle(); | 258 base::MessageLoop::current()->RunUntilIdle(); |
| 259 delete[] address; | 259 delete[] address; |
| 260 } | 260 } |
| OLD | NEW |