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

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

Issue 6905044: Refactor preference syncing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix the previous fix Created 9 years, 8 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) 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 #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/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/memory/singleton.h" 10 #include "base/memory/singleton.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 UMA_HISTOGRAM_MEMORY_MB("Cache.MaxCacheSizeMB", 44 UMA_HISTOGRAM_MEMORY_MB("Cache.MaxCacheSizeMB",
45 default_cache_size / 1024 / 1024); 45 default_cache_size / 1024 / 1024);
46 46
47 return default_cache_size; 47 return default_cache_size;
48 } 48 }
49 49
50 } // anonymous namespace 50 } // anonymous namespace
51 51
52 // static 52 // static
53 void WebCacheManager::RegisterPrefs(PrefService* prefs) { 53 void WebCacheManager::RegisterPrefs(PrefService* prefs) {
54 prefs->RegisterIntegerPref(prefs::kMemoryCacheSize, GetDefaultCacheSize()); 54 prefs->RegisterIntegerPref(prefs::kMemoryCacheSize,
55 GetDefaultCacheSize(),
56 false /* don't sync pref */);
55 } 57 }
56 58
57 // static 59 // static
58 WebCacheManager* WebCacheManager::GetInstance() { 60 WebCacheManager* WebCacheManager::GetInstance() {
59 return Singleton<WebCacheManager>::get(); 61 return Singleton<WebCacheManager>::get();
60 } 62 }
61 63
62 WebCacheManager::WebCacheManager() 64 WebCacheManager::WebCacheManager()
63 : global_size_limit_(GetDefaultGlobalSizeLimit()), 65 : global_size_limit_(GetDefaultGlobalSizeLimit()),
64 ALLOW_THIS_IN_INITIALIZER_LIST(revise_allocation_factory_(this)) { 66 ALLOW_THIS_IN_INITIALIZER_LIST(revise_allocation_factory_(this)) {
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 if (idle >= TimeDelta::FromMinutes(kRendererInactiveThresholdMinutes)) { 403 if (idle >= TimeDelta::FromMinutes(kRendererInactiveThresholdMinutes)) {
402 // Moved to inactive status. This invalidates our iterator. 404 // Moved to inactive status. This invalidates our iterator.
403 inactive_renderers_.insert(*iter); 405 inactive_renderers_.insert(*iter);
404 active_renderers_.erase(*iter); 406 active_renderers_.erase(*iter);
405 iter = active_renderers_.begin(); 407 iter = active_renderers_.begin();
406 continue; 408 continue;
407 } 409 }
408 ++iter; 410 ++iter;
409 } 411 }
410 } 412 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698