diff options
author | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-23 19:10:23 +0000 |
---|---|---|
committer | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-23 19:10:23 +0000 |
commit | 195e77d6f2d2f615c2a5138750db124853c0a093 (patch) | |
tree | e1ea14d75832faa10ca8951e82c44a1e4b1a03ab /net/url_request/url_request_job.h | |
parent | 35350e871b173b3daa1e6e9921e1930ecc9331c4 (diff) | |
download | chromium_src-195e77d6f2d2f615c2a5138750db124853c0a093.zip chromium_src-195e77d6f2d2f615c2a5138750db124853c0a093.tar.gz chromium_src-195e77d6f2d2f615c2a5138750db124853c0a093.tar.bz2 |
Add support to URLRequest for deferring redirects.
I chose to add an out parameter to OnReceivedRedirect because it allows for the
default behavior to remain the same.
I considered adding a ContinueAfterRedirect method that all OnReceivedRedirect
implementations would need to call, but this caused one annoying problem: In
the case of a ChromePlugin, it is possible for the URLRequest to get deleted
inside the handler for the redirect. This would make it hard to subsequently
call a method on the URLRequest since I would need to have a way to determine
if the URLRequest had been deleted.
TEST=covered by unit tests
BUG=16413,6442
R=eroman,wtc
Review URL: http://codereview.chromium.org/155897
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21417 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/url_request/url_request_job.h')
-rw-r--r-- | net/url_request/url_request_job.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/net/url_request/url_request_job.h b/net/url_request/url_request_job.h index 558d9ad..8e56bea 100644 --- a/net/url_request/url_request_job.h +++ b/net/url_request/url_request_job.h @@ -11,6 +11,7 @@ #include "base/ref_counted.h" #include "base/scoped_ptr.h" #include "base/time.h" +#include "googleurl/src/gurl.h" #include "net/base/filter.h" #include "net/base/load_states.h" @@ -22,7 +23,6 @@ class UploadData; class X509Certificate; } -class GURL; class URLRequest; class URLRequestStatus; class URLRequestJobMetrics; @@ -182,6 +182,8 @@ class URLRequestJob : public base::RefCountedThreadSafe<URLRequestJob>, // Continue processing the request ignoring the last error. virtual void ContinueDespiteLastError(); + void FollowDeferredRedirect(); + // Returns true if the Job is done producing response data and has called // NotifyDone on the request. bool is_done() const { return done_; } @@ -348,6 +350,10 @@ class URLRequestJob : public base::RefCountedThreadSafe<URLRequestJob>, // Expected content size int64 expected_content_size_; + // Set when a redirect is deferred. + GURL deferred_redirect_url_; + int deferred_redirect_status_code_; + //---------------------------------------------------------------------------- // Data used for statistics gathering in some instances. This data is only // used for histograms etc., and is not required. It is optionally gathered |