| OLD | NEW |
| 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 "chrome/browser/renderer_host/web_cache_manager.h" | 5 #include "chrome/browser/renderer_host/web_cache_manager.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 #include "chrome/common/render_messages.h" | 22 #include "chrome/common/render_messages.h" |
| 23 #include "content/public/browser/notification_service.h" | 23 #include "content/public/browser/notification_service.h" |
| 24 #include "content/public/browser/render_process_host.h" | 24 #include "content/public/browser/render_process_host.h" |
| 25 | 25 |
| 26 #if defined(OS_ANDROID) | 26 #if defined(OS_ANDROID) |
| 27 #include "base/android/sys_utils.h" | 27 #include "base/android/sys_utils.h" |
| 28 #endif | 28 #endif |
| 29 | 29 |
| 30 using base::Time; | 30 using base::Time; |
| 31 using base::TimeDelta; | 31 using base::TimeDelta; |
| 32 using WebKit::WebCache; | 32 using blink::WebCache; |
| 33 | 33 |
| 34 static const int kReviseAllocationDelayMS = 200; | 34 static const int kReviseAllocationDelayMS = 200; |
| 35 | 35 |
| 36 // The default size limit of the in-memory cache is 8 MB | 36 // The default size limit of the in-memory cache is 8 MB |
| 37 static const int kDefaultMemoryCacheSize = 8 * 1024 * 1024; | 37 static const int kDefaultMemoryCacheSize = 8 * 1024 * 1024; |
| 38 | 38 |
| 39 namespace { | 39 namespace { |
| 40 | 40 |
| 41 int GetDefaultCacheSize() { | 41 int GetDefaultCacheSize() { |
| 42 // Start off with a modest default | 42 // Start off with a modest default |
| (...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 440 if (idle >= TimeDelta::FromMinutes(kRendererInactiveThresholdMinutes)) { | 440 if (idle >= TimeDelta::FromMinutes(kRendererInactiveThresholdMinutes)) { |
| 441 // Moved to inactive status. This invalidates our iterator. | 441 // Moved to inactive status. This invalidates our iterator. |
| 442 inactive_renderers_.insert(*iter); | 442 inactive_renderers_.insert(*iter); |
| 443 active_renderers_.erase(*iter); | 443 active_renderers_.erase(*iter); |
| 444 iter = active_renderers_.begin(); | 444 iter = active_renderers_.begin(); |
| 445 continue; | 445 continue; |
| 446 } | 446 } |
| 447 ++iter; | 447 ++iter; |
| 448 } | 448 } |
| 449 } | 449 } |
| OLD | NEW |