OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "content/browser/renderer_host/backing_store_manager.h" | 5 #include "content/browser/renderer_host/backing_store_manager.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/memory/mru_cache.h" | 8 #include "base/memory/mru_cache.h" |
9 #include "base/sys_info.h" | 9 #include "base/sys_info.h" |
10 #include "chrome/common/chrome_constants.h" | |
11 #include "content/browser/renderer_host/backing_store.h" | 10 #include "content/browser/renderer_host/backing_store.h" |
12 #include "content/browser/renderer_host/render_widget_host.h" | 11 #include "content/browser/renderer_host/render_widget_host.h" |
13 #include "content/common/content_switches.h" | 12 #include "content/common/content_switches.h" |
14 #include "content/common/notification_service.h" | 13 #include "content/common/notification_service.h" |
15 | 14 |
16 namespace { | 15 namespace { |
17 | 16 |
18 // There are two separate caches, |large_cache| and |small_cache|. large_cache | 17 // There are two separate caches, |large_cache| and |small_cache|. large_cache |
19 // is meant for large items (tabs, popup windows), while small_cache is meant | 18 // is meant for large items (tabs, popup windows), while small_cache is meant |
20 // for small items (extension toolstrips and buttons, etc.). The idea is that | 19 // for small items (extension toolstrips and buttons, etc.). The idea is that |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 size_t mem = 0; | 274 size_t mem = 0; |
276 BackingStoreCache::iterator it; | 275 BackingStoreCache::iterator it; |
277 for (it = large_cache->begin(); it != large_cache->end(); ++it) | 276 for (it = large_cache->begin(); it != large_cache->end(); ++it) |
278 mem += it->second->MemorySize(); | 277 mem += it->second->MemorySize(); |
279 | 278 |
280 for (it = small_cache->begin(); it != small_cache->end(); ++it) | 279 for (it = small_cache->begin(); it != small_cache->end(); ++it) |
281 mem += it->second->MemorySize(); | 280 mem += it->second->MemorySize(); |
282 | 281 |
283 return mem; | 282 return mem; |
284 } | 283 } |
OLD | NEW |