| 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 CHROME_BROWSER_RENDERER_HOST_WEB_CACHE_MANAGER_H_ | 8 #ifndef CHROME_BROWSER_RENDERER_HOST_WEB_CACHE_MANAGER_H_ |
| 9 #define CHROME_BROWSER_RENDERER_HOST_WEB_CACHE_MANAGER_H_ | 9 #define CHROME_BROWSER_RENDERER_HOST_WEB_CACHE_MANAGER_H_ |
| 10 #pragma once | 10 #pragma once |
| 11 | 11 |
| 12 #include <map> | 12 #include <map> |
| 13 #include <list> | 13 #include <list> |
| 14 #include <set> | 14 #include <set> |
| 15 | 15 |
| 16 #include "base/basictypes.h" | 16 #include "base/basictypes.h" |
| 17 #include "base/compiler_specific.h" | 17 #include "base/compiler_specific.h" |
| 18 #include "base/gtest_prod_util.h" | 18 #include "base/gtest_prod_util.h" |
| 19 #include "base/task.h" | 19 #include "base/memory/weak_ptr.h" |
| 20 #include "base/time.h" | 20 #include "base/time.h" |
| 21 #include "content/public/browser/notification_observer.h" | 21 #include "content/public/browser/notification_observer.h" |
| 22 #include "content/public/browser/notification_registrar.h" | 22 #include "content/public/browser/notification_registrar.h" |
| 23 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCache.h" | 23 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCache.h" |
| 24 | 24 |
| 25 template<typename Type> | 25 template<typename Type> |
| 26 struct DefaultSingletonTraits; | 26 struct DefaultSingletonTraits; |
| 27 class PrefService; | 27 class PrefService; |
| 28 | 28 |
| 29 class WebCacheManager : public content::NotificationObserver { | 29 class WebCacheManager : public content::NotificationObserver { |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 | 206 |
| 207 // Every renderer we think is still around is in one of these two sets. | 207 // Every renderer we think is still around is in one of these two sets. |
| 208 // | 208 // |
| 209 // Active renderers are those renderers that have been active more recently | 209 // Active renderers are those renderers that have been active more recently |
| 210 // than they have been inactive. | 210 // than they have been inactive. |
| 211 std::set<int> active_renderers_; | 211 std::set<int> active_renderers_; |
| 212 // Inactive renderers are those renderers that have been inactive more | 212 // Inactive renderers are those renderers that have been inactive more |
| 213 // recently than they have been active. | 213 // recently than they have been active. |
| 214 std::set<int> inactive_renderers_; | 214 std::set<int> inactive_renderers_; |
| 215 | 215 |
| 216 ScopedRunnableMethodFactory<WebCacheManager> revise_allocation_factory_; | 216 base::WeakPtrFactory<WebCacheManager> weak_factory_; |
| 217 | 217 |
| 218 content::NotificationRegistrar registrar_; | 218 content::NotificationRegistrar registrar_; |
| 219 | 219 |
| 220 DISALLOW_COPY_AND_ASSIGN(WebCacheManager); | 220 DISALLOW_COPY_AND_ASSIGN(WebCacheManager); |
| 221 }; | 221 }; |
| 222 | 222 |
| 223 #endif // CHROME_BROWSER_RENDERER_HOST_WEB_CACHE_MANAGER_H_ | 223 #endif // CHROME_BROWSER_RENDERER_HOST_WEB_CACHE_MANAGER_H_ |
| OLD | NEW |