diff options
author | jar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-30 18:05:43 +0000 |
---|---|---|
committer | jar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-30 18:05:43 +0000 |
commit | 84973adbbbb48b4c5a12399695a83a09adcf648e (patch) | |
tree | d9a55a9befe69fad7cdcf7f9e4307d51e80079e8 /net/url_request | |
parent | 8d2b11162425baabd9dc06eaef5b201351cc7700 (diff) | |
download | chromium_src-84973adbbbb48b4c5a12399695a83a09adcf648e.zip chromium_src-84973adbbbb48b4c5a12399695a83a09adcf648e.tar.gz chromium_src-84973adbbbb48b4c5a12399695a83a09adcf648e.tar.bz2 |
Use HTTP status return code to make SDCH handling more robust.
At least one proxy replaces the SDCH content with an
error page (of HTML, without SDCH compression). We can
identify that scenario by spotting the 40x HTTP return
code (and the fact that the content is not SDCH encoded,
even though we advertised SDCH and a dictionary to the
server).
This change list adds the ability to access the return code
via the FilterContext. The bulk of the change is centered
on getting that access method to be const in all derived
classes.
bug=8916
r=wtc,huanr,openvcdiff
Review URL: http://codereview.chromium.org/56043
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12784 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/url_request')
-rw-r--r-- | net/url_request/url_request_http_job.cc | 2 | ||||
-rw-r--r-- | net/url_request/url_request_http_job.h | 2 | ||||
-rw-r--r-- | net/url_request/url_request_job.h | 4 | ||||
-rw-r--r-- | net/url_request/url_request_new_ftp_job.cc | 2 | ||||
-rw-r--r-- | net/url_request/url_request_new_ftp_job.h | 2 |
5 files changed, 6 insertions, 6 deletions
diff --git a/net/url_request/url_request_http_job.cc b/net/url_request/url_request_http_job.cc index 90a06a7..c0a2080 100644 --- a/net/url_request/url_request_http_job.cc +++ b/net/url_request/url_request_http_job.cc @@ -182,7 +182,7 @@ bool URLRequestHttpJob::GetResponseCookies( return true; } -int URLRequestHttpJob::GetResponseCode() { +int URLRequestHttpJob::GetResponseCode() const { DCHECK(transaction_.get()); if (!response_info_) diff --git a/net/url_request/url_request_http_job.h b/net/url_request/url_request_http_job.h index dbbdfab..19ecdf86 100644 --- a/net/url_request/url_request_http_job.h +++ b/net/url_request/url_request_http_job.h @@ -42,7 +42,7 @@ class URLRequestHttpJob : public URLRequestJob { virtual bool GetCharset(std::string* charset); virtual void GetResponseInfo(net::HttpResponseInfo* info); virtual bool GetResponseCookies(std::vector<std::string>* cookies); - virtual int GetResponseCode(); + virtual int GetResponseCode() const; virtual bool GetContentEncodings( std::vector<Filter::FilterType>* encoding_type); virtual bool IsSdchResponse() const; diff --git a/net/url_request/url_request_job.h b/net/url_request/url_request_job.h index f99ffdf..af12149 100644 --- a/net/url_request/url_request_job.h +++ b/net/url_request/url_request_job.h @@ -105,7 +105,7 @@ class URLRequestJob : public base::RefCountedThreadSafe<URLRequestJob>, } // Returns the HTTP response code for the request. - virtual int GetResponseCode() { return -1; } + virtual int GetResponseCode() const { return -1; } // Called to fetch the encoding types for this request. Only makes sense for // some types of requests. Returns true on success. Calling this on a request @@ -195,10 +195,10 @@ class URLRequestJob : public base::RefCountedThreadSafe<URLRequestJob>, // FilterContext methods: // These methods are not applicable to all connections. virtual bool GetMimeType(std::string* mime_type) const { return false; } - virtual int64 GetByteReadCount() const; virtual bool GetURL(GURL* gurl) const; virtual base::Time GetRequestTime() const; virtual bool IsCachedContent() const; + virtual int64 GetByteReadCount() const; virtual int GetInputStreamBufferSize() const { return kFilterBufSize; } protected: diff --git a/net/url_request/url_request_new_ftp_job.cc b/net/url_request/url_request_new_ftp_job.cc index 3101783..be2f2c6 100644 --- a/net/url_request/url_request_new_ftp_job.cc +++ b/net/url_request/url_request_new_ftp_job.cc @@ -56,7 +56,7 @@ void URLRequestNewFtpJob::GetResponseInfo() { NOTIMPLEMENTED(); } -int URLRequestNewFtpJob::GetResponseCode() { +int URLRequestNewFtpJob::GetResponseCode() const { NOTIMPLEMENTED(); return -1; } diff --git a/net/url_request/url_request_new_ftp_job.h b/net/url_request/url_request_new_ftp_job.h index 79b165c..2d3f186 100644 --- a/net/url_request/url_request_new_ftp_job.h +++ b/net/url_request/url_request_new_ftp_job.h @@ -31,7 +31,7 @@ class URLRequestNewFtpJob : public URLRequestJob { virtual void Kill(); virtual uint64 GetUploadProgress() const; virtual void GetResponseInfo(); - virtual int GetResponseCode(); + virtual int GetResponseCode() const; virtual bool GetMoreData(); virtual bool ReadRawData(net::IOBuffer* buf, int buf_size, int *bytes_read); |