diff options
author | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-07 01:58:42 +0000 |
---|---|---|
committer | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-07 01:58:42 +0000 |
commit | 2b2830a2e1d94bd353e6a8b16f3572c4ae36c436 (patch) | |
tree | 118e60cb40ea252e143b273ad1407bf194730b1a /chrome/browser/profile.cc | |
parent | 0a836048108542bb8d10fe399b1ee08f6615501c (diff) | |
download | chromium_src-2b2830a2e1d94bd353e6a8b16f3572c4ae36c436.zip chromium_src-2b2830a2e1d94bd353e6a8b16f3572c4ae36c436.tar.gz chromium_src-2b2830a2e1d94bd353e6a8b16f3572c4ae36c436.tar.bz2 |
Adds a command line switch to allow the user to specify the location
of the disk cache, rather than in the profile directory. The command
line switch overrides the cache location regardless the chosen
profile.
In this implementation, the supplied directory name must should not
contain spaces.
BUG=6688
submitted by bekkra.
original code review http://codereview.chromium.org/21094/show
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9375 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/profile.cc')
-rw-r--r-- | chrome/browser/profile.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/chrome/browser/profile.cc b/chrome/browser/profile.cc index 95b0afc..158a9e1 100644 --- a/chrome/browser/profile.cc +++ b/chrome/browser/profile.cc @@ -532,6 +532,15 @@ URLRequestContext* ProfileImpl::GetRequestContext() { FilePath cookie_path = GetPath(); cookie_path = cookie_path.Append(chrome::kCookieFilename); FilePath cache_path = GetPath(); + + // Override the cache location if specified by the user. + const std::wstring user_cache_dir( + CommandLine::ForCurrentProcess()->GetSwitchValue( + switches::kDiskCacheDir)); + if (!user_cache_dir.empty()) { + cache_path = FilePath::FromWStringHack(user_cache_dir); + } + cache_path = cache_path.Append(chrome::kCacheDirname); request_context_ = ChromeURLRequestContext::CreateOriginal( this, cookie_path, cache_path); |