| 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_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 <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 FreshnessLifetimes GetFreshnessLifetimes( | 246 FreshnessLifetimes GetFreshnessLifetimes( |
| 247 const base::Time& response_time) const; | 247 const base::Time& response_time) const; |
| 248 | 248 |
| 249 // Returns the age of the response. See section 13.2.3 of RFC 2616. | 249 // Returns the age of the response. See section 13.2.3 of RFC 2616. |
| 250 // See RequiresValidation for a description of this method's parameters. | 250 // See RequiresValidation for a description of this method's parameters. |
| 251 base::TimeDelta GetCurrentAge(const base::Time& request_time, | 251 base::TimeDelta GetCurrentAge(const base::Time& request_time, |
| 252 const base::Time& response_time, | 252 const base::Time& response_time, |
| 253 const base::Time& current_time) const; | 253 const base::Time& current_time) const; |
| 254 | 254 |
| 255 // The following methods extract values from the response headers. If a | 255 // The following methods extract values from the response headers. If a |
| 256 // value is not present, then false is returned. Otherwise, true is returned | 256 // value is not present, or is invalid, then false is returned. Otherwise, |
| 257 // and the out param is assigned to the corresponding value. | 257 // true is returned and the out param is assigned to the corresponding value. |
| 258 bool GetMaxAgeValue(base::TimeDelta* value) const; | 258 bool GetMaxAgeValue(base::TimeDelta* value) const; |
| 259 bool GetAgeValue(base::TimeDelta* value) const; | 259 bool GetAgeValue(base::TimeDelta* value) const; |
| 260 bool GetDateValue(base::Time* value) const; | 260 bool GetDateValue(base::Time* value) const; |
| 261 bool GetLastModifiedValue(base::Time* value) const; | 261 bool GetLastModifiedValue(base::Time* value) const; |
| 262 bool GetExpiresValue(base::Time* value) const; | 262 bool GetExpiresValue(base::Time* value) const; |
| 263 bool GetStaleWhileRevalidateValue(base::TimeDelta* value) const; | 263 bool GetStaleWhileRevalidateValue(base::TimeDelta* value) const; |
| 264 | 264 |
| 265 // Extracts the time value of a particular header. This method looks for the | 265 // Extracts the time value of a particular header. This method looks for the |
| 266 // first matching header value and parses its value as a HTTP-date. | 266 // first matching header value and parses its value as a HTTP-date. |
| 267 bool GetTimeValuedHeader(const std::string& name, base::Time* result) const; | 267 bool GetTimeValuedHeader(const std::string& name, base::Time* result) const; |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 421 | 421 |
| 422 // The normalized http version (consistent with what GetStatusLine() returns). | 422 // The normalized http version (consistent with what GetStatusLine() returns). |
| 423 HttpVersion http_version_; | 423 HttpVersion http_version_; |
| 424 | 424 |
| 425 DISALLOW_COPY_AND_ASSIGN(HttpResponseHeaders); | 425 DISALLOW_COPY_AND_ASSIGN(HttpResponseHeaders); |
| 426 }; | 426 }; |
| 427 | 427 |
| 428 } // namespace net | 428 } // namespace net |
| 429 | 429 |
| 430 #endif // NET_HTTP_HTTP_RESPONSE_HEADERS_H_ | 430 #endif // NET_HTTP_HTTP_RESPONSE_HEADERS_H_ |
| OLD | NEW |