| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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_HTTP_HTTP_RESPONSE_HEADERS_H_ | 5 #ifndef NET_HTTP_HTTP_RESPONSE_HEADERS_H_ |
| 6 #define NET_HTTP_HTTP_RESPONSE_HEADERS_H_ | 6 #define NET_HTTP_HTTP_RESPONSE_HEADERS_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 bool GetMimeType(std::string* mime_type) const; | 164 bool GetMimeType(std::string* mime_type) const; |
| 165 | 165 |
| 166 // Get the charset in lower case from the headers. If there's no charset, | 166 // Get the charset in lower case from the headers. If there's no charset, |
| 167 // returns false. | 167 // returns false. |
| 168 bool GetCharset(std::string* charset) const; | 168 bool GetCharset(std::string* charset) const; |
| 169 | 169 |
| 170 // Returns true if this response corresponds to a redirect. The target | 170 // Returns true if this response corresponds to a redirect. The target |
| 171 // location of the redirect is optionally returned if location is non-null. | 171 // location of the redirect is optionally returned if location is non-null. |
| 172 bool IsRedirect(std::string* location) const; | 172 bool IsRedirect(std::string* location) const; |
| 173 | 173 |
| 174 // Returns true if the HTTP response code passed in corresponds to a |
| 175 // redirect. |
| 176 static bool IsRedirectResponseCode(int response_code); |
| 177 |
| 174 // Returns true if the response cannot be reused without validation. The | 178 // Returns true if the response cannot be reused without validation. The |
| 175 // result is relative to the current_time parameter, which is a parameter to | 179 // result is relative to the current_time parameter, which is a parameter to |
| 176 // support unit testing. The request_time parameter indicates the time at | 180 // support unit testing. The request_time parameter indicates the time at |
| 177 // which the request was made that resulted in this response, which was | 181 // which the request was made that resulted in this response, which was |
| 178 // received at response_time. | 182 // received at response_time. |
| 179 bool RequiresValidation(const base::Time& request_time, | 183 bool RequiresValidation(const base::Time& request_time, |
| 180 const base::Time& response_time, | 184 const base::Time& response_time, |
| 181 const base::Time& current_time) const; | 185 const base::Time& current_time) const; |
| 182 | 186 |
| 183 // Returns the amount of time the server claims the response is fresh from | 187 // Returns the amount of time the server claims the response is fresh from |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 | 338 |
| 335 // The parsed http version number (not normalized). | 339 // The parsed http version number (not normalized). |
| 336 HttpVersion parsed_http_version_; | 340 HttpVersion parsed_http_version_; |
| 337 | 341 |
| 338 DISALLOW_COPY_AND_ASSIGN(HttpResponseHeaders); | 342 DISALLOW_COPY_AND_ASSIGN(HttpResponseHeaders); |
| 339 }; | 343 }; |
| 340 | 344 |
| 341 } // namespace net | 345 } // namespace net |
| 342 | 346 |
| 343 #endif // NET_HTTP_HTTP_RESPONSE_HEADERS_H_ | 347 #endif // NET_HTTP_HTTP_RESPONSE_HEADERS_H_ |
| OLD | NEW |