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

Side by Side Diff: net/disk_cache/disk_cache_test_base.cc

Issue 657013003: Use scoped_ptr::Pass instead of scoped_ptr::PassAs<T>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 | « no previous file | net/disk_cache/memory/mem_backend_impl.cc » ('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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "net/disk_cache/disk_cache_test_base.h" 5 #include "net/disk_cache/disk_cache_test_base.h"
6 6
7 #include "base/files/file_util.h" 7 #include "base/files/file_util.h"
8 #include "base/path_service.h" 8 #include "base/path_service.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "base/single_thread_task_runner.h" 10 #include "base/single_thread_task_runner.h"
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 runner = thread->task_runner(); 301 runner = thread->task_runner();
302 302
303 if (simple_cache_mode_) { 303 if (simple_cache_mode_) {
304 net::TestCompletionCallback cb; 304 net::TestCompletionCallback cb;
305 scoped_ptr<disk_cache::SimpleBackendImpl> simple_backend( 305 scoped_ptr<disk_cache::SimpleBackendImpl> simple_backend(
306 new disk_cache::SimpleBackendImpl( 306 new disk_cache::SimpleBackendImpl(
307 cache_path_, size_, type_, runner, NULL)); 307 cache_path_, size_, type_, runner, NULL));
308 int rv = simple_backend->Init(cb.callback()); 308 int rv = simple_backend->Init(cb.callback());
309 ASSERT_EQ(net::OK, cb.GetResult(rv)); 309 ASSERT_EQ(net::OK, cb.GetResult(rv));
310 simple_cache_impl_ = simple_backend.get(); 310 simple_cache_impl_ = simple_backend.get();
311 cache_ = simple_backend.PassAs<disk_cache::Backend>(); 311 cache_ = simple_backend.Pass();
312 if (simple_cache_wait_for_index_) { 312 if (simple_cache_wait_for_index_) {
313 net::TestCompletionCallback wait_for_index_cb; 313 net::TestCompletionCallback wait_for_index_cb;
314 rv = simple_cache_impl_->index()->ExecuteWhenReady( 314 rv = simple_cache_impl_->index()->ExecuteWhenReady(
315 wait_for_index_cb.callback()); 315 wait_for_index_cb.callback());
316 ASSERT_EQ(net::OK, wait_for_index_cb.GetResult(rv)); 316 ASSERT_EQ(net::OK, wait_for_index_cb.GetResult(rv));
317 } 317 }
318 return; 318 return;
319 } 319 }
320 320
321 if (mask_) 321 if (mask_)
322 cache_impl_ = new disk_cache::BackendImpl(cache_path_, mask_, runner, NULL); 322 cache_impl_ = new disk_cache::BackendImpl(cache_path_, mask_, runner, NULL);
323 else 323 else
324 cache_impl_ = new disk_cache::BackendImpl(cache_path_, runner, NULL); 324 cache_impl_ = new disk_cache::BackendImpl(cache_path_, runner, NULL);
325 cache_.reset(cache_impl_); 325 cache_.reset(cache_impl_);
326 ASSERT_TRUE(cache_); 326 ASSERT_TRUE(cache_);
327 if (size_) 327 if (size_)
328 EXPECT_TRUE(cache_impl_->SetMaxSize(size_)); 328 EXPECT_TRUE(cache_impl_->SetMaxSize(size_));
329 if (new_eviction_) 329 if (new_eviction_)
330 cache_impl_->SetNewEviction(); 330 cache_impl_->SetNewEviction();
331 cache_impl_->SetType(type_); 331 cache_impl_->SetType(type_);
332 cache_impl_->SetFlags(flags); 332 cache_impl_->SetFlags(flags);
333 net::TestCompletionCallback cb; 333 net::TestCompletionCallback cb;
334 int rv = cache_impl_->Init(cb.callback()); 334 int rv = cache_impl_->Init(cb.callback());
335 ASSERT_EQ(net::OK, cb.GetResult(rv)); 335 ASSERT_EQ(net::OK, cb.GetResult(rv));
336 } 336 }
OLDNEW
« no previous file with comments | « no previous file | net/disk_cache/memory/mem_backend_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698