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

Side by Side Diff: net/url_request/url_request_http_job.h

Issue 154473002: Support redirectUrl at onHeadersReceived in WebRequest / DWR API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 6 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef NET_URL_REQUEST_URL_REQUEST_HTTP_JOB_H_ 5 #ifndef NET_URL_REQUEST_URL_REQUEST_HTTP_JOB_H_
6 #define NET_URL_REQUEST_URL_REQUEST_HTTP_JOB_H_ 6 #define NET_URL_REQUEST_URL_REQUEST_HTTP_JOB_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 virtual LoadState GetLoadState() const OVERRIDE; 100 virtual LoadState GetLoadState() const OVERRIDE;
101 virtual UploadProgress GetUploadProgress() const OVERRIDE; 101 virtual UploadProgress GetUploadProgress() const OVERRIDE;
102 virtual bool GetMimeType(std::string* mime_type) const OVERRIDE; 102 virtual bool GetMimeType(std::string* mime_type) const OVERRIDE;
103 virtual bool GetCharset(std::string* charset) OVERRIDE; 103 virtual bool GetCharset(std::string* charset) OVERRIDE;
104 virtual void GetResponseInfo(HttpResponseInfo* info) OVERRIDE; 104 virtual void GetResponseInfo(HttpResponseInfo* info) OVERRIDE;
105 virtual void GetLoadTimingInfo( 105 virtual void GetLoadTimingInfo(
106 LoadTimingInfo* load_timing_info) const OVERRIDE; 106 LoadTimingInfo* load_timing_info) const OVERRIDE;
107 virtual bool GetResponseCookies(std::vector<std::string>* cookies) OVERRIDE; 107 virtual bool GetResponseCookies(std::vector<std::string>* cookies) OVERRIDE;
108 virtual int GetResponseCode() const OVERRIDE; 108 virtual int GetResponseCode() const OVERRIDE;
109 virtual Filter* SetupFilter() const OVERRIDE; 109 virtual Filter* SetupFilter() const OVERRIDE;
110 virtual bool IsRedirectResponse(
111 GURL* location, int* http_status_code) OVERRIDE;
110 virtual bool IsSafeRedirect(const GURL& location) OVERRIDE; 112 virtual bool IsSafeRedirect(const GURL& location) OVERRIDE;
111 virtual bool NeedsAuth() OVERRIDE; 113 virtual bool NeedsAuth() OVERRIDE;
112 virtual void GetAuthChallengeInfo(scoped_refptr<AuthChallengeInfo>*) OVERRIDE; 114 virtual void GetAuthChallengeInfo(scoped_refptr<AuthChallengeInfo>*) OVERRIDE;
113 virtual void SetAuth(const AuthCredentials& credentials) OVERRIDE; 115 virtual void SetAuth(const AuthCredentials& credentials) OVERRIDE;
114 virtual void CancelAuth() OVERRIDE; 116 virtual void CancelAuth() OVERRIDE;
115 virtual void ContinueWithCertificate(X509Certificate* client_cert) OVERRIDE; 117 virtual void ContinueWithCertificate(X509Certificate* client_cert) OVERRIDE;
116 virtual void ContinueDespiteLastError() OVERRIDE; 118 virtual void ContinueDespiteLastError() OVERRIDE;
117 virtual void ResumeNetworkStart() OVERRIDE; 119 virtual void ResumeNetworkStart() OVERRIDE;
118 virtual bool ReadRawData(IOBuffer* buf, int buf_size, 120 virtual bool ReadRawData(IOBuffer* buf, int buf_size,
119 int* bytes_read) OVERRIDE; 121 int* bytes_read) OVERRIDE;
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 base::TimeTicks start_time_; 244 base::TimeTicks start_time_;
243 245
244 // When the transaction finished reading the request headers. 246 // When the transaction finished reading the request headers.
245 base::TimeTicks receive_headers_end_; 247 base::TimeTicks receive_headers_end_;
246 248
247 scoped_ptr<HttpFilterContext> filter_context_; 249 scoped_ptr<HttpFilterContext> filter_context_;
248 base::WeakPtrFactory<URLRequestHttpJob> weak_factory_; 250 base::WeakPtrFactory<URLRequestHttpJob> weak_factory_;
249 251
250 CompletionCallback on_headers_received_callback_; 252 CompletionCallback on_headers_received_callback_;
251 253
254 // We allow the network delegate to redirect the response. If an URL is given,
255 // the response headers (except for the cookies) will be ignored and the job
256 // will restart using this new URL.
257 GURL override_redirect_url_;
258
252 // We allow the network delegate to modify a copy of the response headers. 259 // We allow the network delegate to modify a copy of the response headers.
253 // This prevents modifications of headers that are shared with the underlying 260 // This prevents modifications of headers that are shared with the underlying
254 // layers of the network stack. 261 // layers of the network stack.
255 scoped_refptr<HttpResponseHeaders> override_response_headers_; 262 scoped_refptr<HttpResponseHeaders> override_response_headers_;
256 263
257 // Flag used to verify that |this| is not deleted while we are awaiting 264 // Flag used to verify that |this| is not deleted while we are awaiting
258 // a callback from the NetworkDelegate. Used as a fail-fast mechanism. 265 // a callback from the NetworkDelegate. Used as a fail-fast mechanism.
259 // True if we are waiting a callback and 266 // True if we are waiting a callback and
260 // NetworkDelegate::NotifyURLRequestDestroyed has not been called, yet, 267 // NetworkDelegate::NotifyURLRequestDestroyed has not been called, yet,
261 // to inform the NetworkDelegate that it may not call back. 268 // to inform the NetworkDelegate that it may not call back.
262 bool awaiting_callback_; 269 bool awaiting_callback_;
263 270
264 const HttpUserAgentSettings* http_user_agent_settings_; 271 const HttpUserAgentSettings* http_user_agent_settings_;
265 272
266 DISALLOW_COPY_AND_ASSIGN(URLRequestHttpJob); 273 DISALLOW_COPY_AND_ASSIGN(URLRequestHttpJob);
267 }; 274 };
268 275
269 } // namespace net 276 } // namespace net
270 277
271 #endif // NET_URL_REQUEST_URL_REQUEST_HTTP_JOB_H_ 278 #endif // NET_URL_REQUEST_URL_REQUEST_HTTP_JOB_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698