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

Side by Side Diff: net/disk_cache/blockfile/disk_cache_perftest.cc

Issue 1894733002: Change scoped_ptr to std::unique_ptr in //net/disk_cache. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months 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 unified diff | Download patch
« no previous file with comments | « net/disk_cache/blockfile/block_files.cc ('k') | net/disk_cache/blockfile/entry_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « net/disk_cache/blockfile/block_files.cc ('k') | net/disk_cache/blockfile/entry_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698