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

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

Issue 12224017: Create a new disk_cache type, SHADER_CACHE. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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
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/backend_impl.h" 5 #include "net/disk_cache/backend_impl.h"
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/file_path.h" 9 #include "base/file_path.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 901 matching lines...) Expand 10 before | Expand all | Expand 10 after
912 912
913 void BackendImpl::DeleteBlock(Addr block_address, bool deep) { 913 void BackendImpl::DeleteBlock(Addr block_address, bool deep) {
914 block_files_.DeleteBlock(block_address, deep); 914 block_files_.DeleteBlock(block_address, deep);
915 } 915 }
916 916
917 LruData* BackendImpl::GetLruData() { 917 LruData* BackendImpl::GetLruData() {
918 return &data_->header.lru; 918 return &data_->header.lru;
919 } 919 }
920 920
921 void BackendImpl::UpdateRank(EntryImpl* entry, bool modified) { 921 void BackendImpl::UpdateRank(EntryImpl* entry, bool modified) {
922 if (!read_only_) { 922 if (read_only_ || (!modified && cache_type() == net::SHADER_CACHE))
923 eviction_.UpdateRank(entry, modified); 923 return;
924 } 924 eviction_.UpdateRank(entry, modified);
925 } 925 }
926 926
927 void BackendImpl::RecoveredEntry(CacheRankingsBlock* rankings) { 927 void BackendImpl::RecoveredEntry(CacheRankingsBlock* rankings) {
928 Addr address(rankings->Data()->contents); 928 Addr address(rankings->Data()->contents);
929 EntryImpl* cache_entry = NULL; 929 EntryImpl* cache_entry = NULL;
930 if (NewEntry(address, &cache_entry)) { 930 if (NewEntry(address, &cache_entry)) {
931 STRESS_NOTREACHED(); 931 STRESS_NOTREACHED();
932 return; 932 return;
933 } 933 }
934 934
(...skipping 1301 matching lines...) Expand 10 before | Expand all | Expand 10 after
2236 if (total_memory > kMaxBuffersSize || total_memory <= 0) 2236 if (total_memory > kMaxBuffersSize || total_memory <= 0)
2237 total_memory = kMaxBuffersSize; 2237 total_memory = kMaxBuffersSize;
2238 2238
2239 done = true; 2239 done = true;
2240 } 2240 }
2241 2241
2242 return static_cast<int>(total_memory); 2242 return static_cast<int>(total_memory);
2243 } 2243 }
2244 2244
2245 } // namespace disk_cache 2245 } // namespace disk_cache
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698