summaryrefslogtreecommitdiffstats
path: root/chrome/browser/profile.cc
diff options
context:
space:
mode:
authorthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-11 18:45:13 +0000
committerthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-11 18:45:13 +0000
commitbc96d5610e96f0c86ca227c539643454b1960e36 (patch)
treeed75f412d57298d89153d1a008b38b5fd7619805 /chrome/browser/profile.cc
parentaae605a26c03dc4a68ef546d3f5358601fa3d3bb (diff)
downloadchromium_src-bc96d5610e96f0c86ca227c539643454b1960e36.zip
chromium_src-bc96d5610e96f0c86ca227c539643454b1960e36.tar.gz
chromium_src-bc96d5610e96f0c86ca227c539643454b1960e36.tar.bz2
Use $XDG_CACHE_HOME for the cache on Linux. This only works for the default profile.
BUG=16976 TEST=Run Chromium, visit some webpages, make sure it's using the cache under $XDG_CACHE_HOME (~/.cache by default) Review URL: http://codereview.chromium.org/159028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23057 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/profile.cc')
-rw-r--r--chrome/browser/profile.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/chrome/browser/profile.cc b/chrome/browser/profile.cc
index 6304c2b..6186394 100644
--- a/chrome/browser/profile.cc
+++ b/chrome/browser/profile.cc
@@ -6,7 +6,6 @@
#include "base/command_line.h"
#include "base/file_path.h"
-#include "base/file_util.h"
#include "base/path_service.h"
#include "base/scoped_ptr.h"
#include "base/string_util.h"
@@ -534,6 +533,11 @@ ProfileImpl::ProfileImpl(const FilePath& path)
blacklist_ = new Blacklist(path);
}
+ if (!PathService::IsOverridden(chrome::DIR_USER_DATA))
+ PathService::Get(chrome::DIR_USER_CACHE, &base_cache_path_);
+ if (base_cache_path_.empty())
+ base_cache_path_ = path_;
+
// Listen for theme installation.
registrar_.Add(this, NotificationType::THEME_INSTALLED,
NotificationService::AllSources());
@@ -790,7 +794,7 @@ URLRequestContext* ProfileImpl::GetRequestContext() {
if (!request_context_) {
FilePath cookie_path = GetPath();
cookie_path = cookie_path.Append(chrome::kCookieFilename);
- FilePath cache_path = GetPath();
+ FilePath cache_path = base_cache_path_;
int max_size;
GetCacheParameters(kNormalContext, &cache_path, &max_size);
@@ -821,7 +825,7 @@ URLRequestContext* ProfileImpl::GetRequestContext() {
URLRequestContext* ProfileImpl::GetRequestContextForMedia() {
if (!media_request_context_) {
- FilePath cache_path = GetPath();
+ FilePath cache_path = base_cache_path_;
int max_size;
GetCacheParameters(kMediaContext, &cache_path, &max_size);