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

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

Issue 127083002: **STILLBAKING** Decouple disk cache tests from backends. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: upstream rebase Created 6 years, 10 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/blockfile/disk_cache_perftest.cc ('k') | net/disk_cache/disk_cache_test.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) 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 "base/files/file_path.h" 5 #include "base/files/file_path.h"
6 #include "base/metrics/field_trial.h" 6 #include "base/metrics/field_trial.h"
7 #include "base/strings/stringprintf.h" 7 #include "base/strings/stringprintf.h"
8 #include "net/base/cache_type.h" 8 #include "net/base/cache_type.h"
9 #include "net/base/net_errors.h" 9 #include "net/base/net_errors.h"
10 #include "net/disk_cache/cache_util.h" 10 #include "net/disk_cache/cache_util.h"
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 namespace disk_cache { 152 namespace disk_cache {
153 153
154 int CreateCacheBackend(net::CacheType type, 154 int CreateCacheBackend(net::CacheType type,
155 net::BackendType backend_type, 155 net::BackendType backend_type,
156 const base::FilePath& path, 156 const base::FilePath& path,
157 int max_bytes, 157 int max_bytes,
158 bool force, base::MessageLoopProxy* thread, 158 bool force, base::MessageLoopProxy* thread,
159 net::NetLog* net_log, scoped_ptr<Backend>* backend, 159 net::NetLog* net_log, scoped_ptr<Backend>* backend,
160 const net::CompletionCallback& callback) { 160 const net::CompletionCallback& callback) {
161 DCHECK(!callback.is_null()); 161 DCHECK(!callback.is_null());
162 if (type == net::MEMORY_CACHE) { 162 if (backend_type == net::CACHE_BACKEND_MEMORY || type == net::MEMORY_CACHE) {
163 *backend = disk_cache::MemBackendImpl::CreateBackend(max_bytes, net_log); 163 *backend = disk_cache::MemBackendImpl::CreateBackend(max_bytes, net_log);
164 return *backend ? net::OK : net::ERR_FAILED; 164 return *backend ? net::OK : net::ERR_FAILED;
165 } 165 }
166 DCHECK(thread); 166 DCHECK(thread);
167 CacheCreator* creator = new CacheCreator(path, force, max_bytes, type, 167 CacheCreator* creator = new CacheCreator(path, force, max_bytes, type,
168 backend_type, 0, 168 backend_type, 0,
169 thread, net_log, backend, callback); 169 thread, net_log, backend, callback);
170 return creator->Run(); 170 return creator->Run();
171 } 171 }
172 172
173 } // namespace disk_cache 173 } // namespace disk_cache
OLDNEW
« no previous file with comments | « net/disk_cache/blockfile/disk_cache_perftest.cc ('k') | net/disk_cache/disk_cache_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698