diff options
author | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-05 06:38:52 +0000 |
---|---|---|
committer | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-05 06:38:52 +0000 |
commit | 703a31308be801fa9d7206bd0383d04f22eab2a1 (patch) | |
tree | e9c26259e2f0e9310546321f8d1581288803a3d8 /net | |
parent | 90f933a3b3ce799ebd2f1e04c8906ba0c6f514d9 (diff) | |
download | chromium_src-703a31308be801fa9d7206bd0383d04f22eab2a1.zip chromium_src-703a31308be801fa9d7206bd0383d04f22eab2a1.tar.gz chromium_src-703a31308be801fa9d7206bd0383d04f22eab2a1.tar.bz2 |
Highlights of changes:
1. Added entry to ResourceResponseHead so that it contains
either a base::PlatformFile (OS_WIN) or
base::FileDescriptor (OS_POSIX) for passing the file
handle from browser to renderer process.
2. Also added IPC messages for reporting download progress
and ACK message for it. ResourceLoaderBridge::Peer::OnDownloadProgress
is added so that the peer is notified of the download
progress in the renderer process.
3. Load flag to kick start the resource loading for media
files. LOAD_MEDIA_RESOURCE is added so that
ResourceDispatcherHost knows how to use a different
ResourceHandler for handling media resource request.
Review URL: http://codereview.chromium.org/27168
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10972 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r-- | net/base/load_flags.h | 3 | ||||
-rw-r--r-- | net/http/http_cache.cc | 9 | ||||
-rw-r--r-- | net/http/http_cache_unittest.cc | 1 | ||||
-rw-r--r-- | net/url_request/url_request.h | 7 |
4 files changed, 20 insertions, 0 deletions
diff --git a/net/base/load_flags.h b/net/base/load_flags.h index 7e3642a..7175713 100644 --- a/net/base/load_flags.h +++ b/net/base/load_flags.h @@ -37,6 +37,9 @@ enum { // If present, upload progress messages should be provided to initiator. LOAD_ENABLE_UPLOAD_PROGRESS = 1 << 6, + // If present, try to download the resource to a standalone file. + LOAD_ENABLE_DOWNLOAD_FILE = 1 << 7, + // If present, ignores certificate mismatches with the domain name. // (The default behavior is to trigger an OnSSLCertificateError callback.) LOAD_IGNORE_CERT_COMMON_NAME_INVALID = 1 << 8, 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; { diff --git a/net/url_request/url_request.h b/net/url_request/url_request.h index f4aee3a..fb25f45 100644 --- a/net/url_request/url_request.h +++ b/net/url_request/url_request.h @@ -307,6 +307,13 @@ class URLRequest { return response_info_.ssl_info; } + // Returns the platform specific file handle for the standalone file that + // contains response data. base::kInvalidPlatformFileValue is returned if + // such file is not available. + base::PlatformFile response_data_file() { + return response_info_.response_data_file; + } + // Returns the cookie values included in the response, if the request is one // that can have cookies. Returns true if the request is a cookie-bearing // type, false otherwise. This method may only be called once the |