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

Unified Diff: net/url_request/url_request_job.h

Issue 2917133002: Perform redirect checks before OnReceivedRedirect in //net. (Closed)
Patch Set: nasko comments Created 3 years, 6 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/url_request/url_request.cc ('k') | net/url_request/url_request_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_job.h
diff --git a/net/url_request/url_request_job.h b/net/url_request/url_request_job.h
index 2341999ae5493b1e205343963b41d8cbc68549de..913b879d8ce8354358e2fd4665cc6ca546790ff5 100644
--- a/net/url_request/url_request_job.h
+++ b/net/url_request/url_request_job.h
@@ -345,6 +345,10 @@ class NET_EXPORT URLRequestJob : public base::PowerObserver {
int buf_size,
const CompletionCallback& callback);
+ // Returns OK if |new_url| is a valid redirect target and an error code
+ // otherwise.
+ int CanFollowRedirect(const GURL& new_url);
+
// Called in response to a redirect that was not canceled to follow the
// redirect. The current job will be replaced with a new job loading the
// given redirect destination.
@@ -417,7 +421,8 @@ class NET_EXPORT URLRequestJob : public base::PowerObserver {
// Expected content size
int64_t expected_content_size_;
- // Set when a redirect is deferred.
+ // Set when a redirect is deferred. Redirects are deferred after validity
+ // checks are performed, so this field must not be modified.
RedirectInfo deferred_redirect_info_;
// The network delegate to use with this request, if any.
« no previous file with comments | « net/url_request/url_request.cc ('k') | net/url_request/url_request_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698