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

Unified Diff: chrome/browser/net/chrome_url_request_context.cc

Issue 49027: Disk cache: First pass to make it possible to have... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
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 | « chrome/browser/net/chrome_url_request_context.h ('k') | net/base/cache_type.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/net/chrome_url_request_context.cc
===================================================================
--- chrome/browser/net/chrome_url_request_context.cc (revision 12517)
+++ chrome/browser/net/chrome_url_request_context.cc (working copy)
@@ -108,7 +108,7 @@
ChromeURLRequestContext* ChromeURLRequestContext::CreateOriginalForMedia(
Profile* profile, const FilePath& disk_cache_path) {
DCHECK(!profile->IsOffTheRecord());
- return CreateRequestContextForMedia(profile, disk_cache_path);
+ return CreateRequestContextForMedia(profile, disk_cache_path, false);
}
// static
@@ -137,12 +137,12 @@
// for media files in OTR mode, we create a request context just like the
// original one.
DCHECK(profile->IsOffTheRecord());
- return CreateRequestContextForMedia(profile, disk_cache_path);
+ return CreateRequestContextForMedia(profile, disk_cache_path, true);
}
// static
ChromeURLRequestContext* ChromeURLRequestContext::CreateRequestContextForMedia(
- Profile* profile, const FilePath& disk_cache_path) {
+ Profile* profile, const FilePath& disk_cache_path, bool off_the_record) {
URLRequestContext* original_context =
profile->GetOriginalProfile()->GetRequestContext();
ChromeURLRequestContext* context = new ChromeURLRequestContext(profile);
@@ -172,8 +172,13 @@
cache = new net::HttpCache(original_context->proxy_service(),
disk_cache_path.ToWStringHack(), kint32max);
}
+
// Set the cache type to media.
- cache->set_type(net::HttpCache::MEDIA);
+ if (off_the_record) {
+ cache->set_type(net::TEMP_MEDIA_CACHE);
+ } else {
+ cache->set_type(net::MEDIA_CACHE);
+ }
context->http_transaction_factory_ = cache;
return context;
« no previous file with comments | « chrome/browser/net/chrome_url_request_context.h ('k') | net/base/cache_type.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698