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

Unified Diff: net/http/http_cache.cc

Issue 113931: Remove code path that passes a file handle to the renderer... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 7 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 | « net/disk_cache/mem_entry_impl.h ('k') | net/http/http_cache_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_cache.cc
===================================================================
--- net/http/http_cache.cc (revision 17048)
+++ net/http/http_cache.cc (working copy)
@@ -587,15 +587,6 @@
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() == MEDIA_CACHE) {
- 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
@@ -786,14 +777,6 @@
if (!HttpCache::ReadResponseInfo(entry_->disk_entry, &response_))
return ERR_CACHE_READ_FAILURE;
-
- // If the cache object is used for media file, we want the file handle of
- // response data.
- if (cache_->type() == MEDIA_CACHE) {
- response_.response_data_file =
- entry_->disk_entry->GetPlatformFile(kResponseContentIndex);
- }
-
return OK;
}
@@ -854,20 +837,6 @@
if (!entry_)
return;
- // If the cache is for media files, we try to prepare the response data
- // file as an external file and truncate it afterwards.
- // Recipient of ResponseInfo should judge from |response_.response_data_file|
- // to tell whether an external file of response data is available for reading
- // or not.
- // TODO(hclam): we should prepare the target stream as extern file only
- // if we get a valid response from server, i.e. 200. We don't want empty
- // cache files for redirection or external files for erroneous requests.
- response_.response_data_file = base::kInvalidPlatformFileValue;
- if (cache_->type() == MEDIA_CACHE) {
- response_.response_data_file =
- entry_->disk_entry->UseExternalFile(kResponseContentIndex);
- }
-
// Truncate the stream.
WriteToEntry(kResponseContentIndex, 0, NULL, 0);
}
« no previous file with comments | « net/disk_cache/mem_entry_impl.h ('k') | net/http/http_cache_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698