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 // This is the browser side of the cache manager, it tracks the activity of the | 5 // This is the browser side of the cache manager, it tracks the activity of the |
6 // render processes and allocates available memory cache resources. | 6 // render processes and allocates available memory cache resources. |
7 | 7 |
8 #ifndef COMPONENTS_WEB_CACHE_BROWSER_WEB_CACHE_MANAGER_H_ | 8 #ifndef COMPONENTS_WEB_CACHE_BROWSER_WEB_CACHE_MANAGER_H_ |
9 #define COMPONENTS_WEB_CACHE_BROWSER_WEB_CACHE_MANAGER_H_ | 9 #define COMPONENTS_WEB_CACHE_BROWSER_WEB_CACHE_MANAGER_H_ |
10 | 10 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 | 79 |
80 // The global limit on the number of bytes in all the in-memory caches. | 80 // The global limit on the number of bytes in all the in-memory caches. |
81 size_t global_size_limit() const { return global_size_limit_; } | 81 size_t global_size_limit() const { return global_size_limit_; } |
82 | 82 |
83 // Sets the global size limit, forcing a recalculation of cache allocations. | 83 // Sets the global size limit, forcing a recalculation of cache allocations. |
84 void SetGlobalSizeLimit(size_t bytes); | 84 void SetGlobalSizeLimit(size_t bytes); |
85 | 85 |
86 // Clears all in-memory caches. | 86 // Clears all in-memory caches. |
87 void ClearCache(); | 87 void ClearCache(); |
88 | 88 |
| 89 // Instantly clears renderer cache for a process. |
| 90 void ClearCacheForProcess(int process_id); |
| 91 |
89 // Clears all in-memory caches when a tab is reloaded or the user navigates | 92 // Clears all in-memory caches when a tab is reloaded or the user navigates |
90 // to a different website. | 93 // to a different website. |
91 void ClearCacheOnNavigation(); | 94 void ClearCacheOnNavigation(); |
92 | 95 |
93 // content::NotificationObserver implementation: | 96 // content::NotificationObserver implementation: |
94 void Observe(int type, | 97 void Observe(int type, |
95 const content::NotificationSource& source, | 98 const content::NotificationSource& source, |
96 const content::NotificationDetails& details) override; | 99 const content::NotificationDetails& details) override; |
97 | 100 |
98 // Gets the default global size limit. This interrogates system metrics to | 101 // Gets the default global size limit. This interrogates system metrics to |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 content::NotificationRegistrar registrar_; | 235 content::NotificationRegistrar registrar_; |
233 | 236 |
234 base::WeakPtrFactory<WebCacheManager> weak_factory_; | 237 base::WeakPtrFactory<WebCacheManager> weak_factory_; |
235 | 238 |
236 DISALLOW_COPY_AND_ASSIGN(WebCacheManager); | 239 DISALLOW_COPY_AND_ASSIGN(WebCacheManager); |
237 }; | 240 }; |
238 | 241 |
239 } // namespace web_cache | 242 } // namespace web_cache |
240 | 243 |
241 #endif // COMPONENTS_WEB_CACHE_BROWSER_WEB_CACHE_MANAGER_H_ | 244 #endif // COMPONENTS_WEB_CACHE_BROWSER_WEB_CACHE_MANAGER_H_ |
OLD | NEW |