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

Unified Diff: chrome/browser/profiles/profile_impl.cc

Issue 7013046: Implemented a policy for centralized setting of the --disk-cache-dir flag. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/profiles/profile_impl.cc
diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc
index b1afc140d55c0db616108bced6bc83d0ceb63cc2..d9f3b086ed1e09f5c71850dd517ba29f5a2ef698 100644
--- a/chrome/browser/profiles/profile_impl.cc
+++ b/chrome/browser/profiles/profile_impl.cc
@@ -152,6 +152,10 @@ void GetCacheParameters(ContextType type, FilePath* cache_path,
*cache_path = CommandLine::ForCurrentProcess()->GetSwitchValuePath(
switches::kDiskCacheDir);
}
+ // And if a policy is set this should have even higher precedence.
+ PrefService* prefs = g_browser_process->local_state();
+ if (prefs && prefs->IsManagedPreference(prefs::kDiskCacheDir))
+ *cache_path = prefs->GetFilePath(prefs::kDiskCacheDir);
const char* arg = kNormalContext == type ? switches::kDiskCacheSize :
switches::kMediaCacheSize;

Powered by Google App Engine
This is Rietveld 408576698