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

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

Issue 15984016: Call scoped_refptr<T>::get() rather than relying on implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « net/disk_cache/disk_cache_test_base.cc ('k') | net/disk_cache/entry_unittest.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) 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 "net/disk_cache/disk_cache_test_util.h" 5 #include "net/disk_cache/disk_cache_test_util.h"
6 6
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop/message_loop_proxy.h" 9 #include "base/message_loop/message_loop_proxy.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 } 56 }
57 57
58 bool DeleteCache(const base::FilePath& path) { 58 bool DeleteCache(const base::FilePath& path) {
59 disk_cache::DeleteCache(path, false); 59 disk_cache::DeleteCache(path, false);
60 return true; 60 return true;
61 } 61 }
62 62
63 bool CheckCacheIntegrity(const base::FilePath& path, bool new_eviction, 63 bool CheckCacheIntegrity(const base::FilePath& path, bool new_eviction,
64 uint32 mask) { 64 uint32 mask) {
65 scoped_ptr<disk_cache::BackendImpl> cache(new disk_cache::BackendImpl( 65 scoped_ptr<disk_cache::BackendImpl> cache(new disk_cache::BackendImpl(
66 path, mask, base::MessageLoopProxy::current(), NULL)); 66 path, mask, base::MessageLoopProxy::current().get(), NULL));
67 if (!cache.get()) 67 if (!cache.get())
68 return false; 68 return false;
69 if (new_eviction) 69 if (new_eviction)
70 cache->SetNewEviction(); 70 cache->SetNewEviction();
71 cache->SetFlags(disk_cache::kNoRandom); 71 cache->SetFlags(disk_cache::kNoRandom);
72 if (cache->SyncInit() != net::OK) 72 if (cache->SyncInit() != net::OK)
73 return false; 73 return false;
74 return cache->SelfCheck() >= 0; 74 return cache->SelfCheck() >= 0;
75 } 75 }
76 76
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 137
138 if (reuse_) { 138 if (reuse_) {
139 DCHECK_EQ(1, reuse_); 139 DCHECK_EQ(1, reuse_);
140 if (2 == reuse_) 140 if (2 == reuse_)
141 helper_->set_callback_reused_error(true); 141 helper_->set_callback_reused_error(true);
142 reuse_++; 142 reuse_++;
143 } 143 }
144 144
145 helper_->CallbackWasCalled(); 145 helper_->CallbackWasCalled();
146 } 146 }
OLDNEW
« no previous file with comments | « net/disk_cache/disk_cache_test_base.cc ('k') | net/disk_cache/entry_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698