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

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

Issue 3814013: FBTF: Monster ctor patch after changing heuristics in clang plugin. (Closed) Base URL: http://git.chromium.org/git/chromium.git
Patch Set: More add file fail Created 10 years, 2 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/mem_backend_impl.h ('k') | net/disk_cache/sparse_control.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-2010 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/mem_backend_impl.h" 5 #include "net/disk_cache/mem_backend_impl.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/sys_info.h" 8 #include "base/sys_info.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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 // reached on systemd with more than 2.5 GB of RAM. 55 // reached on systemd with more than 2.5 GB of RAM.
56 total_memory = total_memory * 2 / 100; 56 total_memory = total_memory * 2 / 100;
57 if (total_memory > kDefaultCacheSize * 5) 57 if (total_memory > kDefaultCacheSize * 5)
58 max_size_ = kDefaultCacheSize * 5; 58 max_size_ = kDefaultCacheSize * 5;
59 else 59 else
60 max_size_ = static_cast<int32>(total_memory); 60 max_size_ = static_cast<int32>(total_memory);
61 61
62 return true; 62 return true;
63 } 63 }
64 64
65 MemBackendImpl::MemBackendImpl() : max_size_(0), current_size_(0) {}
66
65 MemBackendImpl::~MemBackendImpl() { 67 MemBackendImpl::~MemBackendImpl() {
66 EntryMap::iterator it = entries_.begin(); 68 EntryMap::iterator it = entries_.begin();
67 while (it != entries_.end()) { 69 while (it != entries_.end()) {
68 it->second->Doom(); 70 it->second->Doom();
69 it = entries_.begin(); 71 it = entries_.begin();
70 } 72 }
71 DCHECK(!current_size_); 73 DCHECK(!current_size_);
72 } 74 }
73 75
74 bool MemBackendImpl::SetMaxSize(int max_bytes) { 76 bool MemBackendImpl::SetMaxSize(int max_bytes) {
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 310
309 void MemBackendImpl::InsertIntoRankingList(MemEntryImpl* entry) { 311 void MemBackendImpl::InsertIntoRankingList(MemEntryImpl* entry) {
310 rankings_.Insert(entry); 312 rankings_.Insert(entry);
311 } 313 }
312 314
313 void MemBackendImpl::RemoveFromRankingList(MemEntryImpl* entry) { 315 void MemBackendImpl::RemoveFromRankingList(MemEntryImpl* entry) {
314 rankings_.Remove(entry); 316 rankings_.Remove(entry);
315 } 317 }
316 318
317 } // namespace disk_cache 319 } // namespace disk_cache
OLDNEW
« no previous file with comments | « net/disk_cache/mem_backend_impl.h ('k') | net/disk_cache/sparse_control.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698