Chromium Code Reviews| Index: components/web_cache/browser/web_cache_manager.h |
| diff --git a/chrome/browser/renderer_host/web_cache_manager.h b/components/web_cache/browser/web_cache_manager.h |
| similarity index 93% |
| rename from chrome/browser/renderer_host/web_cache_manager.h |
| rename to components/web_cache/browser/web_cache_manager.h |
| index b7a59091b9d9002a7f5034ebe32390d29134741b..9ee4988281d27235ca46b53c14eb625638ac1489 100644 |
| --- a/chrome/browser/renderer_host/web_cache_manager.h |
| +++ b/components/web_cache/browser/web_cache_manager.h |
| @@ -5,16 +5,18 @@ |
| // This is the browser side of the cache manager, it tracks the activity of the |
| // render processes and allocates available memory cache resources. |
| -#ifndef CHROME_BROWSER_RENDERER_HOST_WEB_CACHE_MANAGER_H_ |
| -#define CHROME_BROWSER_RENDERER_HOST_WEB_CACHE_MANAGER_H_ |
| +#ifndef COMPONENTS_WEB_CACHE_BROWSER_WEB_CACHE_MANAGER_H_ |
| +#define COMPONENTS_WEB_CACHE_BROWSER_WEB_CACHE_MANAGER_H_ |
| #include <list> |
| #include <map> |
| #include <set> |
| #include "base/basictypes.h" |
| +#include "base/callback.h" |
| #include "base/compiler_specific.h" |
| #include "base/gtest_prod_util.h" |
| +#include "base/memory/scoped_ptr.h" |
| #include "base/memory/weak_ptr.h" |
| #include "base/time/time.h" |
| #include "content/public/browser/notification_observer.h" |
| @@ -25,13 +27,13 @@ template<typename Type> |
| struct DefaultSingletonTraits; |
| class PrefRegistrySimple; |
| +namespace web_cache { |
| + |
| class WebCacheManager : public content::NotificationObserver { |
| friend class WebCacheManagerTest; |
| FRIEND_TEST_ALL_PREFIXES(WebCacheManagerBrowserTest, CrashOnceOnly); |
| public: |
| - static void RegisterPrefs(PrefRegistrySimple* registry); |
| - |
| // Gets the singleton WebCacheManager object. The first time this method |
| // is called, a WebCacheManager object is constructed and returned. |
| // Subsequent calls will return the same object. |
| @@ -82,6 +84,11 @@ class WebCacheManager : public content::NotificationObserver { |
| // tune the default size to the current system. |
| static size_t GetDefaultGlobalSizeLimit(); |
| + // This function is only used in WebCacheManagerTest. It sets a callback |
| + // function that guaranty all the delayed tasks that posted to the message |
|
erikwright (departed)
2014/09/10 15:49:43
guarantees
Xi Han
2014/09/10 17:24:36
Removed.
|
| + // loop are executed before the unit test is finished. |
| + void SetTestCallback(scoped_ptr<base::Closure> call_back); |
| + |
| protected: |
| // The amount of idle time before we consider a tab to be "inactive" |
| static const int kRendererInactiveThresholdMinutes = 5; |
| @@ -212,6 +219,8 @@ class WebCacheManager : public content::NotificationObserver { |
| // recently than they have been active. |
| std::set<int> inactive_renderers_; |
| + scoped_ptr<base::Closure> test_call_back_; |
| + |
| base::WeakPtrFactory<WebCacheManager> weak_factory_; |
| content::NotificationRegistrar registrar_; |
| @@ -219,4 +228,6 @@ class WebCacheManager : public content::NotificationObserver { |
| DISALLOW_COPY_AND_ASSIGN(WebCacheManager); |
| }; |
| -#endif // CHROME_BROWSER_RENDERER_HOST_WEB_CACHE_MANAGER_H_ |
| +} // namespace web_cache |
| + |
| +#endif // COMPONENTS_WEB_CACHE_BROWSER_WEB_CACHE_MANAGER_H_ |