Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(400)

Side by Side Diff: components/web_cache/browser/web_cache_manager.h

Issue 528363002: Move webCacheManager to //components. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Small changes are made. Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 COMPONENTS_WEB_CACHE_BROWSER_WEB_CACHE_MANAGER_H_
9 #define CHROME_BROWSER_RENDERER_HOST_WEB_CACHE_MANAGER_H_ 9 #define COMPONENTS_WEB_CACHE_BROWSER_WEB_CACHE_MANAGER_H_
10 10
11 #include <list> 11 #include <list>
12 #include <map> 12 #include <map>
13 #include <set> 13 #include <set>
14 14
15 #include "base/basictypes.h" 15 #include "base/basictypes.h"
16 #include "base/compiler_specific.h" 16 #include "base/compiler_specific.h"
17 #include "base/gtest_prod_util.h" 17 #include "base/gtest_prod_util.h"
18 #include "base/memory/weak_ptr.h" 18 #include "base/memory/weak_ptr.h"
19 #include "base/time/time.h" 19 #include "base/time/time.h"
20 #include "content/public/browser/notification_observer.h" 20 #include "content/public/browser/notification_observer.h"
21 #include "content/public/browser/notification_registrar.h" 21 #include "content/public/browser/notification_registrar.h"
22 #include "third_party/WebKit/public/web/WebCache.h" 22 #include "third_party/WebKit/public/web/WebCache.h"
23 23
24 template<typename Type> 24 template<typename Type>
25 struct DefaultSingletonTraits; 25 struct DefaultSingletonTraits;
26 class PrefRegistrySimple; 26 class PrefRegistrySimple;
27 27
28 namespace web_cache {
29
28 class WebCacheManager : public content::NotificationObserver { 30 class WebCacheManager : public content::NotificationObserver {
29 friend class WebCacheManagerTest; 31 friend class WebCacheManagerTest;
30 FRIEND_TEST_ALL_PREFIXES(WebCacheManagerBrowserTest, CrashOnceOnly); 32 FRIEND_TEST_ALL_PREFIXES(WebCacheManagerBrowserTest, CrashOnceOnly);
31 33
32 public: 34 public:
33 static void RegisterPrefs(PrefRegistrySimple* registry);
34
35 // Gets the singleton WebCacheManager object. The first time this method 35 // Gets the singleton WebCacheManager object. The first time this method
36 // is called, a WebCacheManager object is constructed and returned. 36 // is called, a WebCacheManager object is constructed and returned.
37 // Subsequent calls will return the same object. 37 // Subsequent calls will return the same object.
38 static WebCacheManager* GetInstance(); 38 static WebCacheManager* GetInstance();
39 39
40 // When a render process is created, it registers itself with the cache 40 // When a render process is created, it registers itself with the cache
41 // manager host, causing the renderer to be allocated cache resources. 41 // manager host, causing the renderer to be allocated cache resources.
42 void Add(int renderer_id); 42 void Add(int renderer_id);
43 43
44 // When a render process ends, it removes itself from the cache manager host, 44 // When a render process ends, it removes itself from the cache manager host,
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 // recently than they have been active. 212 // recently than they have been active.
213 std::set<int> inactive_renderers_; 213 std::set<int> inactive_renderers_;
214 214
215 base::WeakPtrFactory<WebCacheManager> weak_factory_; 215 base::WeakPtrFactory<WebCacheManager> weak_factory_;
216 216
217 content::NotificationRegistrar registrar_; 217 content::NotificationRegistrar registrar_;
218 218
219 DISALLOW_COPY_AND_ASSIGN(WebCacheManager); 219 DISALLOW_COPY_AND_ASSIGN(WebCacheManager);
220 }; 220 };
221 221
222 #endif // CHROME_BROWSER_RENDERER_HOST_WEB_CACHE_MANAGER_H_ 222 } // namespace web_cache
223
224 #endif // COMPONENTS_WEB_CACHE_BROWSER_WEB_CACHE_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698