summaryrefslogtreecommitdiffstats
path: root/net/url_request
diff options
context:
space:
mode:
authorthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-10 20:30:34 +0000
committerthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-10 20:30:34 +0000
commit61d74983f154e4b6d3e8501b212be6b27de3c500 (patch)
tree1cbcc9b05c45dac5151ebdcde1b24784897b9801 /net/url_request
parentbac96616d3ffdda096b65155c7dd9c2fd3d5bc4a (diff)
downloadchromium_src-61d74983f154e4b6d3e8501b212be6b27de3c500.zip
chromium_src-61d74983f154e4b6d3e8501b212be6b27de3c500.tar.gz
chromium_src-61d74983f154e4b6d3e8501b212be6b27de3c500.tar.bz2
Give the filter setup more context so it can figure out whether it's downloading a file or not. Only refuse to gunzip svgz files on download, so we can send an uncompressed svgz file to webkit.
BUG=9737 Review URL: http://codereview.chromium.org/62111 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13536 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/url_request')
-rw-r--r--net/url_request/url_request_job.cc6
-rw-r--r--net/url_request/url_request_job.h6
2 files changed, 12 insertions, 0 deletions
diff --git a/net/url_request/url_request_job.cc b/net/url_request/url_request_job.cc
index 4075ede..b5309c2 100644
--- a/net/url_request/url_request_job.cc
+++ b/net/url_request/url_request_job.cc
@@ -9,6 +9,7 @@
#include "googleurl/src/gurl.h"
#include "net/base/auth.h"
#include "net/base/io_buffer.h"
+#include "net/base/load_flags.h"
#include "net/base/net_errors.h"
#include "net/url_request/url_request.h"
#include "net/url_request/url_request_job_metrics.h"
@@ -30,6 +31,7 @@ URLRequestJob::URLRequestJob(URLRequest* request)
has_handled_response_(false),
expected_content_size_(-1),
filter_input_byte_count_(0) {
+ load_flags_ = request_->load_flags();
is_profiling_ = request->enable_profiling();
if (is_profiling()) {
metrics_.reset(new URLRequestJobMetrics());
@@ -53,6 +55,10 @@ void URLRequestJob::DetachRequest() {
request_ = NULL;
}
+bool URLRequestJob::IsDownload() const {
+ return (load_flags_ & net::LOAD_IS_DOWNLOAD) != 0;
+}
+
void URLRequestJob::SetupFilter() {
std::vector<Filter::FilterType> encoding_types;
if (GetContentEncodings(&encoding_types)) {
diff --git a/net/url_request/url_request_job.h b/net/url_request/url_request_job.h
index c120bf1..2289ce7 100644
--- a/net/url_request/url_request_job.h
+++ b/net/url_request/url_request_job.h
@@ -119,6 +119,9 @@ class URLRequestJob : public base::RefCountedThreadSafe<URLRequestJob>,
return false;
}
+ // Find out if this is a download.
+ virtual bool IsDownload() const;
+
// Find out if this is a response to a request that advertised an SDCH
// dictionary. Only makes sense for some types of requests.
virtual bool IsSdchResponse() const { return false; }
@@ -293,6 +296,9 @@ class URLRequestJob : public base::RefCountedThreadSafe<URLRequestJob>,
// NotifyDone so that it is kept in sync with the request.
bool done_;
+ // Cache the load flags from request_ because it might go away.
+ int load_flags_;
+
// The data stream filter which is enabled on demand.
scoped_ptr<Filter> filter_;