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

Unified Diff: net/url_request/sdch_dictionary_fetcher.h

Issue 1880283002: Disallow redirects in SDCH dictionary fetches. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
Index: net/url_request/sdch_dictionary_fetcher.h
diff --git a/net/url_request/sdch_dictionary_fetcher.h b/net/url_request/sdch_dictionary_fetcher.h
index 7b18980ad43b2cc07395d70c63c410c2edaaa223..27cc8da7710fe4c5a5e23ffd6031c6a273807f48 100644
--- a/net/url_request/sdch_dictionary_fetcher.h
+++ b/net/url_request/sdch_dictionary_fetcher.h
@@ -62,6 +62,9 @@ class NET_EXPORT SdchDictionaryFetcher : public URLRequest::Delegate,
virtual void Cancel();
// Implementation of URLRequest::Delegate methods.
+ void OnReceivedRedirect(URLRequest* request,
+ const RedirectInfo& redirect_info,
+ bool* defer_redirect) override;
void OnResponseStarted(URLRequest* request) override;
void OnReadCompleted(URLRequest* request, int bytes_read) override;
@@ -69,7 +72,8 @@ class NET_EXPORT SdchDictionaryFetcher : public URLRequest::Delegate,
enum State {
STATE_NONE,
STATE_SEND_REQUEST,
- STATE_SEND_REQUEST_COMPLETE,
+ STATE_RECEIVED_REDIRECT,
+ STATE_SEND_REQUEST_PENDING,
STATE_READ_BODY,
STATE_READ_BODY_COMPLETE,
STATE_REQUEST_COMPLETE,
@@ -90,7 +94,8 @@ class NET_EXPORT SdchDictionaryFetcher : public URLRequest::Delegate,
// State machine implementation.
int DoLoop(int rv);
int DoSendRequest(int rv);
- int DoSendRequestComplete(int rv);
+ int DoReceivedRedirect(int rv);
+ int DoSendRequestPending(int rv);
int DoReadBody(int rv);
int DoReadBodyComplete(int rv);
int DoCompleteRequest(int rv);
@@ -110,6 +115,10 @@ class NET_EXPORT SdchDictionaryFetcher : public URLRequest::Delegate,
// The currently accumulating dictionary.
std::string dictionary_;
+ // In the case of a redirect, the URL to which the request is being
+ // redirected.
+ GURL redirect_url_;
+
// Store the URLRequestContext associated with the owning SdchManager for
// use while fetching.
URLRequestContext* const context_;
« no previous file with comments | « no previous file | net/url_request/sdch_dictionary_fetcher.cc » ('j') | net/url_request/sdch_dictionary_fetcher.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698