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

Unified Diff: chrome/browser/profile.cc

Issue 42517: Fix bug 9094 (Closed)
Patch Set: Created 11 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profile.cc
diff --git a/chrome/browser/profile.cc b/chrome/browser/profile.cc
index 352d96582bc6acd68ec8b3679156e1562a5e2a52..224dd8d4114a19e6012413429b1ce3a0f55a6b72 100644
--- a/chrome/browser/profile.cc
+++ b/chrome/browser/profile.cc
@@ -214,6 +214,15 @@ class OffTheRecordProfileImpl : public Profile,
virtual URLRequestContext* GetRequestContextForMedia() {
if (!media_request_context_) {
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.Append(chrome::kOffTheRecordMediaCacheDirname);
media_request_context_ =
ChromeURLRequestContext::CreateOffTheRecordForMedia(
@@ -617,6 +626,15 @@ URLRequestContext* ProfileImpl::GetRequestContext() {
URLRequestContext* ProfileImpl::GetRequestContextForMedia() {
if (!media_request_context_) {
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.Append(chrome::kMediaCacheDirname);
media_request_context_ = ChromeURLRequestContext::CreateOriginalForMedia(
this, cache_path);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698