summaryrefslogtreecommitdiffstats
path: root/net/http
diff options
context:
space:
mode:
Diffstat (limited to 'net/http')
-rw-r--r--net/http/http_cache.cc9
-rw-r--r--net/http/http_cache_unittest.cc1
2 files changed, 10 insertions, 0 deletions
diff --git a/net/http/http_cache.cc b/net/http/http_cache.cc
index 913dc00..e447031 100644
--- a/net/http/http_cache.cc
+++ b/net/http/http_cache.cc
@@ -606,6 +606,15 @@ void HttpCache::Transaction::SetRequest(const HttpRequestInfo* request) {
if (cache_->mode() == RECORD)
effective_load_flags_ |= LOAD_BYPASS_CACHE;
+ // If HttpCache has type MEDIA make sure LOAD_ENABLE_DOWNLOAD_FILE is set,
+ // otherwise make sure LOAD_ENABLE_DOWNLOAD_FILE is not set when HttpCache
+ // has type other than MEDIA.
+ if (cache_->type() == HttpCache::MEDIA) {
+ DCHECK(effective_load_flags_ & LOAD_ENABLE_DOWNLOAD_FILE);
+ } else {
+ DCHECK(!(effective_load_flags_ & LOAD_ENABLE_DOWNLOAD_FILE));
+ }
+
// Some headers imply load flags. The order here is significant.
//
// LOAD_DISABLE_CACHE : no cache read or write
diff --git a/net/http/http_cache_unittest.cc b/net/http/http_cache_unittest.cc
index 5db229b..7fc5e5c 100644
--- a/net/http/http_cache_unittest.cc
+++ b/net/http/http_cache_unittest.cc
@@ -1225,6 +1225,7 @@ TEST(HttpCache, SimpleGET_MediaCache) {
#endif
ScopedMockTransaction trans_info(kSimpleGET_Transaction);
+ trans_info.load_flags |= net::LOAD_ENABLE_DOWNLOAD_FILE;
TestCompletionCallback callback;
{