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

Unified Diff: net/url_request/url_request_redirect_job.h

Issue 422233006: Add fake headers to URLRequestRedirectJobs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix tests Created 6 years, 4 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/base/net_log_event_type_list.h ('k') | net/url_request/url_request_redirect_job.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request_redirect_job.h
diff --git a/net/url_request/url_request_redirect_job.h b/net/url_request/url_request_redirect_job.h
index 580fec2d109688747d84eb63f95cf5f4a25f325d..18c4e10ed20e0c4ac8fb4bab5d50a0efdc08097c 100644
--- a/net/url_request/url_request_redirect_job.h
+++ b/net/url_request/url_request_redirect_job.h
@@ -8,7 +8,9 @@
#include <string>
#include "base/memory/weak_ptr.h"
+#include "base/time/time.h"
#include "net/base/net_export.h"
+#include "net/http/http_response_info.h"
#include "net/url_request/url_request_job.h"
class GURL;
@@ -24,7 +26,7 @@ class NET_EXPORT URLRequestRedirectJob : public URLRequestJob {
// valid, but unused so far. Both 302 and 307 are temporary redirects, with
// the difference being that 302 converts POSTs to GETs and removes upload
// data.
- enum StatusCode {
+ enum ResponseCode {
REDIRECT_302_FOUND = 302,
REDIRECT_307_TEMPORARY_REDIRECT = 307,
};
@@ -34,16 +36,16 @@ class NET_EXPORT URLRequestRedirectJob : public URLRequestJob {
URLRequestRedirectJob(URLRequest* request,
NetworkDelegate* network_delegate,
const GURL& redirect_destination,
- StatusCode http_status_code,
+ ResponseCode response_code,
const std::string& redirect_reason);
- virtual void Start() OVERRIDE;
- virtual bool IsRedirectResponse(GURL* location,
- int* http_status_code) OVERRIDE;
- virtual bool CopyFragmentOnRedirect(const GURL& location) const OVERRIDE;
-
+ // URLRequestJob implementation:
+ virtual void GetResponseInfo(HttpResponseInfo* info) OVERRIDE;
virtual void GetLoadTimingInfo(
LoadTimingInfo* load_timing_info) const OVERRIDE;
+ virtual void Start() OVERRIDE;
+ virtual bool CopyFragmentOnRedirect(const GURL& location) const OVERRIDE;
+ virtual int GetResponseCode() const OVERRIDE;
private:
virtual ~URLRequestRedirectJob();
@@ -51,10 +53,13 @@ class NET_EXPORT URLRequestRedirectJob : public URLRequestJob {
void StartAsync();
const GURL redirect_destination_;
- const int http_status_code_;
+ const ResponseCode response_code_;
base::TimeTicks receive_headers_end_;
+ base::Time response_time_;
std::string redirect_reason_;
+ scoped_refptr<HttpResponseHeaders> fake_headers_;
+
base::WeakPtrFactory<URLRequestRedirectJob> weak_factory_;
};
« no previous file with comments | « net/base/net_log_event_type_list.h ('k') | net/url_request/url_request_redirect_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698