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 "components/web_cache/browser/web_cache_manager.h" | 5 #include "components/web_cache/browser/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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 UMA_HISTOGRAM_MEMORY_MB("Cache.MaxCacheSizeMB", | 49 UMA_HISTOGRAM_MEMORY_MB("Cache.MaxCacheSizeMB", |
50 default_cache_size / 1024 / 1024); | 50 default_cache_size / 1024 / 1024); |
51 | 51 |
52 return default_cache_size; | 52 return default_cache_size; |
53 } | 53 } |
54 | 54 |
55 } // anonymous namespace | 55 } // anonymous namespace |
56 | 56 |
57 // static | 57 // static |
58 WebCacheManager* WebCacheManager::GetInstance() { | 58 WebCacheManager* WebCacheManager::GetInstance() { |
59 return Singleton<WebCacheManager>::get(); | 59 return base::Singleton<WebCacheManager>::get(); |
60 } | 60 } |
61 | 61 |
62 WebCacheManager::WebCacheManager() | 62 WebCacheManager::WebCacheManager() |
63 : global_size_limit_(GetDefaultGlobalSizeLimit()), | 63 : global_size_limit_(GetDefaultGlobalSizeLimit()), |
64 weak_factory_(this) { | 64 weak_factory_(this) { |
65 registrar_.Add(this, content::NOTIFICATION_RENDERER_PROCESS_CREATED, | 65 registrar_.Add(this, content::NOTIFICATION_RENDERER_PROCESS_CREATED, |
66 content::NotificationService::AllBrowserContextsAndSources()); | 66 content::NotificationService::AllBrowserContextsAndSources()); |
67 registrar_.Add(this, content::NOTIFICATION_RENDERER_PROCESS_TERMINATED, | 67 registrar_.Add(this, content::NOTIFICATION_RENDERER_PROCESS_TERMINATED, |
68 content::NotificationService::AllBrowserContextsAndSources()); | 68 content::NotificationService::AllBrowserContextsAndSources()); |
69 } | 69 } |
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 inactive_renderers_.insert(*iter); | 434 inactive_renderers_.insert(*iter); |
435 active_renderers_.erase(*iter); | 435 active_renderers_.erase(*iter); |
436 iter = active_renderers_.begin(); | 436 iter = active_renderers_.begin(); |
437 continue; | 437 continue; |
438 } | 438 } |
439 ++iter; | 439 ++iter; |
440 } | 440 } |
441 } | 441 } |
442 | 442 |
443 } // namespace web_cache | 443 } // namespace web_cache |
OLD | NEW |