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

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

Issue 24208003: Add PNACL_CACHE cache backend type, and allow larger files for this type. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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/base/cache_type.h ('k') | net/disk_cache/histogram_macros.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 "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_util.h" 9 #include "base/file_util.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 849 matching lines...) Expand 10 before | Expand all | Expand 10 after
860 } 860 }
861 861
862 return NULL; 862 return NULL;
863 } 863 }
864 864
865 int32 BackendImpl::GetCurrentEntryId() const { 865 int32 BackendImpl::GetCurrentEntryId() const {
866 return data_->header.this_id; 866 return data_->header.this_id;
867 } 867 }
868 868
869 int BackendImpl::MaxFileSize() const { 869 int BackendImpl::MaxFileSize() const {
870 return max_size_ / 8; 870 return cache_type() == net::PNACL_CACHE ? max_size_ : max_size_ / 8;
871 } 871 }
872 872
873 void BackendImpl::ModifyStorageSize(int32 old_size, int32 new_size) { 873 void BackendImpl::ModifyStorageSize(int32 old_size, int32 new_size) {
874 if (disabled_ || old_size == new_size) 874 if (disabled_ || old_size == new_size)
875 return; 875 return;
876 if (old_size > new_size) 876 if (old_size > new_size)
877 SubstractStorageSize(old_size - new_size); 877 SubstractStorageSize(old_size - new_size);
878 else 878 else
879 AddStorageSize(new_size - old_size); 879 AddStorageSize(new_size - old_size);
880 880
(...skipping 1228 matching lines...) Expand 10 before | Expand all | Expand 10 after
2109 if (total_memory > kMaxBuffersSize || total_memory <= 0) 2109 if (total_memory > kMaxBuffersSize || total_memory <= 0)
2110 total_memory = kMaxBuffersSize; 2110 total_memory = kMaxBuffersSize;
2111 2111
2112 done = true; 2112 done = true;
2113 } 2113 }
2114 2114
2115 return static_cast<int>(total_memory); 2115 return static_cast<int>(total_memory);
2116 } 2116 }
2117 2117
2118 } // namespace disk_cache 2118 } // namespace disk_cache
OLDNEW
« no previous file with comments | « net/base/cache_type.h ('k') | net/disk_cache/histogram_macros.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698