| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/mem_backend_impl.h" | 5 #include "net/disk_cache/mem_backend_impl.h" |
| 6 | 6 |
| 7 #include "base/sys_info.h" | 7 #include "base/sys_info.h" |
| 8 #include "net/disk_cache/cache_util.h" | 8 #include "net/disk_cache/cache_util.h" |
| 9 #include "net/disk_cache/mem_entry_impl.h" | 9 #include "net/disk_cache/mem_entry_impl.h" |
| 10 | 10 |
| 11 using base::Time; |
| 12 |
| 11 namespace { | 13 namespace { |
| 12 | 14 |
| 13 const int kDefaultCacheSize = 10 * 1024 * 1024; | 15 const int kDefaultCacheSize = 10 * 1024 * 1024; |
| 14 const int kCleanUpMargin = 1024 * 1024; | 16 const int kCleanUpMargin = 1024 * 1024; |
| 15 | 17 |
| 16 int LowWaterAdjust(int high_water) { | 18 int LowWaterAdjust(int high_water) { |
| 17 if (high_water < kCleanUpMargin) | 19 if (high_water < kCleanUpMargin) |
| 18 return 0; | 20 return 0; |
| 19 | 21 |
| 20 return high_water - kCleanUpMargin; | 22 return high_water - kCleanUpMargin; |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 void MemBackendImpl::UpdateRank(MemEntryImpl* node) { | 246 void MemBackendImpl::UpdateRank(MemEntryImpl* node) { |
| 245 rankings_.UpdateRank(node); | 247 rankings_.UpdateRank(node); |
| 246 } | 248 } |
| 247 | 249 |
| 248 int MemBackendImpl::MaxFileSize() const { | 250 int MemBackendImpl::MaxFileSize() const { |
| 249 return max_size_ / 8; | 251 return max_size_ / 8; |
| 250 } | 252 } |
| 251 | 253 |
| 252 } // namespace disk_cache | 254 } // namespace disk_cache |
| 253 | 255 |
| OLD | NEW |