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

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

Issue 983007: Http cache: Add support for a dedicated cache thread. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/net/chrome_url_request_context.cc ('k') | net/disk_cache/disk_cache.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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2010 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/backend_impl.h" 5 #include "net/disk_cache/backend_impl.h"
6 6
7 #include "base/field_trial.h" 7 #include "base/field_trial.h"
8 #include "base/file_path.h" 8 #include "base/file_path.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/histogram.h" 10 #include "base/histogram.h"
11 #include "base/message_loop.h" 11 #include "base/message_loop.h"
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 167
168 namespace disk_cache { 168 namespace disk_cache {
169 169
170 Backend* CreateCacheBackend(const FilePath& full_path, bool force, 170 Backend* CreateCacheBackend(const FilePath& full_path, bool force,
171 int max_bytes, net::CacheType type) { 171 int max_bytes, net::CacheType type) {
172 // Create a backend without extra flags. 172 // Create a backend without extra flags.
173 return BackendImpl::CreateBackend(full_path, force, max_bytes, type, kNone); 173 return BackendImpl::CreateBackend(full_path, force, max_bytes, type, kNone);
174 } 174 }
175 175
176 int CreateCacheBackend(net::CacheType type, const FilePath& path, int max_bytes, 176 int CreateCacheBackend(net::CacheType type, const FilePath& path, int max_bytes,
177 bool force, Backend** backend, 177 bool force, MessageLoop* thread, Backend** backend,
178 CompletionCallback* callback) { 178 CompletionCallback* callback) {
179 if (type == net::MEMORY_CACHE) 179 if (type == net::MEMORY_CACHE)
180 *backend = CreateInMemoryCacheBackend(max_bytes); 180 *backend = CreateInMemoryCacheBackend(max_bytes);
181 else 181 else
182 *backend = BackendImpl::CreateBackend(path, force, max_bytes, type, kNone); 182 *backend = BackendImpl::CreateBackend(path, force, max_bytes, type, kNone);
183 return *backend ? net::OK : net::ERR_FAILED; 183 return *backend ? net::OK : net::ERR_FAILED;
184 } 184 }
185 185
186 // Returns the preferred maximum number of bytes for the cache given the 186 // Returns the preferred maximum number of bytes for the cache given the
187 // number of available bytes. 187 // number of available bytes.
(...skipping 1503 matching lines...) Expand 10 before | Expand all | Expand 10 after
1691 1691
1692 return num_dirty; 1692 return num_dirty;
1693 } 1693 }
1694 1694
1695 bool BackendImpl::CheckEntry(EntryImpl* cache_entry) { 1695 bool BackendImpl::CheckEntry(EntryImpl* cache_entry) {
1696 RankingsNode* rankings = cache_entry->rankings()->Data(); 1696 RankingsNode* rankings = cache_entry->rankings()->Data();
1697 return !rankings->dummy; 1697 return !rankings->dummy;
1698 } 1698 }
1699 1699
1700 } // namespace disk_cache 1700 } // namespace disk_cache
OLDNEW
« no previous file with comments | « chrome/browser/net/chrome_url_request_context.cc ('k') | net/disk_cache/disk_cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698