summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/profile.cc9
-rw-r--r--chrome/common/chrome_switches.cc4
-rw-r--r--chrome/common/chrome_switches.h1
3 files changed, 14 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);
diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc
index 00e7f11..1e5a622 100644
--- a/chrome/common/chrome_switches.cc
+++ b/chrome/common/chrome_switches.cc
@@ -116,6 +116,10 @@ const wchar_t kUserDataDir[] = L"user-data-dir";
// specifically) will store its state.
const wchar_t kPluginDataDir[] = L"plugin-data-dir";
+// Use a specific disk cache location, rather than one derived from the
+// UserDatadir.
+const wchar_t kDiskCacheDir[] = L"disk-cache-dir";
+
// Specifies the path to the user data folder for the parent profile.
const wchar_t kParentProfile[] = L"parent-profile";
diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h
index 4305374..a64f632 100644
--- a/chrome/common/chrome_switches.h
+++ b/chrome/common/chrome_switches.h
@@ -40,6 +40,7 @@ extern const wchar_t kTrustedPlugins[];
extern const wchar_t kTestSandbox[];
extern const wchar_t kUserDataDir[];
extern const wchar_t kPluginDataDir[];
+extern const wchar_t kDiskCacheDir[];
extern const wchar_t kParentProfile[];
extern const wchar_t kApp[];
extern const wchar_t kAppUploadFile[];