OLD | NEW |
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_JOB_H_ | 5 #ifndef NET_URL_REQUEST_URL_REQUEST_JOB_H_ |
6 #define NET_URL_REQUEST_URL_REQUEST_JOB_H_ | 6 #define NET_URL_REQUEST_URL_REQUEST_JOB_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 // redirect. The HTTP status code (e.g., 302) is filled into | 150 // redirect. The HTTP status code (e.g., 302) is filled into |
151 // |*http_status_code| to signify the type of redirect. | 151 // |*http_status_code| to signify the type of redirect. |
152 // | 152 // |
153 // The caller is responsible for following the redirect by setting up an | 153 // The caller is responsible for following the redirect by setting up an |
154 // appropriate replacement Job. Note that the redirected location may be | 154 // appropriate replacement Job. Note that the redirected location may be |
155 // invalid, the caller should be sure it can handle this. | 155 // invalid, the caller should be sure it can handle this. |
156 // | 156 // |
157 // The default implementation inspects the response_info_. | 157 // The default implementation inspects the response_info_. |
158 virtual bool IsRedirectResponse(GURL* location, int* http_status_code); | 158 virtual bool IsRedirectResponse(GURL* location, int* http_status_code); |
159 | 159 |
| 160 // Called to determine if it is okay to copy the reference fragment from the |
| 161 // original URL (if existent) to the redirection target when the redirection |
| 162 // target has no reference fragment. |
| 163 // |
| 164 // The default implementation returns true. |
| 165 virtual bool CopyFragmentOnRedirect(const GURL& location) const; |
| 166 |
160 // Called to determine if it is okay to redirect this job to the specified | 167 // Called to determine if it is okay to redirect this job to the specified |
161 // location. This may be used to implement protocol-specific restrictions. | 168 // location. This may be used to implement protocol-specific restrictions. |
162 // If this function returns false, then the URLRequest will fail | 169 // If this function returns false, then the URLRequest will fail |
163 // reporting ERR_UNSAFE_REDIRECT. | 170 // reporting ERR_UNSAFE_REDIRECT. |
164 virtual bool IsSafeRedirect(const GURL& location); | 171 virtual bool IsSafeRedirect(const GURL& location); |
165 | 172 |
166 // Called to determine if this response is asking for authentication. Only | 173 // Called to determine if this response is asking for authentication. Only |
167 // makes sense for some types of requests. The caller is responsible for | 174 // makes sense for some types of requests. The caller is responsible for |
168 // obtaining the credentials passing them to SetAuth. | 175 // obtaining the credentials passing them to SetAuth. |
169 virtual bool NeedsAuth(); | 176 virtual bool NeedsAuth(); |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 NetworkDelegate* network_delegate_; | 423 NetworkDelegate* network_delegate_; |
417 | 424 |
418 base::WeakPtrFactory<URLRequestJob> weak_factory_; | 425 base::WeakPtrFactory<URLRequestJob> weak_factory_; |
419 | 426 |
420 DISALLOW_COPY_AND_ASSIGN(URLRequestJob); | 427 DISALLOW_COPY_AND_ASSIGN(URLRequestJob); |
421 }; | 428 }; |
422 | 429 |
423 } // namespace net | 430 } // namespace net |
424 | 431 |
425 #endif // NET_URL_REQUEST_URL_REQUEST_JOB_H_ | 432 #endif // NET_URL_REQUEST_URL_REQUEST_JOB_H_ |
OLD | NEW |