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

Side by Side Diff: chrome/browser/renderer_host/web_cache_manager.cc

Issue 11741003: Remove PrefServiceSimple, replacing it with PrefService and PrefRegistrySimple. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix double registration in Chrome Frame test. Created 7 years, 10 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 | Annotate | Revision Log
OLDNEW
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 "chrome/browser/renderer_host/web_cache_manager.h" 5 #include "chrome/browser/renderer_host/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"
11 #include "base/memory/singleton.h" 11 #include "base/memory/singleton.h"
12 #include "base/message_loop.h" 12 #include "base/message_loop.h"
13 #include "base/metrics/histogram.h" 13 #include "base/metrics/histogram.h"
14 #include "base/sys_info.h" 14 #include "base/sys_info.h"
15 #include "base/time.h" 15 #include "base/time.h"
16 #include "chrome/browser/browser_process.h" 16 #include "chrome/browser/browser_process.h"
17 #include "chrome/browser/prefs/pref_registry_simple.h"
17 #include "chrome/browser/prefs/pref_service.h" 18 #include "chrome/browser/prefs/pref_service.h"
18 #include "chrome/common/chrome_constants.h" 19 #include "chrome/common/chrome_constants.h"
19 #include "chrome/common/chrome_notification_types.h" 20 #include "chrome/common/chrome_notification_types.h"
20 #include "chrome/common/pref_names.h" 21 #include "chrome/common/pref_names.h"
21 #include "chrome/common/render_messages.h" 22 #include "chrome/common/render_messages.h"
22 #include "content/public/browser/notification_service.h" 23 #include "content/public/browser/notification_service.h"
23 #include "content/public/browser/render_process_host.h" 24 #include "content/public/browser/render_process_host.h"
24 25
25 using base::Time; 26 using base::Time;
26 using base::TimeDelta; 27 using base::TimeDelta;
(...skipping 19 matching lines...) Expand all
46 47
47 UMA_HISTOGRAM_MEMORY_MB("Cache.MaxCacheSizeMB", 48 UMA_HISTOGRAM_MEMORY_MB("Cache.MaxCacheSizeMB",
48 default_cache_size / 1024 / 1024); 49 default_cache_size / 1024 / 1024);
49 50
50 return default_cache_size; 51 return default_cache_size;
51 } 52 }
52 53
53 } // anonymous namespace 54 } // anonymous namespace
54 55
55 // static 56 // static
56 void WebCacheManager::RegisterPrefs(PrefServiceSimple* prefs) { 57 void WebCacheManager::RegisterPrefs(PrefRegistrySimple* registry) {
57 prefs->RegisterIntegerPref(prefs::kMemoryCacheSize, GetDefaultCacheSize()); 58 registry->RegisterIntegerPref(prefs::kMemoryCacheSize, GetDefaultCacheSize());
58 } 59 }
59 60
60 // static 61 // static
61 WebCacheManager* WebCacheManager::GetInstance() { 62 WebCacheManager* WebCacheManager::GetInstance() {
62 return Singleton<WebCacheManager>::get(); 63 return Singleton<WebCacheManager>::get();
63 } 64 }
64 65
65 WebCacheManager::WebCacheManager() 66 WebCacheManager::WebCacheManager()
66 : global_size_limit_(GetDefaultGlobalSizeLimit()), 67 : global_size_limit_(GetDefaultGlobalSizeLimit()),
67 ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) { 68 ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) {
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 if (idle >= TimeDelta::FromMinutes(kRendererInactiveThresholdMinutes)) { 434 if (idle >= TimeDelta::FromMinutes(kRendererInactiveThresholdMinutes)) {
434 // Moved to inactive status. This invalidates our iterator. 435 // Moved to inactive status. This invalidates our iterator.
435 inactive_renderers_.insert(*iter); 436 inactive_renderers_.insert(*iter);
436 active_renderers_.erase(*iter); 437 active_renderers_.erase(*iter);
437 iter = active_renderers_.begin(); 438 iter = active_renderers_.begin();
438 continue; 439 continue;
439 } 440 }
440 ++iter; 441 ++iter;
441 } 442 }
442 } 443 }
OLDNEW
« no previous file with comments | « chrome/browser/renderer_host/web_cache_manager.h ('k') | chrome/browser/signin/signin_manager_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698